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

WPF Telerik RadGridView Column validation from Database

4 Answers 106 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Somasekharan
Top achievements
Rank 1
Somasekharan asked on 30 Nov 2012, 07:35 AM
Hi,
    I am relatively new to WPF and Telerik RadGridView. I have a requirement to validate my cell column in heiarchical gridview in WPF. Means suppose when the user clicks on the column and enters a value, we should be able to check the db and validate whether the data entered is right or wrong and show proper messages. I am using WPF with MVVM and EF. Can you please suggest me the best possible way to achieve this functionality.

Thanks & Regards
Somasekharan Thampi S

4 Answers, 1 is accepted

Sort by
0
Vlad
Telerik team
answered on 30 Nov 2012, 07:38 AM
Hello,

 If your field in the SQL table is properly constructed you will get automatically support for this since EF will create the rules when you create the model and RadGridView will call them.

Greetings,
Vlad
the Telerik team

Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

0
Somasekharan
Top achievements
Rank 1
answered on 30 Nov 2012, 09:07 AM
Hi Vlad,
            Thanks for your reply. Here the scenario is that once the user enters a value in a column in a row in a gridview, we should be able to customize validation in such a way that the user gets a priompt after we validate whether the record exists in the database or not.

Thanks & Regards
Somasekharan Thampis S
 
0
Vlad
Telerik team
answered on 30 Nov 2012, 09:09 AM
Hello,

 You can use DataAnnotations also to customize your validation. 

Kind regards,
Vlad
the Telerik team

Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

0
Somasekharan
Top achievements
Rank 1
answered on 06 Dec 2012, 02:11 PM
Hi Vlad,
            Thanks for the reply. Since I am using heirarchical gridview using MVVM pattern and EF, I am not sure how to proceed with DataAnnotations for my child column validations, when the user enter the data in the child grid row. In the viewmodel, I have Observable Collection  of Parent Entity and child column attributes are defined in Business Entities(Model). So please advice how to go forward using  database validation in this scenario. If you could give a sample code snippet, it will be of utmost help.

Thanks & Regards
Somasekharan
Tags
GridView
Asked by
Somasekharan
Top achievements
Rank 1
Answers by
Vlad
Telerik team
Somasekharan
Top achievements
Rank 1
Share this question
or