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.

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

Thread ID:

Created:

Updated:

Platform:

Replies:

75267 Jul 18,2008 06:13 AM Jul 30,2008 04:41 AM ASP.NET Web Forms (Classic) 2
loading
Tags: Grouping
Administrator [Syncfusion]
Asked On July 18, 2008 06:13 AM

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.



Rajarajeswari S [Syncfusion]
Replied On July 23, 2008 09:03 AM


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



Administrator [Syncfusion]
Replied On July 30, 2008 04:41 AM

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.




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.

;