2017-10-04 82 views
0

我的c1FlexGrid在我的WF上有7列和10行。雙擊我想打開另一個WF,就像該行的細節,但我想發送userId值到該窗體。我不知道如何得到這個ID。我的代碼如下所示:如何從c1FlexGrid獲取特定值?

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

任何建議?

回答

1

試試這個(object GetData(int rowIndex, string columnName)):

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

哪裏RowSel是選定行的索引。