使用通用列表进行 WebDataGrid 排序

发布于 2024-12-25 11:50:16 字数 507 浏览 5 评论 0原文

我有一个像这样的通用集合,

Dim List(Of t) myData = data.GetData()
myWebDataGrid.DataSource = myData
myWebDataGrid.DataBind()

webdatagrid 排序的配置是这样的,

<Behaviors>
   <ig:Sorting Enabled="true" SortingMode="Multi">
      <ColumnSettings>
          <ig:SortingColumnSetting ColumnKey="Key1" Sortable="true" />
      </ColumnSettings>
   </ig:Sorting>
</Behaviors>

但是当我在此控件上设置可排序属性并运行页面时... 我只是尝试排序,所有数据都消失了。

I have a generic collection like this

Dim List(Of t) myData = data.GetData()
myWebDataGrid.DataSource = myData
myWebDataGrid.DataBind()

the config of the webdatagrid sort is this

<Behaviors>
   <ig:Sorting Enabled="true" SortingMode="Multi">
      <ColumnSettings>
          <ig:SortingColumnSetting ColumnKey="Key1" Sortable="true" />
      </ColumnSettings>
   </ig:Sorting>
</Behaviors>

but when I set the sortable property on this control and run the page...
I just try to sort and all the data disappears.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

吹梦到西洲 2025-01-01 11:50:16

是的,网格希望在每次回发时都有数据源。或者您可以尝试设置 EnableDataViewState="true"

Yes the grid expects to have datasource on every postback. Or you can try to set EnableDataViewState="true"

指尖凝香 2025-01-01 11:50:16

我意识到回发后我必须再次设置数据。

I realized that after the postback I have to set the data again.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文