开发者

Hierarchical Telerik RadGrids: How can I get rid of sorting bugs?

开发者 https://www.devze.com 2023-03-31 10:46 出处:网络
I\'m using a hierarchical RadGrid (Telerik control) but there are some bugs regarding the sort of the second level. I have two levels and the second level is loaded based on the first level.

I'm using a hierarchical RadGrid (Telerik control) but there are some bugs regarding the sort of the second level. I have two levels and the second level is loaded based on the first level.

Columns of the first level: Foo1, Foo2, Foo3

Columns of the second level: Bar1, Foo2, Bar2, Bar3

Binding is issued through a function.

Problems:

  1. If a single row of the first level is expanded (we can see a single sub-grid from the second level) and I want to sort by Bar1, the sort happens, but an error occures:

    Uncaught TypeError: Cannot call method 'sort' of null

  2. If a single row of the first level is expanded (we can see a single sub-grid from the second level) and I want to sort the second level by Foo2, the sort happens for the parent grid's (!) Foo2 column

  3. If two rows of the first level are expanded (we can see two sub-grids from the second level) and I want to sort both the subgrids by the same column a strange rectangle appears instead of the ascending/descending sign, I get the same error as described in the first problem but the sorting is not issued.

I would like to get rid of these problems, my question is the following:

If we have a hierarchical RadGrid and both开发者_如何学Python the first and the second level is sortable how can I implement a sort of the second level to be free of bugs?

Thank you in advance for your responses.


I've found the answer.

The problem is that the columns are automatically generated and hierarchical RadGrids where the columns are automatically generated have a bug in Telerik. When a column is not sorted, its header (th tag) doesn't have rgSorted class and doesn't have an input tag as a child. When the column is sorted, it has an rgSorted class and it has an input inside it. The input has rgSortedAsc or rgSortedDesc class, depending on the sorting direction. So, if I want to solve it I'll have to make a hack, which will be incompatible with future versions. This is painful, because I need the second level of my grid, I need the columns to be automatically generated (the columns are revealed at runtime) and I want to be able to sort them, but, unfortunately the answer to my question is that there is no solution for this bug.

Please view this thread on the Telerik forum: http://www.telerik.com/community/forums/aspnet-ajax/grid/hierarchical-radgrid-sorting-problems.aspx#1782047

I hope I've saved some fellow programmers from the torture I've faced.

Thanks for the comments, fellows, Lajos Arpad.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号