datagrid, delete record from table

  • Thread starter Thread starter schapopa
  • Start date Start date
S

schapopa

Hi,

I have a contextmenu when user right click on the datagrid first column
- delete row from datagrid.

My code for that looks like this:

Private Sub MenuItem1_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MenuItem1.Click
ds.Tables(0).Rows.RemoveAt(myHitTest.Row)
End Sub

where my hittest comes from mouse_down event.
Everything works fine untill I insert value in the datagrid and then try
to delete it. Then I get an error that there is no row at the position.
Does anyone has any suggestions?
Thank you
Schapopa
 
Hi,

Does anybody have any suggestion how differently I can do what I want to
achieve. I want to create right click context menu and be able to delete
and add records with that menu.
I thought it should be easy but I just cannot find a way to do that.
Regars

Schapopa
 
Hi,

Does anybody have any suggestion how differently I can do what I want to
achieve. I want to create right click context menu and be able to delete
and add records with that menu.
I thought it should be easy but I just cannot find a way to do that.
Regars

Schapopa
 
Back
Top