0

我的 WF 上有 c1FlexGrid,有 7 列和 10 行。双击时,我想打开另一个 WF,它类似于该行的详细信息,但我想将 userId 值发送到该表单。我不知道如何获得该ID。我的代码如下所示:

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();
  }      
}

有什么建议吗?

4

1 回答 1

1

试试这个(object GetData(int rowIndex, string columnName)):

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

RowSel所选行的索引在哪里。

于 2017-10-04T13:27:31.933 回答