We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date
close icon

Can GridDataBoundGrid paint only visible area?

Hi,

I have a GridDataBoundGrid and it is bound to a dataset. I am showing parent child relation as in the dataset in the grid(grouping).

the dataset i get from datasource at every some time interval say 1 sec. and i am rebinding the new dataset with the grid.

the things are working fine, but as the data increases, CPU utilization of the process increases.

can u please let me know the possible solutions for this?

can i instruct GridDataBoundGrid to paint only the visible area?

Please let me know at the earliest.

Thanks and Regards,

Rahul Srivastava

3 Replies

GR Golda Rebecal Syncfusion Team August 21, 2007 05:40 AM UTC

Hi Rahul,

Please refer to the following KB article that shows how to efficiently directly modify the underlying DataSource when it is bound to the DataBoundGrid.

http://www.syncfusion.com/support/kb/grid/Default.aspx?ToDo=view&questId=99

Kindly let me know if this helps you.

Best regards,
Golda


RS Rahul Srivastava August 21, 2007 09:44 AM UTC

Hi,
I am already doing as suggested in the link you provided.

here is the sample code of what i am doing.

grdData.Binder.ResetHierarchyLevels();

int vpos = this.grdData.GetCurrentVScrollPixelPos();
int hpos = this.grdData.GetCurrentHScrollPixelPos();

grdData.FreezePainting = true;

grdData.ShowCurrentCellBorderBehavior = GridShowCurrentCellBorder.HideAlways;
grdData.BeginUpdate();
grdData.Binder.SuspendBinding();

grdData.DataMember = "BasketTable";
grdData.DataSource = dsParentChild;
grdData.Binder.EnableAddNew = false;

GridHierarchyLevel rootlevel = grdData.Binder.RootHierarchyLevel;

for(int i = 1;i < Common.NumberOfColumns;i++)
{
// Setting the header texts grdData.Binder.InternalColumns[i-1].HeaderText = Common.GetColumnHeaderText(i);
}

grdData.Binder.ResumeBinding();
grdData.EndUpdate();

this.grdData.SetCurrentHScrollPixelPos(hpos);
this.grdData.SetCurrentVScrollPixelPos(vpos);

grdData.ShowCurrentCellBorderBehavior = GridShowCurrentCellBorder.AlwaysVisible;
grdData.FreezePainting = false;


the above code is working fine, but with huge amount of data, CPU Utilization is very high.

Please let me know any reason for it.



GR Golda Rebecal Syncfusion Team August 21, 2007 12:22 PM UTC

Hi Rahul,

We always recommend the developers to use GridGroupingControl to bind with large datasource and for higher performances, especially hierarchical datasources. The GridDataBoundGrid will be obsolete much sooner and no performance enhancement will be done in our future releases.

GridGroupingControl has lot of additional features when compared to GridDataBoundGrid. For more information on GridGroupingControl, you can refer to our browser samples for GridGroupingControl, that has been shipped with our product.
You can access those samples from the following location.
C:\Program Files\Syncfusion\Essential Studio\5.1.0.51\windows\Grid.Grouping.Windows\Samples

Kindly let me know if you need any further assistance.

Best regards,
Golda

Loader.
Live Chat Icon For mobile
Up arrow icon