New Posts New Posts RSS Feed: Displaying validation errors in DataGrid (Silverlight)
  FAQ FAQ  Forum Search   Calendar   Register Register  Login Login

Displaying validation errors in DataGrid (Silverlight)

 Post Reply Post Reply
Author
katit View Drop Down
Senior Member
Senior Member


Joined: 09-Sep-2011
Posts: 146
Post Options Post Options   Quote katit Quote  Post ReplyReply Direct Link To This Post Topic: Displaying validation errors in DataGrid (Silverlight)
    Posted: 20-Feb-2013 at 6:36pm
Trying to come up with best strategy for DataGrid entry validation
 
Using DevForce verification features.
 
1. When dataentry happens in a grid and entity has "immediate" validation (on property set) - I get feedback and it is all nice.
 
When I run verification LATER (before save) and need to check for duplicates in grid (for example) I don't get visual clues. From what I learned - DataGrid shows validation errors only while in edit mode and it actually locks you on that bad row. So, if I run verification and don't get any "red" on DataGrid I can go into grid, click into bad row and get this validation error.
 
Obviously this is not what I'm after. I want datagrid to reflect validation problem right away. Is there any tips on that? Any tips working with DataGrid?
 
2. I tried something different. I thought that since entities implement INotifyDataErrorInfo I will just bind something to HasErrors property. I created column in a grid with "error" icon and set it's visibility to show when HasErrors set. It didn't work either, for some reason it can't bind to it (doesn't see this property). I can get to it by casting to INotifyDataErrorInfo but can't figure out how to do it nicely. What I did now is I exposed property "HasErrors" in partial class and flip it on/off during validation. This way it highlights DataGrid row by showing icon.
 
I don't like this solution...
 
Is there any better/best way to deal with data entry in a grid?
Back to Top
sbelini View Drop Down
IdeaBlade
IdeaBlade
Avatar

Joined: 13-Aug-2010
Location: Oakland
Posts: 786
Post Options Post Options   Quote sbelini Quote  Post ReplyReply Direct Link To This Post Posted: 26-Feb-2013 at 4:49pm
Hi katit,

I found this article that might help you with what you are looking for: ( although I feel your approach is going thru the same route)

http://geekswithblogs.net/lorilalonde/archive/2011/10/29/silverlight-4-datagridndashbulk-validation-using-inotifydataerrorinfo.aspx



Edited by sbelini - 26-Feb-2013 at 4:50pm
Back to Top
 Post Reply Post Reply

Forum Jump Forum Permissions View Drop Down