JJ
Jisha Joy
Syncfusion Team
July 28, 2010 04:33 AM UTC
Hi,
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.
Regards,
Jisha