This is a migrated thread and some comments may be shown as answers.

[Solved] Checkbox column - determine row when checking/unchecking

2 Answers 154 Views
GridView
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Chris
Top achievements
Rank 1
Chris asked on 19 May 2009, 08:54 PM
I have a grid with a CheckBox column (as a custom cell template using the GridViewColumn.CellStyle approach).  When checking/unchecking the checkbox, the BegginingEdit is never fired.  How can I determine that the row is being edited?

The grid has a Checkbox column, a Description column (read-only) and a text column for user entered text.

I need to know which row is being edited (works fine when the user updates the text column but not when the user checks/unchecks the checkbox) and when editing is complete for that specific row.  I want to save the changes to the database only once the row has been edited (ie. when the user finishes editing in the textbox or the user Checks/unchecks the checkbox and moves to a new row).

How can this be done since right now all I have is the Checked event on the checkbox which doesn't fire the BegginingEdit event.  When checking/unchecking a value I can't determine for which row the event is being fired.

Thank you in advance.

Chris

2 Answers, 1 is accepted

Sort by
0
Vlad
Telerik team
answered on 20 May 2009, 06:13 AM
Hi Chris,

You can find the row very easily in Checked event using our extension methods:

GridViewRow row = ((CheckBox)sender).ParentOfType<GridViewRow>();

You need to add Telerik.Windows.Controls to use these methods!

Regards,
Vlad
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
0
Chris
Top achievements
Rank 1
answered on 25 May 2009, 12:11 PM
Thanks Vlad...that allowed me to get the information.

Chris
Tags
GridView
Asked by
Chris
Top achievements
Rank 1
Answers by
Vlad
Telerik team
Chris
Top achievements
Rank 1
Share this question
or