2 columns of checkboxes - how do you determine which column had its checkbox changed

Hello,

I have two columns C1 and C2 in a GridGroupingcontrol. These columns have checkboxes in them.

When the user either checks or unchecks one of these checkboxes in either column I need to figure out which column the checkbox was in. (Also note that some of the checkboxes in both columns could be disabled and I don't care if the user keeps clicking on these or not.)

I have looked at these two events:
private void gridGroupingControl1_TableControlCheckBoxClick(object sender, GridTableControlCellClickEventArgs e)

and

private void gridGroupingControl1_SaveCellText(object sender, Syncfusion.Windows.Forms.Grid.GridCellTextEventArgs e)

But I am not seeing where I can get the info to figure out which column the checkbox belongs in.


Best Regards,

---Dave


2 Replies

NR Nirmal Raja Syncfusion Team February 24, 2011 04:45 AM UTC

Hi Dave,

Thank you for your interest in Syncfusion products.

The exact field of the corresping column can be retrieved through the FieldToColIndex method. The column index can be retrieved from the inner arguments of the event.

Please refer the code below:
void gridGroupingControl1_TableControlCheckBoxClick(object sender, GridTableControlCellClickEventArgs e)
{
int fieldindex = gridGroupingControl1.TableModel.ColIndexToField(e.Inner.ColIndex);
GridColumnDescriptor field = gridGroupingControl1.TableDescriptor.Columns[fieldindex];
MessageBox.Show(field.Name);
}


Please let me know if you have any concern.

Regards,
Nirmal



DM David Mecteaux February 24, 2011 01:20 PM UTC

Hi Nirmal,

Thanks for the reply. There are two problems with the code you provided.

1) If the user moves a column to a new location you will get the wrong column name back.

2) Also I need a way to ignore or detect when the user selects a checkbox cell that is disabled too.



Loader.
Up arrow icon