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

SelfHierarchy Caption Problem

1 Answer 53 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Barbaros Saglamtimur
Top achievements
Rank 1
Barbaros Saglamtimur asked on 14 Nov 2012, 10:57 AM
Hi,
I am using SelfHierarchy within my RadGrid and would like to add Caption to my MasterTableView. When I set the caption like;
<MasterTableView HierarchyDefaultExpanded="false" HierarchyLoadMode="Client" AllowSorting="false"
 DataKeyNames="RowOrder, ParentId" Caption="Caption Goes Here">
The caption is added to each details table as-well. Screen-shot is attached to see the behavior. I would like to hide caption for the details tables. How can I achieve this?

TIA.

1 Answer, 1 is accepted

Sort by
0
Shinu
Top achievements
Rank 2
answered on 21 Nov 2012, 06:52 AM
Hi,

Please take a look into the following code snippet.

C#:
protected void RadGrid1_ItemCreated(object sender, Telerik.Web.UI.GridItemEventArgs e)
{
    if (e.Item is GridHeaderItem && e.Item.OwnerTableView != RadGrid1.MasterTableView)
    {
        e.Item.OwnerTableView.Caption = "";
    }
}

Thanks,
Shinu.
Tags
Grid
Asked by
Barbaros Saglamtimur
Top achievements
Rank 1
Answers by
Shinu
Top achievements
Rank 2
Share this question
or