What is the proper way to reset GridGroupingControl ? I have dataview attached to it, and I want to remove datavew, and reinitalise grid.
I tried doing gridGroupingControl1.DataSource = null;
but it takes literally minutes !
I can''t find any obvious methods to call to reset it.
AD
Administrator
Syncfusion Team
October 13, 2004 05:24 AM UTC
Hi Michael,
We had some issue with resetting grids which we fixed in recent private builds.
But try first if it works if you simply call
gridGroupingControl1.DataSource = null;
gridGroupingControl1.ResetTableDescriptor();
gridGroupingControl1.Refresh();
// if not, try also
gridGroupingControl1.Engine.SetSourceList(null);
after setting .DataSource = null;
If you continue to have trouble please open a support incident to obtain a latest private build.
Thanks,
Stefan
MF
Michael Feinstein
October 13, 2004 04:44 PM UTC
Doing just
>gridGroupingControl1.DataSource = null;
>gridGroupingControl1.ResetTableDescriptor();
>gridGroupingControl1.Refresh();
Did not help, but revealed a problem somewhat - the time is spent in Refresh() function.
Adding
>gridGroupingControl1.Engine.SetSourceList(null);
Removed this problem, however now the program is slow second time I initialise the grid.
The code for initalization is:
DataView dataViewOrdersForSelectedBin = new DataView(dataSet.Orders);
gridGroupingControlOrders.TableModel.BeginUpdate();
gridGroupingControlOrders.DataSource = dataViewOrdersForSelectedBin;
gridGroupingControlOrders.TableDescriptor.Relations.Clear();
gridGroupingControlOrders.TableModel.EndUpdate();
First time it works nice and fast, second time (after clearing grid in a way suggested above) program spends 30+ seconds in EndUpdate() call, with CPU pegged at 100%
AD
Administrator
Syncfusion Team
October 15, 2004 10:36 PM UTC
Any chance I can get a reply to the problem ?
>Doing just
>
>>gridGroupingControl1.DataSource = null;
>>gridGroupingControl1.ResetTableDescriptor();
>>gridGroupingControl1.Refresh();
>
>Did not help, but revealed a problem somewhat - the time is spent in Refresh() function.
>
>Adding
>
>>gridGroupingControl1.Engine.SetSourceList(null);
>
>Removed this problem, however now the program is slow second time I initialise the grid.
>
>The code for initalization is:
>
>DataView dataViewOrdersForSelectedBin = new DataView(dataSet.Orders);
>gridGroupingControlOrders.TableModel.BeginUpdate();
>gridGroupingControlOrders.DataSource = dataViewOrdersForSelectedBin;
>gridGroupingControlOrders.TableDescriptor.Relations.Clear();
>gridGroupingControlOrders.TableModel.EndUpdate();
>
>First time it works nice and fast, second time (after clearing grid in a way suggested above) program spends 30+ seconds in EndUpdate() call, with CPU pegged at 100%
AD
Administrator
Syncfusion Team
October 15, 2004 10:49 PM UTC
Sorry for missing your post. If you want a guaranteed reply, you should use our Direct Trac support system which is Syncfusion''s primary support venue.
So this is the exact code you are using.
gridGroupingControlOrders.TableModel.BeginUpdate();
gridGroupingControlOrders.DataSource = null;
gridGroupingControlOrders.ResetTableDescriptor();
gridGroupingControlOrders.Engine.SetSourceList(null);
gridGroupingControlOrders.TableDescriptor.Relations.Clear();
DataView dataViewOrdersForSelectedBin = new DataView(dataSet.Orders);
gridGroupingControlOrders.DataSource = dataViewOrdersForSelectedBin;
gridGroupingControlOrders.TableModel.EndUpdate();
gridGroupingControlOrders.Refresh();
And when you execute this code the second time, the refresh takes a long time.
Are there any exceptions being thrown during this long pause? (You can check the output window, or set the debugger to break on exception).
AD
Administrator
Syncfusion Team
October 16, 2004 07:40 AM UTC
Hi Michael,
I am also sorry for not replying.
We have made fixes especially in this area and if you continue to have problems you should open a dtrac incident so that we can send you a latest private patch.
Thanks,
Stefan
MF
Michael Feinstein
October 19, 2004 09:06 PM UTC
I was running slightly different code (2 methods - close and open).
I changed code to look excatly as the one above and the slowness on the second run is still there, now it''s in "EndUpdate()" method. I will go ahead and submit Incident.