tags:

views:

28

answers:

1

I want to take all rows that are selected and modify one column value in each of them.

I tried this but it doesn't work.

foreach (System.Data.DataRowView DRV in ItemDataGrid.SelectedItems)
{
    DRV.Row.BeginEdit();
    DRV.Row.ItemArray[6] = true;
    DRV.Row.EndEdit();
}

Anyone know how to do this?

Thanks, Matt

A: 

Don't try and edit the DataGridRow. Modify the objects bound to the grid instead. Then make a call to NotifyPropertyChanged that the collection the DataGrid is bound to has been updated.

Chris Holmes
I will try this
I have a dataset bound to the grid so I'm not sure how to do this.
Got It. If anyone is wondering how to do this, this article helped me. Thanks Chris. http://msdn.microsoft.com/en-us/library/tat996zc%28VS.80%29.aspx
You're welcome!
Chris Holmes