C# 如何从c1FlexGrid获取特定值?
我的WF上有7列10行的c1FlexGrid。双击后,我想打开另一个WF,它类似于该行的详细信息,但我想向该表单发送userId值。我不知道如何获取该id。我的代码如下所示:C# 如何从c1FlexGrid获取特定值?,c#,c1flexgrid,C#,C1flexgrid,我的WF上有7列10行的c1FlexGrid。双击后,我想打开另一个WF,它类似于该行的详细信息,但我想向该表单发送userId值。我不知道如何获取该id。我的代码如下所示: private void c1FlexGrid1_DoubleClick(object sender, System.EventArgs e) { int rowIndex = c1FlexGrid1.Row; if (rowIndex != -1) { int userId = I n
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();
}
}
有什么建议吗?试试这个(对象GetData(int-rowIndex,string-columnName)
):
其中,RowSel
是所选行的索引
int userId = (int)c1FlexGrid1.GetData(c1FlexGrid1.RowSel, "UserId");