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

Dyanamically adding datasource in a GridGrouping control

Hi,

I am using GridGrouping control on a web page (added at design time). I get data in a datatable based on user selection. Add this datatable as datasource to the GridGrouping control dynamically in the code( I can't add the datasource in the Page_init method since I don't have datatable with data until the user selects the data).
In Page_load, I added to this.GridGroupAlerts.Visible = false; so that the Grid doesn't get loaded.

In another function, I do this,

this.GridGroupAlerts.Visible = true;
GridGroupAlerts.DataSource = AllAlertData;
this.GridGroupAlerts.DataBind();
I specified all the fields(datatable) to the GridGrouping control at design time as part of the tabledescriptor columns.

For whatever reason, I don't see any data populated in the Grid.

Could you provide an example where you don't have to add the datasource as part of the page_init. and also be able to add the fields as part of design time table descriptor.

Thanks!!

1 Reply

GB Gokul B Syncfusion Team February 8, 2007 12:49 AM UTC

Hi Rekha,

Attached is the sample which illustrates the toggling datasource dynamically for GridGroupingControl based on user selection.

TogglingDatasource.zip

In our sample, we bind the grid based on user selection from the DropDownlistBox. We acheived this with the help of callback panel.

Let us know if need more help.

Thanks for using Syncfusion products.

Regards,
Gokulkumar.B

Loader.
Live Chat Icon For mobile
Up arrow icon