Home Forums WinForms controls Xceed Grid for WinForms Getting values from a selected detail grids row? Reply To: Getting values from a selected detail grids row?

User (Old forums)
Member
Post count: 23064

You can subscribe to the CurrentRowChanged or CurrentCellChanged event, and get the value from the needed cell.

Here is an example using the CurrentRowChanged event :

    private void Form1_Load( object sender, EventArgs e )
    {    
      gridControl1.CurrentRowChanged += new EventHandler( gridControl1_CurrentRowChanged );
    }

    void gridControl1_CurrentRowChanged( object sender, EventArgs e )
    {
      Xceed.Grid.DataRow row = gridControl1.CurrentRow as Xceed.Grid.DataRow;
      string value = row.Cells[ 2 ].Value as string;
    }
 

 

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