[英]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.