Dataset and DataGrid

  • Thread starter Thread starter John
  • Start date Start date
J

John

Dear Tim,

Thanks for your suggestion. Actually, I am thinking of
this method today also. But I pressed the "Delete" button
in the keyboard accidentally today and the row selected in
the datagrid has been deleted. It does not require to
looking for CurrentRowIndex in the dataset table at all.
I think there may be a much easier method to delete the
row in the datagrid. Do you have any idea how?

Thanks,
John
 
John,

The only other ways I can think to do this is to:

a) Create a Context Menu with a Delete Option
b) Add a Column to the DataGrid which contains a Delete button.

In both cases the Row that is selected by the User (either with the menu
from a or the button click in b) is sent to the Event Handler method as
part of the Event Argument Parameter. You can then simply state
e.Row.Delete () (where e is the name given to the Event Argument
parameter).

I haven't tried either method yet. However, my Professional C# from wrox
does give an example of a at the end of Chapter 12, which might be of
help to you.

Tim White
 
Back
Top