how to group one column A but display values from column B in group rows

4 posts, 0 answers
  1. Sodi We
    Sodi We avatar
    160 posts
    Member since:
    Apr 2010

    Posted 23 Aug 2010 Link to this post


    Hello,

    I would like to apply grouping in the RadGridView based on one column, but the group rows in the RadGridView should display values from another column.

    Moreover, I prefer not to implement this functionality in the XAML, but in the code-behind. The reason is that I would like to apply this grouping only when certain conditions are met.

    Any thoughts?

    Thanks,
    Sodi
  2. Milan
    Admin
    Milan avatar
    1989 posts

    Posted 23 Aug 2010 Link to this post

    Hi Sodi We,

    What kind of data from other columns would you like to display? Some kind of aggregate results or something else?


    Kind regards,
    Milan
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
  3. DevCraft banner
  4. Sodi We
    Sodi We avatar
    160 posts
    Member since:
    Apr 2010

    Posted 23 Aug 2010 Link to this post


    Hello Milan,

    I would not display aggregate results. I would just display a (string) value from another column.

    I have some additional remarks, that may clarify my problem a bit more:
    As I told before, I would like to apply grouping based on column A, but display values of column B in the group rows. But in my particular case, the rows that are grouped together would not only have the same value in column A, but would also contain the same value in column B.

    The reason why I don't apply grouping directly with column B, is that the order of the groups would in that case be alphabetically. And I don't want to have the groups ordered alphabetically. I want the groups to be ordered in ascending order according to the values in column A, which contains integer values.

    In fact, if there is a way to manipulate the order of groups based on values from a column other than the column used for grouping, then this would also solve my problem. Because in that case I can apply grouping based on column B and use the values in column A to determine the order of the groups.

    Kind regards,
    Sodi
  5. Milan
    Admin
    Milan avatar
    1989 posts

    Posted 27 Aug 2010 Link to this post

    Hello Sodi We,

    We have created a special ExpressionGroupDescriptor which allows you to specify the sorting order of the groups but I am afraid that It might be difficult to determine the correct grouping order by a column other than the one that the grouping is performed on. Let me explain the possible problem: The order of the groups is determined after the groups are constructed. The problem here is that a single group contains many rows - which of those items will determine the order of the group?

    There is another possible way to tackle the problem at hand. As you have said, grouping by column B is undesirable since the groups will be arranged alphabetically. Is it possible to determine the correct order just by inspecting the string of the group? The attached project does something very similar. A grouping is performed on a property of type DayOfWeek which has a predefined order for all days. The application demonstrates how you can change the order of the grouping by inspecting the value of each group and assigning it an integer value which determines the actual order. 

    Hope this helps. Correct me if I haven't understood your scenario correctly.


    Sincerely yours,
    Milan
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
Back to Top