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

Show only Parents in the Self Referencing Gridview

1 Answer 51 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Ramasamy
Top achievements
Rank 1
Ramasamy asked on 27 Sep 2011, 11:57 AM
Hi,

I have a table like the below

ID   Name          Parent ID
1    Benefits        NULL
2    Enrolment     NULL
3    Health             1
4    Employee       1
5    Initial               2

and i need the output like

-Benefits
      - Health
      - Employee
- Enrolment
      - Initial

Now I am getting the hierachy correctly, but instead of showing only the parents my grid shows all the 5 rows. Any idea please.

Thanks,
Ramasamy

1 Answer, 1 is accepted

Sort by
0
Ramasamy
Top achievements
Rank 1
answered on 28 Sep 2011, 05:34 AM
Hi,

I have solved this issue by using the filterdescriptor

<telerik:RadGridView.FilterDescriptors>
<telerik:FilterDescriptor Member="ParentID" Operator="IsEqualTo" Value="0"/>
</telerik:RadGridView.FilterDescriptors>

It shows only the parent first and while expanding it shows the child.

Thanks,
Ramasamy

Tags
GridView
Asked by
Ramasamy
Top achievements
Rank 1
Answers by
Ramasamy
Top achievements
Rank 1
Share this question
or