Home Forums WinForms controls Xceed Grid for WinForms Deleting a record Reply To: Deleting a record

User (Old forums)
Member
Post count: 23064

You can use the Index property to get the index of a row, and you can use a loop to verify which rows have the CheckBox in the right status, as shown by Daniel.  Or you can use the CurrentRow property to get the index of the row that is being selected.

e.g.:

      int rowIndex = ( ( Xceed.Grid.DataRow )gridControl1.CurrentRow ).Index;

However, if you remove a row you have selected by using the Remove() method on the row, you don’t need the index.  The row is already removed from the DataSet.  What is left is to call Update() on the DataAdapter and call AcceptChanges() on the DataSet, as I have shown in a previous post.

e.g.:

      this.suppliersTableAdapter.Update( this.northwindDataSet.Suppliers );
      this.northwindDataSet.Suppliers.AcceptChanges();

If this does not resolve the issue, I will need a better explanation of what you want to do, and a code snippet of what you are doing, and what is not working (detailing how it is not working, with exception details if applicable).

 

Imported from legacy forums. Posted by André (had 3535 views)