This is a migrated thread and some comments may be shown as answers.

How to inprove the performance when the cells value change very fast

8 Answers 177 Views
GridView
This is a migrated thread and some comments may be shown as answers.
kevin
Top achievements
Rank 1
kevin asked on 20 Jan 2011, 08:18 AM
hi there

I bind the bindinglist<T> to the gridview. when the every custom object's property value change very ofen ,the corresponding cell's value can change also.But it take too much CPU(around 60%).
I have a custom object inherit from INotifyPropertyChanged.
The custom object have three properties, and every property's value change per 50ms.
I add 30 custom objects to the Bindinglist<T>,and bind the list to radGridview.

I use the 2010 q2 version.

8 Answers, 1 is accepted

Sort by
0
Accepted
Emanuel Varga
Top achievements
Rank 1
answered on 20 Jan 2011, 08:37 AM
Hello Kevin,

I would propose using a timer, and refresh the grid just once / sec. The user or anybody for that measure won't be able to see changes occurring every 50 ms, so just use a timer, suspend notifications and every 1 sec resume notifications and suspend them again. Or just suspend all notifications, and perform a refresh on the grid every 1 sec.

Hope this helps, if you have any other questions or comments, please let me know,

Best Regards,
Emanuel Varga
Telerik WinForms MVP
0
kevin
Top achievements
Rank 1
answered on 20 Jan 2011, 09:21 AM
I changed my the frequency.Now every cell value change per 500ms.
But i added the coloumn's number to 12.
Now the program take the cpu lower(around 20%).
In the same inviroment ,i use the datagriview ,the program take the cpu very little(around 0%).

I want to use the radgridview very much ,but i meet the profomance problemn.
0
Accepted
Emanuel Varga
Top achievements
Rank 1
answered on 20 Jan 2011, 09:44 AM
Hello again,

Please try wrapping the update of the data source in a grid.BeginUpdate() .. // add data // ..  grid.EndUpdate() or using (grid.DeferRefresh()) {};
please let me know if this helped.

Hope this helps, if you have any other questions or comments, please let me know,

Best Regards,
Emanuel Varga
Telerik WinForms MVP
0
kevin
Top achievements
Rank 1
answered on 20 Jan 2011, 10:27 AM
Hi again

I change the datasource by firing Time1.Tick event.

private void timer1_Tick(object sender, EventArgs e)
        {
            this.radGridView1.BeginUpdate();
            for (int id = 0; id < 30; id++)
            {               
                myList[id].MyString = DateTime.Now.ToString("yyyy-MM-dd mm:ss:fff");
                myList[id].MyThirdString = DateTime.Now.ToString("yyyy-MM-dd mm:ss:fff");
                myList[id].MyLastString = DateTime.Now.ToString("yyyy-MM-dd mm:ss:fff");
                myList[id].My5String = DateTime.Now.ToString("yyyy-MM-dd mm:ss:fff");
                myList[id].My6String = DateTime.Now.ToString("yyyy-MM-dd mm:ss:fff");
            }


            this.radGridView1.EndUpdate();
        }
I use the BeginUpdate() and EndUpdate(), the cpu was taken higher(around 60%).

0
Richard Slade
Top achievements
Rank 2
answered on 20 Jan 2011, 10:34 AM
Hi Kevin,

May I suggest having a look at the demos on your PC. There is a performance demo with a high refresh rate using a timer as Emanuel has suggested. You can find these on your PC in the demos under Grid View >> Performance >> High Refresh

If you have any other question, just let me know
Richard
0
kevin
Top achievements
Rank 1
answered on 20 Jan 2011, 10:43 AM
hello Richard

I'v tried that example.it take cup very high. my computer's cpu was taken 90%,and my colleague computer's cpu was taken 60%.
0
Accepted
Richard Slade
Top achievements
Rank 2
answered on 20 Jan 2011, 10:59 AM
Hello Kevin,

You may also want to look at implementing Virtual Mode as per this documentaiton which basically means you provide your own data management operations, which in some cases can increase performance.
Regards,
Richard
0
Julian Benkov
Telerik team
answered on 25 Jan 2011, 10:36 AM
Hello kevin,

If you continue to experience the issue, please open support ticket and send us a simple application with your data objects to investigate the issue locally. Thank you for your cooperation.

Kind regards,
Julian Benkov
the Telerik team

Q3’10 SP1 of RadControls for WinForms is available for download; also available is the Q1'11 Roadmap for Telerik Windows Forms controls.
Tags
GridView
Asked by
kevin
Top achievements
Rank 1
Answers by
Emanuel Varga
Top achievements
Rank 1
kevin
Top achievements
Rank 1
Richard Slade
Top achievements
Rank 2
Julian Benkov
Telerik team
Share this question
or