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

Raise CellEditEnded event manually?

2 Answers 651 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Marty
Top achievements
Rank 1
Marty asked on 24 Apr 2009, 01:41 PM
OK. 

I'm using a gridView with cell/row editing enabled to keep a bound business object updated when elements in the grid are changed.  That part is working great.  I'm also using validation on the grid contents.  I allow the user to update the grid however they so chose, then click a 'save' button, at which point that changes are comitted to our db. 

The issue is that the validation only fires for a cell when you click another cell/row in the grid, hit tab, or hit enter.  So, if the user inputs invalid data, does not perform any of the actions listed in the last sentence, then clicks my save button, data is allowed to be stored improperly since the CellEditEnded event does not fire, which is what causes validation to be initiated, when they hit my button.  SO, I'm looking for a way to either manually fire that event, OR another way to accomplish my goal of validating the data on button click.

I hope that makes sense.  Any input would be appreciated. 

Thanks,
Marty

2 Answers, 1 is accepted

Sort by
0
Nedyalko Nikolov
Telerik team
answered on 24 Apr 2009, 03:24 PM
Hello Marty,

You can raise CellEditEndedEvent, by calling RadGridView1.CommitEdit() method. This is what actions like (TAB, click on other cell, or press Enter actually do).
Hope this will help.

Sincerely yours,
Nedyalko Nikolov
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
Marty
Top achievements
Rank 1
answered on 24 Apr 2009, 03:29 PM
exactly what I needed, thank you.
Tags
GridView
Asked by
Marty
Top achievements
Rank 1
Answers by
Nedyalko Nikolov
Telerik team
Marty
Top achievements
Rank 1
Share this question
or