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

validating selected rows

0 Answers 26 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Alex
Top achievements
Rank 1
Alex asked on 14 Sep 2012, 01:36 PM
Hi I have a grid populated with Item1 wich is a view model with DataAnnotations for validation. On user action I want to validate all the selected items. In the code below only the last Row gets validated. ANy idea why or what is the best way to do it?

foreach (Item1 item in GridView1.SelectedItems)
                {
                    GridViewRow row = GridView1.ItemContainerGenerator.ContainerFromItem(item) as GridViewRow;
 
                    gridViewRow.BeginEdit();
                    Dispatcher.BeginInvoke(() => gridViewRow.CommitEdit());
 
                 ....

No answers yet. Maybe you can help?

Tags
GridView
Asked by
Alex
Top achievements
Rank 1
Share this question
or