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

VisibleColumns error, please help

I have the following code...

this.gridGroupingControl1.DataSource = dsOrder.Tables["Lines"];
...
...

this.gridGroupingControl1.TableDescriptor.VisibleColumns.Clear();
this.gridGroupingControl1.TableDescriptor.VisibleColumns.Add("TitleName");
this.gridGroupingControl1.TableDescriptor.Columns["TitleName"].Appearance.AnyRecordFieldCell.CellType = "Static";

The code is failing at the last line with a null reference exception. Funny thing is that the field "TitleName" is indeed a field in the datasource. This code had previously work.

When I set a break point above this line, I see that the VisibleColumns count is 1, which is one, but when I attempt to set the appearance, I am getting this error.


2 Replies

JB James Blibo December 10, 2006 03:51 AM UTC

This is strange, but I'm gonna post it here...

I initially had my ggc on a windows tab control. When I replace the windows tab control with the syncfusion control, this is when this strange error started occuring. I had my grouping on a syncfusion tab. I had four tabs and the ggc was on one of the tabs.

When I remove the syncfusion tab, the error went away. strange...


AD Administrator Syncfusion Team December 11, 2006 05:26 AM UTC

Hi James,

After setting the new data source try calling gridGroupingControl1.TableDescriptor.ResetColumns() to see if that helps.

//Code
gridGroupingControl1.TableDescriptor.ResetColumns();
//Or
gridGroupingControl1.TableDescriptor.Columns.Reset();

Best Regards,
Haneef

Loader.
Live Chat Icon For mobile
Up arrow icon