GGC Columns_Changed event

Hi, I''m using the GGC. The column descriptors and the datasource are populated dynamically and could be changed at run-time. My goal is to catch an event when users reorder columns by Drag&Drop. I''ve tried the approached, described in: http://www.syncfusion.com/Support/user/uploads/GGC_MoveCOlumns_8e767f4c.zip But the Columns_Changed fires only once. After I change the Model and/or datasource it will not fire. I also tried to subcribe to this event after I change the model and datasource - still the same. Any suggestions? Thank you.

5 Replies

IV Ivan July 12, 2005 07:37 PM UTC

It seems that I''ve found the source of the problem: After I populate the columns, I set the visibility of the columns in the following way: gridGroupingControl1.TableDescriptor.VisibleColumns.Clear(); for(int i=0;....) { if(some_condition) gridGroupingControl1.VisibleColumns.Add(proper_name); } After that Columns_Changed still fires, but only for ItemPropertyChanged. Is there any other proper way of setting columns visibility dynamically? Thank you


AD Administrator Syncfusion Team July 12, 2005 08:07 PM UTC

I tried to see a problem in the sample. I added a button that creates a new datasource for the the grid. In this sample, the events still are raised for me. http://www.syncfusion.com/Support/user/uploads/GGC_MoveCOlumns_b223e272.zip What are you doing differently to get the events unhooked?


IV Ivan July 12, 2005 08:22 PM UTC

I clear and repopulate Visible columns collection: gridGroupingControl1.TableDescriptor.VisibleColumns.Clear(); gridGroupingControl1.TableDescriptor.VisibleColumns.Add();


AD Administrator Syncfusion Team July 13, 2005 12:11 AM UTC

Instead of the this.gridGroupingControl1.TableDescriptor.Columns.Changed, try using this.gridGroupingControl1.TableDescriptor.VisibleColumns.Changed event. http://www.syncfusion.com/Support/user/uploads/GGC_MoveCOlumns_e10df834.zip


IV Ivan July 13, 2005 05:30 PM UTC

Thank you! This works great

Loader.
Up arrow icon