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

Update cell validation

2 Answers 99 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Rudis
Top achievements
Rank 1
Rudis asked on 23 Aug 2010, 03:32 PM
Hello,

I have a RadGridView with six columns defined and where the first column is a checkbox. When inserting a new row in this grid the checkbox is checked and one set of column are mandatory to set values. The user can uncheck this checkbox which results in a different set of columns are mandatory to set values. However the cell validation is not updated in the GUI until I leave the tabcontrol och returns to it.

Any ideas how to solve this?

Best regards / Anna

2 Answers, 1 is accepted

Sort by
0
Nedyalko Nikolov
Telerik team
answered on 26 Aug 2010, 01:52 PM
Hello Anna Rudlund,

Cell validation should be triggered when focus leave GridViewCell. As I understand the problem you want when a user checks check box to validate that some other cells are filled. If this is your goal, you can use "asynchronous validation". I'm attaching a sample application that demonstrates how to use this.

In order to use it in your case:

1. Define CellTemplate for the check box column and bind this data template directly to the underlying data object (this will update underlying property as soon as user checks the check box).
2. Within property setter of the boolean property you can check for all required values and mark them with an error. (just call OnPropertyChanged(propertyName) in order to trigger data errors check).

For more information you can take a look at this blog post.

Best wishes,
Nedyalko Nikolov
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
0
Rudis
Top achievements
Rank 1
answered on 27 Aug 2010, 07:37 AM
Thanks for the example. Now it works perfect.

Best regards/
Anna
Tags
GridView
Asked by
Rudis
Top achievements
Rank 1
Answers by
Nedyalko Nikolov
Telerik team
Rudis
Top achievements
Rank 1
Share this question
or