Thanks Joey and Dmitriy. I have to delete the selected records in DataSet
too. so it's easier for me to delete the records in DataSet, then reset the
DataView and show the new set in DataGrid. but I am looking to find an event
to control Delete button. then I can let DataGrid to delete the records by
selecting them in the grid and press on <Delete> key. before deleting I have
to delete the records in DataSet too. but I could not find the suitable
event. I tried to use KeyDown event in DataGrid or Form but it seems like
another event happens. Do you know how I can detect Delete key in DataGrid?
"Joey Calisay" <jo*********@yahoo.com> wrote in message
news:e4*************@tk2msftngp13.phx.gbl...
how about desselecting it first before deleting, :p. If that doesn't
work,
i'll go for a temporary storage...
"Mojtaba Faridzad" <mf*******@hotmail.com> wrote in message
news:un**************@TK2MSFTNGP15.phx.gbl... Hi,
with SetDataBinding( ) a DataGrid shows a DataView. user can select some
rows in the grid by holding cotrol key. when user clicks on Delete
button,
I should delete all selected rows. I am trying to delete these lines from
the dataview like this:
for (int i=0; i < dataView.Count; i++)
if (dataGrid.IsSelected(i))
dataView.Delete(i);
but after deleting the first line, all other selected rows, become
unselected and I cannot delete the rest of selected rows. how can I ask
DataGrid not to reset the status of rows?
thanks