Hello,
I have a rad grid in a usercontrol with 3 levels of hierarchy as shown bellow,
in the OnItemDataBound event handler, I replace the value of specific column cells with a suitable image,
the images are displayed well, but the problem is when I expand a detail table, the images in the parent table disappear and appears in the child table, I want them to be displayed in all hierarchy levels.
I have a rad grid in a usercontrol with 3 levels of hierarchy as shown bellow,
<rad:RadGrid ID="RadGrid1" runat="server" DataSourceID="SqlDataSource1" OnItemDataBound="OnGridItemDataBound" |
EnableViewState="true"> |
<MasterTableView DataSourceID="SqlDataSource1" DataKeyNames="SpecialismeNaam" AllowMultiColumnSorting="True" |
EnableViewState="true"> |
<DetailTables> |
<rad:GridTableView DataKeyNames="CareType" DataSourceID="SqlDataSource2" Width="100%" |
runat="server"> |
<ParentTableRelation> |
<rad:GridRelationFields DetailKeyField="SpecialismeNaam" MasterKeyField="SpecialismeNaam" /> |
</ParentTableRelation> |
<DetailTables> |
<rad:GridTableView DataKeyNames="Indicator" DataSourceID="SqlDataSource3" Width="100%" |
runat="server"> |
<ParentTableRelation> |
<rad:GridRelationFields DetailKeyField="CareType" MasterKeyField="CareType" /> |
</ParentTableRelation> |
</rad:GridTableView> |
</DetailTables> |
</rad:GridTableView> |
</DetailTables> |
</MasterTableView> |
</rad:RadGrid> |
in the OnItemDataBound event handler, I replace the value of specific column cells with a suitable image,
protected void OnGridItemDataBound(object sender, Telerik.WebControls.GridItemEventArgs e) |
{ |
GridDataItem item = e.Item as GridDataItem; |
if (item == null) |
{ |
return; |
} |
if (item["Trend"] == null) |
{ |
return; |
} |
int trenValue; |
if (!int.TryParse(item["Trend"].Text, out trenValue)) |
{ |
return; |
} |
// Display image |
item["Trend"].Controls.Add(GetCellArrowImage(trenValue)); |
} |
the images are displayed well, but the problem is when I expand a detail table, the images in the parent table disappear and appears in the child table, I want them to be displayed in all hierarchy levels.