简体   繁体   English

防止对DatagridView中的最后一行进行排序

[英]Prevent Last row in DatagridView from Sorting

i have a datagridview which is populated with a DataTable & i am inserting a row to show sum of 1 column values inside it (in DataTable) and then providing it as Datasource to the datagridview. 我有一个用DataTable填充的datagridview,并且我要插入一行以在其中显示1列值的总和(在DataTable中),然后将其作为Datasource提供给datagridview。

the last row is nothing but "Total : %Number of records% %Sum Value%". 最后一行不过是“总计:%记录数%%总值%”。

when the gridview sorts the above row is also sorted which i guess is obvious. 当gridview对上面的行进行排序时,我想这也是显而易见的。

how can i prevent the above from sorting. 我如何防止上述排序。

is there sumthing wrong in inserting a summary row in datatable itself, if so whts the other option to have similar functionality. 在数据表本身中插入摘要行是否存在错误,如果是这样,则另一个选项具有相似的功能。

Thanks 谢谢

尝试将最后一行的tr元素放到tfoot内 ,以确保最后一行在其余部分排序时保持固定。

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

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