How to update datadase entry on chebox''s(is a cell in gridgrouping control ) checked change event .

Hi
I am displaying a cell in grid (Sync fusion grid grouping control-Versio 6.3.0.6) as check box depending on value in Database as 0 or 1.
how to update status changes as 1 to 0 or 0 to 1 on checkbox check or uncheck by the user .i added checkbox by using following code,


/>


in CheckChange function i want to retrieve selected record's id and
status of check box to update the same to database.

Sunil.



2 Replies

RS Rajarajeswari S Syncfusion Team July 23, 2008 01:03 PM UTC


Hi,

Thanks for using Syncfusion products.

In the CheckedChange event you can access the current GridRow using the following code snippet:

protected void CheckBox1_CheckedChanged(object sender, EventArgs e)
{
CheckBox checkbox = (CheckBox)sender;
GridRow gridrow = (GridRow)checkbox.Parent.Parent.Parent;
int i = Convert.ToInt32(gridrow.Record.GetValue("id"));
}


From the current GridRow you can access the Record values. And also the sender object contains the checkbox, from that you can get the checked state.

Please refer the sample from the belwo link, which illustartes this:

http://www.syncfusion.com/support/user/uploads/CheckBox_ff76096b.zip


Please have a look at the above and let us know if this helps you out.

Regards,
Raji




AD Administrator Syncfusion Team July 30, 2008 08:41 AM UTC

Hi Rajarajeswari,
i tried sample code provided by u but unable to retrieve current row value(other than checkbox status) for the checked or unchecked row using gridrow object.
also checkbox's uncheck event not firing ,while for check it works fine.

i am setting status of checkox depending on bSubmit 's value in Database as 0 or 1.


/>


also
while binding the data second time to same grid ,checked_changed event get fired (as many times as status is different from previous values).

Sunil.




Loader.
Up arrow icon