validating selected rows

1 posts, 0 answers
  1. Alex
    Alex avatar
    36 posts
    Member since:
    Sep 2010

    Posted 14 Sep 2012 Link to this post

    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());
     
                     ....
Back to Top