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

GGC : How to allow one click in column with type checkbox?

Hi!

I have a gridgroupingcontrol in my app and I would like allow the user clicks only in a register with check, don´t permiss enables others checkboxes. How do I do this?

Thanks.

Ediberto Alves

2 Replies

AD Administrator Syncfusion Team June 29, 2009 01:38 PM UTC

Anyone?


LS Lingaraj S Syncfusion Team July 2, 2009 12:04 PM UTC

Hi Alves,

Thank you for your interest in Syncfusion product.

If you want to click the check only one time, then please try using Record.Id and conditional statements in TableControlCheckBoxClick event to achieve this

behavior. The Record is maintain the unique Id in GridGroupingControl. The TableControlCheckBoxClick event is fired, when the check box has been clicked in

GridGroupingControl. The Cancel property is used in TableControlCheckBoxClick event to cancel the check box click after the first click.

Refer the code below:

List lis = new List();
void gridGroupingControl1_TableControlCheckBoxClick(object sender, GridTableControlCellClickEventArgs e)
{
e.TableControl.CurrentCell.MoveTo(e.Inner.RowIndex, e.Inner.ColIndex);
GridTableCellStyleInfo sty = e.TableControl.GetTableViewStyleInfo(e.Inner.RowIndex, e.Inner.ColIndex);
if (sty.TableCellIdentity.DisplayElement.Kind == DisplayElementKind.Record)
{
if (lis.Contains(sty.TableCellIdentity.DisplayElement.GetRecord().Id))
{
e.Inner.Cancel = true;
}
else
{
lis.Add(sty.TableCellIdentity.DisplayElement.GetRecord().Id);
this.gridGroupingControl1.Refresh();
}
}
}


Refer the sample in below link:
http://files.syncfusion.com/support/samples/Grid.Windows/Forums/CheckBoxGGC.zip

Please let me know if you have any queries.

Regards,
Lingaraj S.

Loader.
Live Chat Icon For mobile
Up arrow icon