Home Forums WinForms controls Xceed Grid for WinForms how to get row of corresponding dataset table?

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • User (Old forums)
    Member
    Post count: 23064
    #17261 |

    In the Databinding example, the NorthWind Products table is used as a DataSource:

    gridControl1.SetDataBinding( m_northWindDataSet, “Products” );

    If I handle the DoubleClick event for each cell, how can I determine the DataTable row and column index that corresponds to the double-clicked cell?

    Buzz

    Imported from legacy forums. Posted by Buzz (had 654 views)

    User (Old forums)
    Member
    Post count: 23064

    Figured it out.

        void cell_DoubleClick(object sender, EventArgs e)
        {
            Xceed.Grid.Cell cell = sender as Xceed.Grid.Cell;

            string columnName = cell.FieldName;
            int rowIndex = ((Xceed.Grid.DataRow)gridControl1.CurrentRow).Index;

            string val = ((DataSet)gridControl1.DataSource).Tables[“Products”].Rows[((Xceed.Grid.DataRow)gridControl1.CurrentRow).Index][columnName];
        }

     

    Imported from legacy forums. Posted by Buzz (had 1162 views)

Viewing 2 posts - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.