How to get specific value from c1FlexGrid?

2.8k Views Asked by At

I have c1FlexGrid on my WF with 7 columns and 10 rows. On double click I want to open another WF which is something like detail of that row, but I want to send userId value to that form. I don't know how to get that id. My code looks like this:

private void c1FlexGrid1_DoubleClick(object sender, System.EventArgs e)
{
  int rowIndex = c1FlexGrid1.Row;
  if (rowIndex != -1)
  {        
    int userId = I need value from column "UserId" on this rowIndex.
    frmUser userForm = new frmUser(userId);
    userForm.ShowDialog();
  }      
}

Any suggestion?

1

There are 1 best solutions below

0
On BEST ANSWER

Try this (object GetData(int rowIndex, string columnName)):

int userId = (int)c1FlexGrid1.GetData(c1FlexGrid1.RowSel, "UserId");

Where RowSel is index of selected row.