datagrid problem
-
I'm using a datagrid to display information from a dataset. I added a "delete button" and wish to delete the selected cell in the datagrid. But I have the following problems.. 1.- If I rearrange the rows by clicking on the column header of the datagrid, I can no longer find the correct row corresponding to the database using the currentcell.row #.. the currentcell.row would say something like it's row #3 which does not correspond to row #3 in the dataset since I rearranged the rows in the datagrid. 2.- I cannot either manually look for the corresponding row in the database using the currentcell info, because when I displayed the information on the datagrid I ommited the primary key.. So I cannot retrieve this primary key from the currentcell.. Does anyone know of a workaround or a way to actually save the dataset row object with each row of the datagrid?? As always I thank you for any help!!
-
I'm using a datagrid to display information from a dataset. I added a "delete button" and wish to delete the selected cell in the datagrid. But I have the following problems.. 1.- If I rearrange the rows by clicking on the column header of the datagrid, I can no longer find the correct row corresponding to the database using the currentcell.row #.. the currentcell.row would say something like it's row #3 which does not correspond to row #3 in the dataset since I rearranged the rows in the datagrid. 2.- I cannot either manually look for the corresponding row in the database using the currentcell info, because when I displayed the information on the datagrid I ommited the primary key.. So I cannot retrieve this primary key from the currentcell.. Does anyone know of a workaround or a way to actually save the dataset row object with each row of the datagrid?? As always I thank you for any help!!
Current row in DataGrid (from WinForm) is a row number from DataView, not from DataTable. You can get DataView object from DataGrid object protected(!) property: (DataView)(myDataGrid.ListManager.List) Hi, AW