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

Hierarchical grid with selfreference and different columns for child elements

1 Answer 42 Views
GridView
This is a migrated thread and some comments may be shown as answers.
flisak
Top achievements
Rank 1
flisak asked on 31 May 2012, 01:40 PM
Hi,

I want to make hierachical grid with object:

Class Toy
{
  public Guid Id {get; set;}
  public Guid ParentId {get; set;}
  public string Name {get; set;}
  public int Count {get; set;}
}


Objects:

ParentToy (id1, null, "Castle", 1)
ChildToy1 (id2, id1, "Knight", 10)
ChildToy2 (id3, id1, "Brick", 100)

I want to have in grid first row with ParentToy and only column "Name" visible.
In hierarchy for ParentToy I want to have two child toys with columns: "name", "count".

Is this possible?

Best regards
 Krzysztof

1 Answer, 1 is accepted

Sort by
0
Jack
Telerik team
answered on 05 Jun 2012, 09:57 AM
Hello Krzysztof,

By definition, in self-reference mode items contain elements of the same type and therefore all rows have equal columns. When you want to display different columns at every level, you should use some of the other hierarchy options which RadGridView offers. Check our online documentation for further details.

If you have any other questions, I will be glad to help.
 
Kind regards,
Jack
the Telerik team
RadControls for WinForms Q1'12 release is now live! Check out what's new or download a free trial >>
Tags
GridView
Asked by
flisak
Top achievements
Rank 1
Answers by
Jack
Telerik team
Share this question
or