Home Forums WinForms controls Xceed Grid for WinForms insertion Row Reply To: insertion Row

Xceed Support
Member
Post count: 5658

Hi,

you can keep track of the new row added by subscribing to the AddingDataRowEvent. In its handler you can set the reference of the DataRow added to aglobal variable row.  Furthermore, you can subscribe to the EditEndedevent on the InsertionRow to set the CurrentRow to row and add row to theSelectedRows. 

 

Forexample: 

private Xceed.Grid.DataRow row; 

InsertionRow insertionRow = new InsertionRow();

      insertionRow.EditEnded += new EventHandler( insertionRow_EditEnded );

      gridControl1.AddingDataRow += new AddingDataRowEventHandler( gridControl1_AddingDataRow );

      gridControl1.HeaderRows.Add( insertionRow );

    void insertionRow_EditEnded( object sender, EventArgs e )

    {

      gridControl1.SelectedRows.Add( row );

      gridControl1.CurrentRow = row;

     

    }

    void gridControl1_AddingDataRow( object sender, AddingDataRowEventArgs e )

    {

      row = e.DataRow;

    } 

Imported from legacy forums. Posted by Mohamed [Xceed] (had 1276 views)