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. (Last updated on: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Event for Checkbox click.

Thread ID:

Created:

Updated:

Platform:

Replies:

143615 Jul 24,2007 10:28 AM UTC Mar 29,2019 11:26 AM UTC Angular 5
loading
Tags: ejGrid
Amol Choudhari
Asked On July 24, 2007 10:28 AM UTC

Hi,

I am using syncfusion grid grouping control. I want to capture check box event control so that I can modify the current record's property depending on check box's boolen value.

For Eg. I have check boxes in one column for each row.
If I check one check box for particular row, then I want to modify the current record's property.
Here I also want to get current record's data.

Please help.

Thanks,
Amol Choudhari

haneefm [Syncfusion]
Replied On July 24, 2007 02:43 PM UTC

Hi Amol,

The TableControlCheckBoxClick is the event that gets triggered only when user clicks using the mouse on the checker box of checkbox cell. You can catch the TableControlCurrentCellChanged event for detecting any changes made to the checkbox cell. Below is a code snippet:

void gridTableControlCurrentCellChanged(object sender, EventArgs e)
{
GridCurrentCell cc = e.TableControl.CurrentCell;
if (cc.Renderer.StyleInfo.CellType == "CheckBox")
{
Console.WrtieLine( e.TableControl.Table.CurrentRecord.Info);
DataRowview rv = e.TableControl.Table.CurrentRecord.GetData() as DataRowview;
}
}

gridGroupingControl1.TableControlCheckBoxClick += new Grouping.GridTableControlCellClickEventHandler(gridTableControlCheckBoxClick);

void gridTableControlCheckBoxClick(object sender, GridTableControlCellClickEventArgs e)
{
Console.WrtieLine( e.TableControl.Table.CurrentRecord.Info);
DataRowview rv = e.TableControl.Table.CurrentRecord.GetData() as DataRowview;
}

Best regards,
Haneef

Amol Choudhari
Replied On July 24, 2007 03:42 PM UTC

Hi Haneef,

In my case TableControlCurrentCellChanged event is not fired while clicking on check box on particular row. So this event is not useful I hope...

and TableControlCheckBoxClick event is fired in my grid, while clicking on check box but
in this case I am not getting CURRENTRECORD.
at (e.TableControl.Table.CurrentRecord.GetData() - here CurrentRecord is null )
So not able to modify the property of selected row's data.

Please suggest any other way.

Thanks,
Amol Choudhari

>Hi Amol,

The TableControlCheckBoxClick is the event that gets triggered only when user clicks using the mouse on the checker box of checkbox cell. You can catch the TableControlCurrentCellChanged event for detecting any changes made to the checkbox cell. Below is a code snippet:

void gridTableControlCurrentCellChanged(object sender, EventArgs e)
{
GridCurrentCell cc = e.TableControl.CurrentCell;
if (cc.Renderer.StyleInfo.CellType == "CheckBox")
{
Console.WrtieLine( e.TableControl.Table.CurrentRecord.Info);
DataRowview rv = e.TableControl.Table.CurrentRecord.GetData() as DataRowview;
}
}

gridGroupingControl1.TableControlCheckBoxClick += new Grouping.GridTableControlCellClickEventHandler(gridTableControlCheckBoxClick);

void gridTableControlCheckBoxClick(object sender, GridTableControlCellClickEventArgs e)
{
Console.WrtieLine( e.TableControl.Table.CurrentRecord.Info);
DataRowview rv = e.TableControl.Table.CurrentRecord.GetData() as DataRowview;
}

Best regards,
Haneef

haneefm [Syncfusion]
Replied On July 24, 2007 10:27 PM UTC

Hi Amol,

You can try these code :

private void gridGroupingControl1_TableControlCheckBoxClick(object sender, GridTableControlCellClickEventArgs e)
{
int RowIndex = e.Inner.RowIndex;
int ColIndex = e.Inner.ColIndex;
if( RowIndex > -1 && ColIndex > -1)
{
GridTableCellStyleInfo Style = e.TableControl.GetTableViewStyleInfo(RowIndex, ColIndex);
if( Style != null)
{
Element el = Style.TableCellIdentity.DisplayElement;
if (el != null)
{
Record rec = el.GetRecord();
DataRowView dv = rec.GetData() as DataRowView;
}
}
}
}

Best regards,
Haneef

Guadalupe
Replied On March 27, 2019 06:41 PM UTC

Hello Amount
This code is correct? 

Vignesh Natarajan [Syncfusion]
Replied On March 29, 2019 11:26 AM UTC

Hi Gaudalupe, 

Thanks for contacting Syncfusion support. 

The solution given in the previous updates of this forum is applicable in GridGroupingControl which is an ASP.NET Classic component,but you are using the Essential JS1 (ASP.NET WebForms) component. So, the same cannot be achieved in the Syncfusion Essential JS 1 Asp.Net Webforms. 

So kindly share the exact scenario and details regarding your requirement. We will provide the appropriate solution for your requirement. 

Regards, 
Vignesh Natarajan. 


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.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

Warning Icon 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.Close Icon

;