This is a migrated thread and some comments may be shown as answers.

Indication of child row presence

2 Answers 28 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Jeppe
Top achievements
Rank 1
Jeppe asked on 22 Aug 2011, 12:28 PM
Hi.

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 Answers, 1 is accepted

Sort by
0
Julian Benkov
Telerik team
answered on 25 Aug 2011, 08:34 AM
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.

Regards,
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 >>

0
Jeppe
Top achievements
Rank 1
answered on 08 Nov 2011, 01:44 PM
Thanks. That helped me I am, however, modifying expander opacity according to subrow presence. Quite ok...

Jeppe
Tags
GridView
Asked by
Jeppe
Top achievements
Rank 1
Answers by
Julian Benkov
Telerik team
Jeppe
Top achievements
Rank 1
Share this question
or