简体   繁体   English

将选定的行移到datagrid WPF C#的底部或最后一行

[英]Move selected row to bottom or last row of datagrid WPF C#

在此处输入图片说明 So I'm currently doing an automated IQ exam for our HR department. 因此,我目前正在为我们的人力资源部门进行自动IQ考试。 I'm using C# as my P-language and WPF as app foundation. 我使用C#作为我的P语言,使用WPF作为应用程序基础。 My questions are stored on a mysql database and binded on a datagrid. 我的问题存储在mysql数据库中,并绑定在datagrid上。

My question is, is there a way for me to move a row to the last row? 我的问题是,我是否可以将一行移到最后一行? The idea is, when an examiner skips a question, that question goes to the last row of the datagrid. 这个想法是,当检查员跳过一个问题时,该问题将转到数据网格的最后一行。 Thanks in advance! 提前致谢!

Edit: I've added a picture to explain my idea. 编辑:我添加了一张图片来解释我的想法。 Hope it helps! 希望能帮助到你! 在此处输入图片说明

try this 尝试这个

YourList.Move(dataGrid.SelectedIndex, dataGrid.Items.Count - 2); YourList.Move(dataGrid.SelectedIndex,dataGrid.Items.Count-2);

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

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM