Indication of child row presence

3 posts, 0 answers
  1. Jeppe
    Jeppe avatar
    4 posts
    Member since:
    Sep 2012

    Posted 22 Aug 2011 Link to this post


    I use hierarchies a lot. Is there an easy way to indicate that a row actually has any child rows - e.g.  "expander"-icon bolded or something like that. I'm aware that I can access ChildRows-property at GridViewInfo-level, but I'd rather keep it "inside" the gridview - perhaps using the expression builder.

    Best regards,

    Jeppe Havelund
  2. Julian Benkov
    Julian Benkov avatar
    1135 posts

    Posted 25 Aug 2011 Link to this post

    Hello Jeppe,

    You can change the image of the expander or other expander properties using the ViewCellFormatting event:
    Bitmap bitmap = new Bitmap(10, 10);
    void radGridView1_ViewCellFormatting(object sender, CellFormattingEventArgs e)
        if (e.CellElement is GridGroupExpanderCellElement && e.Row.ChildRows.Count > 0)
            ((GridGroupExpanderCellElement)e.CellElement).Expander.SignImage = bitmap;

    I hope you find this useful. Do not hesitate to contact us if you have further questions.

    Julian Benkov
    the Telerik team

    Thank you for being the most amazing .NET community! Your unfailing support is what helps us charge forward! We'd appreciate your vote for Telerik in this year's DevProConnections Awards. We are competing in mind-blowing 20 categories and every vote counts! VOTE for Telerik NOW >>

  3. Jeppe
    Jeppe avatar
    4 posts
    Member since:
    Sep 2012

    Posted 08 Nov 2011 Link to this post

    Thanks. That helped me I am, however, modifying expander opacity according to subrow presence. Quite ok...

Back to Top