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

RowChanging not fired when editing row values

1 Answer 101 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Vijay
Top achievements
Rank 1
Vijay asked on 17 Mar 2014, 01:48 AM
Hello,

I had redundancy checking code in UserAddingRow to ensure that no row is added with duplicate key values.
However, I'm trying to add the same checking into RowChanging to ensure that no values can be changed saved into the data source that would create that invalid situation.

I am finding that RowChanging is not getting fired (breakpoint on first line in method isn't reached), and am not sure if I'm thusly doing this incorrectly.

Thanks,

Vijay

1 Answer, 1 is accepted

Sort by
0
Ralitsa
Telerik team
answered on 19 Mar 2014, 10:58 AM
Hi Vijay, 

Thank you for contacting us. 

The RowsChanging event is fired before the Rows collection of a GridViewTemplate changes. The rows collection contains all data rows that belong to RadGridView. The event is fired when add or delete a row from that collection. 

You can use the CellValidating and the RowValidating events to validate data in the RadGridView. The events are fired when a cell or row loses input focus, enabling content validation. You can cancel the validation which will not allow the user to leave the current cell or row. In our article Data validation you can find samples how to use the events. 

You can see the example Validate changes in our Demo Application. The location where you can find it is: START >> All Programs >> Telerik >> UI for WinForms [version] >> Examples >> C# for Visual Studio 2010 >> Open C# Demo Application in Visual Studio - UI for WinForms. The example for data validation is in GridView >> Validate changes. 

Let me know if you have any other questions.

Regards,
Ralitsa
Telerik

DevCraft Q1'14 is here! Watch the online conference to see how this release solves your top-5 .NET challenges. Watch on demand now.

 
Tags
GridView
Asked by
Vijay
Top achievements
Rank 1
Answers by
Ralitsa
Telerik team
Share this question
or