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.
Unfortunately, activation email could not send to your email. Please try again.

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

Thread ID:

Created:

Updated:

Platform:

Replies:

98370 Feb 23,2011 08:11 AM Feb 24,2011 08:20 AM Windows Forms 2
loading
Tags: Grouping
David Mecteaux
Asked On February 23, 2011 08:11 AM

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


Nirmal Raja [Syncfusion]
Replied On February 23, 2011 11:45 PM

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


David Mecteaux
Replied On February 24, 2011 08:20 AM

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.



CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.

;