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. (Last updated on: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback


Thread ID:





95652 Jul 22,2010 02:58 PM UTC Jul 28,2010 04:33 AM UTC WinForms 1
Tags: GridControl
Asked On July 22, 2010 02:58 PM UTC

I need your assistance in the following:
For the GridDataBoundGrid named gridDataBoundGrid connected to a DataSource I need to know at run time:
1. What event tells me the grid finished loading all the data and the data can be accessed?
2. Given AllowResizeToFit == true, what event tells me that all columns finished resizing?
3. What is the difference between the properties gridDataBoundGrid.GridBoundColumns gridDataBoundGrid.Binder.InternalColumns ?
4. When I connect the grid to a BindingSource then gridDataBoundGrid.Model.ColCount shows the correct number of columns, identical to gridDataBoundGrid.Binder.InternalColumns.Count, however gridDataBoundGrid.GridBounColumns.Count returns 0.
When I build a Collection of GridBoundColumns in design mode, all 3 properties are identical. How can I access the columns and their properties without knowing how they were originally designed? Is there another option not mentioned above?

Many thanks in advance.

Jisha Joy [Syncfusion]
Replied On July 28, 2010 04:33 AM UTC


Thank you for using Syncfusion products.

You could use the following code to trace out the datasource binding in GriddataBoundGrid.

CurrencyManager cm = (CurrencyManager)this.BindingContext[this.gridDataBoundGrid1.DataSource, this.gridDataBoundGrid1.DataMember];

cm.BindingComplete += new BindingCompleteEventHandler(cm_BindingComplete);

You could acheive the desired behavior Model.QueryColWidth event of gridDataboundgrid.

this.gridDataBoundGrid1.Model.QueryColWidth += new GridRowColSizeEventHandler(Model_QueryColWidth);

There is a difference between InternalColumns and GridBoundColumns is whether or not you have explicitly added any GridBoundColumn objects to the GridBoundColumns collection. InternalColumns collection will hold the same columns as GridBoundColumns if you have explicitly populated GridBoundColumns.

If you have not explicitly added columns to the GridBoundColumns collection (either through the designer or through code), then the GridBoundColumns (and also grid.GridBoundColumns) will be empty even after setting the grid.DataSource property. In this case, binder.InternalColumns will automatically be populated with the columns from the DataSource at the time the grid.DataSource property is set.

If you do explicilty add GridBoundColumn objects to the GridBoundColumn collection, then both the binder.GridBoundColumns and binder.InternalColumns will reflect exactly the columns that you have added to the binder.GridBoundColumns collection. (ie., binder.InternalColumns is not automatically set to all the columns in the datasource when grid.DataSource is set).

So, you can use the GridBoundColumns collection only if it has been explicitly populated by you. You can use InternalColumns whether or not GridBoundColumns has been populated.



This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Please sign in to access our forum

or the page will be automatically redirected to sign-in page in 10 seconds.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon