Problem with ColHiddenEntries

I am using v5.102.0.51 of the Syncfusion databound grid and I am having a problem getting the grid to display columns when after rebinding when there are a different number of columns in the second datasource. I have two 'views' the first has 25 columns and I use Model.Cols.Hidden = true; to hide about half of them. The problem comes in when I rebind to my second 'view' which has 17 columns only a few of which are hidden. The problem is that in the second smaller view there are columns I cannot get to appear using Model.Cols.Hidden = false;. I noticed that after binding the second view Model.ColHiddenEntries count is way too high as if it was not cleared by the rebind. Everything else appears to be ok, the missing column are in Binder.InternalColumns and have colWidths greater than zero but they still do not appear. If I go into the debugger immediate window and manuall try to set the Model.Cols.Hidden[] for every column I get to about 21 (although there are only 17 cols in the model) before it just hangs. The only work around I could come up with was to loop through the model columns and set all columns to visible before rebinding this makes the second view work as expected.

My question is is this a known issue? Is there a better work around?


1 Reply

SR SubhaSheela R Syncfusion Team February 16, 2008 06:39 AM UTC

Hi Burke,

Thank you for using Syncfusion products.

I am not able to reproduce the issue of rebinding the data view in GDBG. You can call the ResetRange method by passing the column count value before rebinding the underlying data source. Please refer the below code snippet to achieve this:

this.gridDataBoundGrid1.Model.Cols.Hidden.ResetRange(1, this.gridDataBoundGrid1.Model.ColCount);


Please refer the sample in the below link which illustrates the above:

http://websamples.syncfusion.com//samples/Grid.Windows/F71802/main.htm

Please have a look at the above sample and if still the issue exists, could you please try reproducing it in the above sample and send us the modified sample, so that we could sort out the cause of the issue and provide you a solution.

Regards,
Subhasheela R



Loader.
Up arrow icon