gpt4 book ai didi

c# - 对 GridView 进行排序时出现“System.StackOverflowException”

转载 作者:太空宇宙 更新时间:2023-11-03 19:29:35 25 4
gpt4 key购买 nike

当我尝试对 GridView 进行排序时,系统返回此错误消息:

gridview sort An unhandled exception of type 'System.StackOverflowException' occurred in System.Web.dll

这是代码,“Melder”是要排序的列的名称。

gvOutlookMeldingen.Sort("Melder", SortDirection.Ascending);

最佳答案

您可能在 gvOutlookMeldingen_Sorting 中调用了 Sort(),这将再次调用 gvOutlookMeldingen_SortingSort() ,从而产生一个循环。

Sorting 事件中,您需要调用更改数据源的函数并再次执行查询。或者,如果它是自动绑定(bind)的,则您无需执行任何操作。

资源

关于c# - 对 GridView 进行排序时出现“System.StackOverflowException”,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5946376/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com