Delete Row in Datagrid 
Author Message
 Delete Row in Datagrid

I have a Form with serveral datagrids each bound to a datatable.
When I delete a row in datagrid1, I have to do something in datagrid3
(delete a row or change a value)
I tried to do this by overriding the Function ProcessCmdKey in my Datagrid
Class, and I test if  'Delete' key has been pressed.

When a row is selected, en "Delete" is pressed, it works fine.
Problem is that if the user does "Delete" in a cell to change the contents,
the same function is called, and the row in datagrid3 will be deleted,
though there is no row deleted in datagrid 1, only the contents of a cell.

How can I know if a row is selected, or if a cell is selected in a datagrid
?

Or is there another event that would suite better to do this ?



Mon, 18 Apr 2005 23:49:32 GMT  
 Delete Row in Datagrid
Try using the DataGrid.IsSelected method to test if a particular row is
selected.

=====================
Clay Burch
Syncfusion, Inc.

visit www.syncfusion.com for the coolest tools


Quote:
> I have a Form with serveral datagrids each bound to a datatable.
> When I delete a row in datagrid1, I have to do something in datagrid3
> (delete a row or change a value)
> I tried to do this by overriding the Function ProcessCmdKey in my Datagrid
> Class, and I test if  'Delete' key has been pressed.

> When a row is selected, en "Delete" is pressed, it works fine.
> Problem is that if the user does "Delete" in a cell to change the
contents,
> the same function is called, and the row in datagrid3 will be deleted,
> though there is no row deleted in datagrid 1, only the contents of a cell.

> How can I know if a row is selected, or if a cell is selected in a
datagrid
> ?

> Or is there another event that would suite better to do this ?



Tue, 19 Apr 2005 18:17:59 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. How to delete row from datagrid

2. How to delete a row in a datagrid.

3. Delete a row in a Datagrid using VB.net

4. DataGrid row delete

5. Datagrids, DataSets and deleting Rows

6. DataGrid: how to handle deleted rows

7. Delete a row from datagrid

8. Disable Delete row function in Datagrid

9. DELETE all rows in datagrid

10. Datagrid - Prevent Delete / New Rows

11. Cancel row deleting in DataGrid

12. Deleting a Row in Datagrid

 

 
Powered by phpBB® Forum Software