Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
144
Excess CPU usage by UltraGrid
posted

I have a UltraGrid to which i continously insert rows at the rate of 15rows/sec,  The grid has 50 rows and 14 columns, there is a datatable which am assigning to the datasource propery of the Grid and every time i create a new datarow and insert it to the datatable and then move it to the required postion in the grid.

Code is as follows

//m_dtMessagesView is my datatable

 

DataRow row = m_dtMessagesView.NewRow();

// here is the code to assign values to each column of new datarow i.e. row

 

m_dtMessagesView.Rows.InsertAt(row, 0);

 

 

 

 

 

int listIndex = m_dtMessagesView.Rows.IndexOf(row);

UltraGridRow ultraRow =

this.Rows.GetRowWithListIndex(listIndex);

 

 

if (this.DisplayLayout.Bands[0].Columns[4].SortIndicator == SortIndicator.Descending)

 

 

this.Rows.Move(ultraRow, 0);

This causes excessive CPU usage of 50% at the rate of insertion mentioned above.

I have also used BeginUpdate and EndUpdate as told Infragistic performance Guide. I tried inserting rows without any values to the column, which also had the same CPU usage.

 Thanks in advance,

Vinay