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

Automatic update of the filtered GGC

I''m trying to create a GGC that has a checkbox, clicking on which will filter the record out of the grid. I have a table, where a boolean (actually, short integer) column is my criteria, whether the record should be on the grid, or not. In the following example, I set the filtered dataview as a data source for the grid, however the behaviour is rather strange - I cannot uncheck the checkboxes at all. In debug window I see CancelMouseEvent exception. Why wouldn''t unchecked records just go away? Is there a way to do what I want with checkboxes? (I can probably put a button there, that removes my rows manually inside BeginUpdate/EndUpdate) --- private void Form1_Load(object sender, System.EventArgs e) { DataSet ds = new DataSet("MyDataset"); DataTable dt = ds.Tables.Add("MyTable"); dt.Columns.Add("Col1", typeof(string)); dt.Columns.Add("Col2", typeof(short)); DataView dv = new DataView(dt); dv.RowFilter = "Col2 = 0"; for(int i=0; i<10; i++) { dt.Rows.Add(new object [] {"MyText" + Convert.ToString(i), (short)(i % 3)}); } Syncfusion.Windows.Forms.Grid.Grouping.GridTableDescriptor gtc = gridGroupingControl2.TableDescriptor; Syncfusion.Windows.Forms.Grid.Grouping.GridColumnDescriptor gdc = new Syncfusion.Windows.Forms.Grid.Grouping.GridColumnDescriptor(); gdc.MappingName = "Col1"; gdc.HeaderText = "My Col1"; gdc.ReadOnly = true; gdc.Appearance.AnyRecordFieldCell.CellType = "Static"; gtc.Columns.Add(gdc); gdc = new Syncfusion.Windows.Forms.Grid.Grouping.GridColumnDescriptor(); gdc.MappingName = "Col2"; gdc.HeaderText = "My Col2"; gdc.ReadOnly = false; gdc.Appearance.AnyRecordFieldCell.CellType = "CheckBox"; gdc.Appearance.AnyRecordFieldCell.CheckBoxOptions.CheckedValue = "1"; gdc.Appearance.AnyRecordFieldCell.CheckBoxOptions.CheckedValue = "0"; gtc.Columns.Add(gdc); gridGroupingControl1.DataSource = dt; gridGroupingControl2.DataSource = dv; dv.AllowDelete = false; dv.AllowNew = false; dv.AllowEdit = true; }

4 Replies

AD Administrator Syncfusion Team September 2, 2004 03:07 PM

Does setting gdc.Appearance.AnyRecordFieldCell.CellValueType = typeof(int); on the checkbox column make a difference?


AD Administrator Syncfusion Team September 2, 2004 04:28 PM

Unfortunately, no. I also tried typeof(short) Debug window shows: catched at Syncfusion.Windows.Forms.ScrollControl.RaiseCancelMouseEvent(MouseEventArgs e, CancelMouseDelegate d) in :line 0


AD Administrator Syncfusion Team September 2, 2004 05:37 PM

I can see the problem in 2.1.0.9 using the code you furnished. It works ok with a GridDataBoundGrid, but fails in the GridGroupingControl. We will look into this to see why it is failing,and update this thread when we have more information.


AD Administrator Syncfusion Team September 3, 2004 01:11 AM

This problem has been corrected in our library. If you would like to get a private build with this correction, you can submit a Direct Trac support incident and request one. The next public release scheduled now is a couple of months away.

Loader.
Live Chat Icon For mobile
Up arrow icon