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.
Unfortunately, activation email could not send to your email. Please try again.

GridDataBoundGrid

Thread ID:

Created:

Updated:

Platform:

Replies:

95652 Jul 22,2010 10:58 AM Jul 28,2010 12:33 AM Windows Forms 1
loading
Tags: GridControl
Superjeka
Asked On July 22, 2010 10:58 AM

Hello!
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 12:33 AM

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

CONFIRMATION

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.

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.

;