我的WF上有7列10行的c1FlexGrid。在双击时,我希望打开另一个WF,它类似于该行的详细信息,但我希望将userId值发送到该表单。我不知道怎么拿到身份证。我的代码如下所示:
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();
}
}有什么建议吗?
发布于 2017-10-04 13:27:31
试试这个(object GetData(int rowIndex, string columnName)):
int userId = (int)c1FlexGrid1.GetData(c1FlexGrid1.RowSel, "UserId");其中RowSel是选定行的索引。
https://stackoverflow.com/questions/46565987
复制相似问题