Click here to Skip to main content
15,917,174 members
Home / Discussions / C#
   

C#

 
AnswerRe: Get list of all emails in outlook / windows mail / express client Pin
Thomas Stockwell27-Oct-08 1:51
professionalThomas Stockwell27-Oct-08 1:51 
GeneralRe: Get list of all emails in outlook / windows mail / express client Pin
EliottA27-Oct-08 2:11
EliottA27-Oct-08 2:11 
GeneralRe: Get list of all emails in outlook / windows mail / express client Pin
Thomas Stockwell27-Oct-08 2:17
professionalThomas Stockwell27-Oct-08 2:17 
GeneralRe: Get list of all emails in outlook / windows mail / express client Pin
EliottA27-Oct-08 2:53
EliottA27-Oct-08 2:53 
QuestionSetup / installer Pin
Jacob Dixon26-Oct-08 15:48
Jacob Dixon26-Oct-08 15:48 
AnswerRe: Setup / installer Pin
AhsanS26-Oct-08 18:55
AhsanS26-Oct-08 18:55 
AnswerRe: Setup / installer Pin
jzonthemtn27-Oct-08 1:59
jzonthemtn27-Oct-08 1:59 
QuestionDataGridView RowCount set is slow Pin
AndrusM26-Oct-08 13:17
AndrusM26-Oct-08 13:17 
I have DataGridView in virtual mode containing 3500 rows.
In code below, assigning to RowCount value to 3500 takes 8 seconds.
CPU usage goes high at this time.
Stepping by F11 into user code shows few celltemplate property getters and
combobox/datecombo constructor calls without database access which does not
take a lot of time.

Debug output (below) shows lot of messages Stepping over non-user code.
Running in release mode from Windows this line speed is same (slow).

How to speed up grid creation ?

Using C# Express 2008 3.5 SP1 in Vista.

class Grid : System.Windows.Forms.DataGridView {

        internal void SetDataRetriever(DataRetriever<TEntity> dataRetriever)
        { ......
            SuspendLayout();
            Enabled  = false;
            int cnt = DataRetriever.RowCount + (ReadOnly ? 0 : 1);
            // next line takes 8 seconds:
            RowCount = cnt;
            Enabled = true;
            ResumeLayout();
        }

        protected override void
OnCellValueNeeded(DataGridViewCellValueEventArgs e)
        {
            if (!Enabled)
                return;
             ...
        }

        protected override void OnRowEnter(DataGridViewCellEventArgs e)
        {
            if (!Enabled)
                return;
            ...
         }
}

Debug output window contains:

Step into: Stepping over non-user code
'System.Windows.Forms.DataGridView.RowCount.set'
Step into: Stepping over non-user code
'System.Windows.Forms.DataGridViewColumn.CellTemplate.get'
Step into: Stepping over non-user code
'System.Windows.Forms.DataGridView.CompleteCellsCollection'
Step into: Stepping over non-user code
'System.Windows.Forms.DataGridViewColumn.CellTemplate.get'
Step into: Stepping over non-user code
'System.Windows.Forms.DataGridView.CompleteCellsCollection'
Step into: Stepping over non-user code
'System.Windows.Forms.DataGridViewTextBoxCell.DataGridViewTextBoxCell'
Step into: Stepping over non-user code
'System.Windows.Forms.PropertyStore.GetObject'
Step into: Stepping over non-user code
'System.Windows.Forms.DataGridViewCell.Style.get'
Step into: Stepping over non-user code
'System.Windows.Forms.DataGridViewTextBoxCell.Clone'
Step into: Stepping over non-user code
'System.Windows.Forms.DataGridView.CompleteCellsCollection'
Step into: Stepping over non-user code
'System.Windows.Forms.DataGridViewColumn.CellTemplate.get'
Step into: Stepping over non-user code
'System.Windows.Forms.DataGridView.CompleteCellsCollection'
Step into: Stepping over non-user code
'System.Windows.Forms.DataGridViewColumn.CellTemplate.get'
Step into: Stepping over non-user code
'System.Windows.Forms.DataGridView.CompleteCellsCollection'
Step into: Stepping over non-user code
'System.Windows.Forms.DataGridViewTextBoxCell.DataGridViewTextBoxCell'
Step into: Stepping over non-user code
'System.Windows.Forms.PropertyStore.GetObject'
Step into: Stepping over non-user code
'System.Windows.Forms.DataGridViewCell.Style.get'
Step into: Stepping over non-user code
'System.Windows.Forms.DataGridViewTextBoxCell.Clone'
Step into: Stepping over non-user code
'System.Windows.Forms.DataGridView.CompleteCellsCollection'
Step into: Stepping over non-user code
'System.Windows.Forms.DataGridViewColumn.CellTemplate.get'
Step into: Stepping over non-user code
'System.Windows.Forms.DataGridView.CompleteCellsCollection'
Step into: Stepping over non-user code
'System.Windows.Forms.DataGridViewColumn.CellTemplate.get'
Step into: Stepping over non-user code
'System.Windows.Forms.DataGridView.CompleteCellsCollection'
Step into: Stepping over non-user code
'System.Windows.Forms.DataGridViewTextBoxCell.DataGridViewTextBoxCell'
Step into: Stepping over non-user code
'System.Windows.Forms.PropertyStore.GetObject'
Step into: Stepping over non-user code
'System.Windows.Forms.DataGridViewCell.Style.get'
Step into: Stepping over non-user code
'System.Windows.Forms.DataGridViewTextBoxCell.Clone'
Step into: Stepping over non-user code
'System.Windows.Forms.DataGridView.CompleteCellsCollection'
Step into: Stepping over non-user code
'System.Windows.Forms.DataGridView.CompleteCellsCollection'
Step into: Stepping over non-user code
'System.Windows.Forms.DataGridView.CompleteCellsCollection'
Step into: Stepping over non-user code
'System.Windows.Forms.DataGridViewComboBoxCell.DataGridViewComboBoxCell'
Step into: Stepping over non-user code
'System.Windows.Forms.DataGridViewComboBoxCell.FlatStyle.set'
Step into: Stepping over non-user code
'System.Windows.Forms.DataGridViewComboBoxCell.DisplayStyleForCurrentCellOnly.set'
Step into: Stepping over non-user code
'System.Windows.Forms.DataGridViewComboBoxCell.Clone'
Step into: Stepping over non-user code
'System.Windows.Forms.DataGridView.CompleteCellsCollection'
Step into: Stepping over non-user code
'System.Windows.Forms.DataGridViewColumn.CellTemplate.get'
Step into: Stepping over non-user code
'System.Windows.Forms.DataGridView.CompleteCellsCollection'
Step into: Stepping over non-user code
'System.Windows.Forms.DataGridViewColumn.CellTemplate.get'
Step into: Stepping over non-user code
'System.Windows.Forms.DataGridView.CompleteCellsCollection'
Step into: Stepping over non-user code
'System.Windows.Forms.DataGridViewTextBoxCell.DataGridViewTextBoxCell'
Step into: Stepping over non-user code
'System.Windows.Forms.PropertyStore.GetObject'
Step into: Stepping over non-user code
'System.Windows.Forms.DataGridViewCell.Style.get'
Step into: Stepping over non-user code
'System.Windows.Forms.DataGridViewTextBoxCell.Clone'
Step into: Stepping over non-user code
'System.Windows.Forms.DataGridView.CompleteCellsCollection'
Step into: Stepping over non-user code
'System.Windows.Forms.DataGridView.CompleteCellsCollection'
Step into: Stepping over non-user code
'System.Windows.Forms.DataGridView.CompleteCellsCollection'
Step into: Stepping over non-user code
'System.Windows.Forms.DataGridViewComboBoxCell.DataGridViewComboBoxCell'
Step into: Stepping over non-user code
'System.Windows.Forms.DataGridViewComboBoxCell.FlatStyle.set'
Step into: Stepping over non-user code
'System.Windows.Forms.DataGridViewComboBoxCell.DisplayStyleForCurrentCellOnly.set'
Step into: Stepping over non-user code
'System.Windows.Forms.DataGridViewComboBoxCell.Clone'
Step into: Stepping over non-user code
'System.Windows.Forms.DataGridView.CompleteCellsCollection'
Step into: Stepping over non-user code
'System.Windows.Forms.DataGridView.RowTemplateClone.get'
Step into: Stepping over non-user code
'System.Windows.Forms.DataGridViewRowCollection.Add'
Step into: Stepping over non-user code
'System.Windows.Forms.Control.Enabled.get'
Step into: Stepping over non-user code
'System.Windows.Forms.DataGridView.OnRowEnter'
Step into: Stepping over non-user code
'System.Windows.Forms.DataGridView.SetCurrentCellAddressCore'
Step into: Stepping over non-user code
'System.Windows.Forms.DataGridView.SetAndSelectCurrentCellAddress'
Step into: Stepping over non-user code
'System.Windows.Forms.DataGridViewTextBoxCell.DataGridViewTextBoxCell'
Step into: Stepping over non-user code
'System.Windows.Forms.PropertyStore.GetObject'
Step into: Stepping over non-user code
'System.Windows.Forms.DataGridViewCell.Style.get'
Step into: Stepping over non-user code
'System.Windows.Forms.DataGridViewTextBoxCell.Clone'
Step into: Stepping over non-user code
'System.Windows.Forms.DataGridViewRow.CloneCells'
Step into: Stepping over non-user code
'System.Windows.Forms.DataGridViewTextBoxCell.DataGridViewTextBoxCell'
Step into: Stepping over non-user code
'System.Windows.Forms.PropertyStore.GetObject'
Step into: Stepping over non-user code
'System.Windows.Forms.DataGridViewCell.Style.get'
Step into: Stepping over non-user code
'System.Windows.Forms.DataGridViewTextBoxCell.Clone'
Step into: Stepping over non-user code
'System.Windows.Forms.DataGridViewRow.CloneCells'
Step into: Stepping over non-user code
'System.Windows.Forms.DataGridViewTextBoxCell.DataGridViewTextBoxCell'
Step into: Stepping over non-user code
'System.Windows.Forms.PropertyStore.GetObject'
Step into: Stepping over non-user code
'System.Windows.Forms.DataGridViewCell.Style.get'
Step into: Stepping over non-user code
'System.Windows.Forms.DataGridViewTextBoxCell.Clone'
Step into: Stepping over non-user code
'System.Windows.Forms.DataGridViewRow.CloneCells'
Step into: Stepping over non-user code
'System.Windows.Forms.DataGridViewComboBoxCell.DataGridViewComboBoxCell'
Step into: Stepping over non-user code
'System.Windows.Forms.DataGridViewComboBoxCell.FlatStyle.set'
Step into: Stepping over non-user code
'System.Windows.Forms.DataGridViewComboBoxCell.DisplayStyleForCurrentCellOnly.set'
Step into: Stepping over non-user code
'System.Windows.Forms.DataGridViewComboBoxCell.Clone'
Step into: Stepping over non-user code
'System.Windows.Forms.DataGridViewRow.CloneCells'
Step into: Stepping over non-user code
'System.Windows.Forms.DataGridViewTextBoxCell.DataGridViewTextBoxCell'
Step into: Stepping over non-user code
'System.Windows.Forms.PropertyStore.GetObject'
Step into: Stepping over non-user code
'System.Windows.Forms.DataGridViewCell.Style.get'
Step into: Stepping over non-user code
'System.Windows.Forms.DataGridViewTextBoxCell.Clone'
Step into: Stepping over non-user code
'System.Windows.Forms.DataGridViewRow.CloneCells'
Step into: Stepping over non-user code
'System.Windows.Forms.DataGridViewComboBoxCell.DataGridViewComboBoxCell'
Step into: Stepping over non-user code
'System.Windows.Forms.DataGridViewComboBoxCell.FlatStyle.set'
Step into: Stepping over non-user code
'System.Windows.Forms.DataGridViewComboBoxCell.DisplayStyleForCurrentCellOnly.set'
Step into: Stepping over non-user code
'System.Windows.Forms.DataGridViewComboBoxCell.Clone'
Step into: Stepping over non-user code
'System.Windows.Forms.DataGridViewRow.CloneCells'
Step into: Stepping over non-user code
'System.Windows.Forms.DataGridViewRow.Clone'
Step into: Stepping over non-user code
'System.Windows.Forms.DataGridViewRowCollection.this[int].get'
Step into: Stepping over non-user code
'System.Windows.Forms.DataGridView.SetSelectedCellCore'
Step into: Stepping over non-user code
'System.Windows.Forms.DataGridView.SetSelectedElementCore'
Step into: Stepping over non-user code
'System.Windows.Forms.DataGridView.ClearSelection'
Step into: Stepping over non-user code
'System.Windows.Forms.DataGridView.SetAndSelectCurrentCellAddress'
Step into: Stepping over non-user code
'System.Windows.Forms.DataGridView.OnRowCollectionChanged_PostNotification'
Step into: Stepping over non-user code
'System.Windows.Forms.DataGridViewRowCollection.InsertCopiesPrivate'
Step into: Stepping over non-user code
'System.Windows.Forms.DataGridViewRowCollection.Add'

Andrus

QuestionCan FtpWebRequest handle only two connections simutaniously ? Pin
quorton26-Oct-08 11:07
quorton26-Oct-08 11:07 
AnswerRe: Can FtpWebRequest handle only two connections simutaniously ? Pin
leppie26-Oct-08 22:50
leppie26-Oct-08 22:50 
GeneralRe: Can FtpWebRequest handle only two connections simutaniously ? Pin
quorton27-Oct-08 0:15
quorton27-Oct-08 0:15 
GeneralRe: Can FtpWebRequest handle only two connections simutaniously ? Pin
leppie27-Oct-08 0:21
leppie27-Oct-08 0:21 
GeneralRe: Can FtpWebRequest handle only two connections simutaniously ? Pin
Pete O'Hanlon27-Oct-08 1:36
mvePete O'Hanlon27-Oct-08 1:36 
GeneralRe: Can FtpWebRequest handle only two connections simutaniously ? Pin
quorton27-Oct-08 2:00
quorton27-Oct-08 2:00 
GeneralRe: Can FtpWebRequest handle only two connections simutaniously ? Pin
Pete O'Hanlon27-Oct-08 5:40
mvePete O'Hanlon27-Oct-08 5:40 
Questioninternet connection [modified] Pin
MS Hamedi26-Oct-08 7:58
MS Hamedi26-Oct-08 7:58 
AnswerRe: internet connection Pin
Mbah Dhaim26-Oct-08 13:18
Mbah Dhaim26-Oct-08 13:18 
QuestionRetrieve GAL from Microsoft Exchange Pin
Jassim Rahma26-Oct-08 4:13
Jassim Rahma26-Oct-08 4:13 
AnswerRe: Retrieve GAL from Microsoft Exchange Pin
Eddy Vluggen27-Oct-08 1:39
professionalEddy Vluggen27-Oct-08 1:39 
GeneralRe: Retrieve GAL from Microsoft Exchange Pin
EliottA27-Oct-08 6:19
EliottA27-Oct-08 6:19 
AnswerRe: Retrieve GAL from Microsoft Exchange Pin
Eddy Vluggen27-Oct-08 11:08
professionalEddy Vluggen27-Oct-08 11:08 
QuestionAUDIO frequency per second ? Pin
sana1726-Oct-08 4:01
sana1726-Oct-08 4:01 
AnswerRe: AUDIO frequency per second ? Pin
sana1726-Oct-08 4:08
sana1726-Oct-08 4:08 
GeneralRe: AUDIO frequency per second ? Pin
Shyam Bharath27-Oct-08 0:35
Shyam Bharath27-Oct-08 0:35 
AnswerRe: AUDIO frequency per second ? Pin
Mark Churchill26-Oct-08 13:37
Mark Churchill26-Oct-08 13:37 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.