Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/csharp/277.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
选择值多列组合框c#dektop应用程序_C# - Fatal编程技术网

选择值多列组合框c#dektop应用程序

选择值多列组合框c#dektop应用程序,c#,C#,我正在创建一个桌面应用程序。 我的表单上有多列combobox控件,当用户单击datagrid时,它会弹出一个包含四列的窗口。 我想要的是,当用户选择datagrid的任意一行时,我得到该行任意一列的值。 是他们的任何方式。您添加了句柄事件 } // Create an instance of the 'CurrentCellChanged' EventHandler. private void CallCurrentCellChanged() { myDataGrid.CurrentCe

我正在创建一个桌面应用程序。 我的表单上有多列combobox控件,当用户单击datagrid时,它会弹出一个包含四列的窗口。 我想要的是,当用户选择datagrid的任意一行时,我得到该行任意一列的值。 是他们的任何方式。

您添加了句柄事件

}

// Create an instance of the 'CurrentCellChanged' EventHandler.
private void CallCurrentCellChanged()
{
   myDataGrid.CurrentCellChanged += new EventHandler(Grid_CurCellChange);
}

// Raise the event when focus on DataGrid cell changes.
private void Grid_CurCellChange(object sender, EventArgs e)
{
   // String variable used to show message.
   string myString = "CurrentCellChanged event raised, cell focus is at ";
  // Get the co-ordinates of the focussed cell.
  var value=  myDataGrid[myDataGrid.CurrentCell.ColumnNumber,myDataGrid.CurrentCell.RowNumber].Value