Style a header based on value of grouping

5 posts, 1 answers
  1. William
    William avatar
    3 posts
    Member since:
    Dec 2013

    Posted 06 Jan 2014 Link to this post

    Is it possible to style a group header based on the value of the grouping?

    Suppose I have some bank accounts that are grouped by a type, eg checking,savings, etc.

    Is it possible to have the Checking header be displayed with one color, and the Savings header displayed with another?

    Thank you
  2. Answer
    Deyan
    Admin
    Deyan avatar
    2039 posts

    Posted 10 Jan 2014 Link to this post

    Hello William,

    Thanks for writing.



    Yes, you can use a GroupHeaderTemplateSelector and return different DataTemplate instances for the different grouping values via it.



    Regards,

    Deyan
    Telerik
    Have a suggestion or face a problem - you can use the Ideas & Feedback portal to submit ideas, feedback and vote for them.
  3. DevCraft banner
  4. William
    William avatar
    3 posts
    Member since:
    Dec 2013

    Posted 10 Jan 2014 Link to this post

    Could you post or direct me to an example?

    The specific area where I am running into problems is the SelectTemplate method on the selector. I don't know what type the incoming object is.

    Thank you.
  5. Deyan
    Admin
    Deyan avatar
    2039 posts

    Posted 13 Jan 2014 Link to this post

    Hello William,

    Thanks for writing back.



    This object should be of type DataGroup. This type exposes the group key so you can decide which template to return.



    Let me know if you have additional questions here.



    Regards,

    Deyan
    Telerik
    Have a suggestion or face a problem - you can use the Ideas & Feedback portal to submit ideas, feedback and vote for them.
  6. William
    William avatar
    3 posts
    Member since:
    Dec 2013

    Posted 14 Jan 2014 Link to this post

    Thank you, that was exactly what I needed!
Back to Top
DevCraft banner