Change datasource

Hi, I need to reuse a grid as part of my application by using completely different datasets. At first, I was trying to just assign a new value to the DataSource property, but it didn''t work. I also tried to remove the relations by hand, but it neither worked. Is there any way to completely get all the grid blank, getting out all relations, so I can assign a totally new DataSource?

3 Replies

AD Administrator Syncfusion Team December 7, 2005 11:51 PM UTC

Try code like: this.gridDataBoundGrid1.DataSource = null; this.gridDataBoundGrid1.DataMember = ""; this.gridDataBoundGrid1.Binder.ResetHierarchyLevels(); this.gridDataBoundGrid1.DataSource = newDataSource; this.gridDataBoundGrid1.Binder.InitializeColumns();


AS Alejandro Serrano December 8, 2005 10:50 AM UTC

I need a code like that, but for GridGroupingControl


AS Alejandro Serrano December 8, 2005 10:54 AM UTC

>I need a code like that, but for GridGroupingControl I finally did it calling Grid1.Engine.ResetTableDescriptor()

Loader.
Up arrow icon