简体   繁体   English

如何使用C#在devexpress gridcontrol中按下按钮时上下移动行

[英]How to move rows up/down on button press in devexpress gridcontrol using c#

I have a devexpress gridcontrol full of data. 我有一个充满数据的devexpress gridcontrol。 Next to the grid are up and down buttons. 网格旁边是向上和向下按钮。 When the user presses one of the buttons, I want the selected row to move up/down. 当用户按下按钮之一时,我希望所选的行向上/向下移动。 What are some ways I could go about this? 我可以采取哪些方法? I wanted to access the row index, but it doesn't appear to be a property of the gridview. 我想访问行索引,但它似乎不是gridview的属性。 Thank you. 谢谢。

To identify the focused row by its handle you can use the GridView.FocusedRowHandle property. 要通过其句柄标识焦点行,可以使用GridView.FocusedRowHandle属性。 Please review the Identifying Rows and Cards article for more details. 请查看“ 识别行和卡片”一文以了解更多详细信息。
For moving row focus within the gridview from code-behind I suggest you use a special methods described in the Moving Row Focus help-article: 为了从代码后面在gridview中移动行焦点,建议您使用“ 移动行焦点”帮助文章中介绍的特殊方法:

void btnFocusNextRow_Click(object sender, EventArgs e) {
    gridView1.MoveNext();
}

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 C#DevExpress GridControl行 - C# DevExpress GridControl Rows c# DevExpress 网格控件 - c# DevExpress GridControl 如果行单元格值相同,则上下移动行或更改行颜色。gridview devexpress winforms c#? - move Rows up and down or change row color if the row cell value are the same gridview devexpress winforms c#? 如何在devexpress GridControl中添加行,就像我们在普通的datagridview中添加行一样。 (WinForms C#) - How to add rows in devexpress GridControl just like we add rows in a normal datagridview. (WinForms C#) C# - DevExpress - GridControl - DataGridView - C# - DevExpress - GridControl - DataGridView 使用C#按键移动DataGridView选定单元格/行的上/下键 - Move DataGridView Selected Cell/Row Up/Down On Keys Press Using C# 如何使用C#从值另一个表中设置gridcontrol devexpress中的Check Repository单选组 - how to set Check Repository radio group in gridcontrol devexpress using C# from value another table 如何在devexpress gridcontrol中添加新行?(WinForms C#) - How to add new line of row in devexpress gridcontrol?(WinForms C#) 如何在C#中访问DevExpress.XtraGrid.GridControl的列 - How to access Columns for DevExpress.XtraGrid.GridControl in C# 如何从WPF中的C#获取XAML中的DevExpress GridControl的内容 - How to get the content of a DevExpress GridControl in XAML from C# in WPF
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM