嗨,
使用Syncfusions Gridlist控件:
用户应该能够选择各种行(1或许多),然后我需要一种方法,以编程方式确定哪些行是选定的。我将在网格上使用上下文菜单,因此我需要找出在这一点上选择了哪些。
上面的任何帮助都是很好的。
发布于 2009-10-07 07:48:17
您可以像这样访问所选项目:
foreach (SelectedRecord selectedRecord in Grid.Table.SelectedRecords)
{
TypeBoundToDataGrid typeBound= selectedRecord.Record.GetData() as TypeBoundToDataGrid ;
}请注意:您需要通过执行以下操作在网格中打开选择模式:
对于MultiSelection:
Grid.TableOptions.ListBoxSelectionMode = SelectionMode.MultiExtended;
Grid.TableOptions.AllowSelection = GridSelectionFlags.None;
Grid.TableOptions.ListBoxSelectionColorOptions = GridListBoxSelectionColorOptions.ApplySelectionColor;
Grid.TableOptions.ListBoxSelectionCurrentCellOptions =
GridListBoxSelectionCurrentCellOptions.WhiteCurrentCell
| GridListBoxSelectionCurrentCellOptions.MoveCurrentCellWithMouse;对于SingleSelection
Grid.TableOptions.ListBoxSelectionMode = SelectionMode.One;
Grid.TableOptions.AllowSelection = GridSelectionFlags.None;
Grid.TableOptions.ListBoxSelectionColorOptions = GridListBoxSelectionColorOptions.ApplySelectionColor;
Grid.TableOptions.ListBoxSelectionCurrentCellOptions =
GridListBoxSelectionCurrentCellOptions.WhiteCurrentCell
| GridListBoxSelectionCurrentCellOptions.MoveCurrentCellWithMouse;乔希
发布于 2009-09-12 11:46:40
检查当您右键单击网格时触发的网格事件,并查看提供给您的参数(使用'e')。
https://stackoverflow.com/questions/1072828
复制相似问题