or
private
void
TemplateRelations()
{
GridViewTemplate template =
new
GridViewTemplate();
template.Caption =
"Tracking Info"
;
template.DataSource = trackingInfos;
gvTrackingInfo.Templates.Add(template);
template.AllowRowResize =
false
;
template.ShowColumnHeaders =
false
;
template.ShowRowHeaderColumn =
false
;
template.Columns[0].Width = 800;
template.Rows[0].Height = 500;
for
(
int
i = 1; i < template.Columns.Count; i++)
{
template.Columns[i].IsVisible =
false
;
}
GridViewRelation relation =
new
GridViewRelation(
this
.gvTrackingInfo.MasterTemplate, template);
relation.ParentColumnNames.Add(
"TrackingNumber"
);
relation.ChildColumnNames.Add(
"TrackingNumber"
);
this
.gvTrackingInfo.Relations.Add(relation);
}
private
void
gvTrackingInfo_CellFormatting(
object
sender, CellFormattingEventArgs e)
{
TabContainer tabContainer =
new
TabContainer();
GridViewDataColumn column = e.CellElement.ColumnInfo
as
GridViewDataColumn;
if
(column !=
null
&& column.OwnerTemplate.Caption ==
"Tracking Info"
)
{
RadPanel panel =
new
RadPanel();
tabContainer.Height = 500;
tabContainer.Width = 800;
panel.Controls.Add(tabContainer);
panel.TextAlignment = ContentAlignment.MiddleCenter;
e.Row.Height = 500;
e.Column.Width = 800;
e.CellElement.Children.Add(
new
RadHostItem(panel));
}
}
[-------- Category A --------][-------- Cat B --------][-------- Category C --------]
[--- Col 1 ---][--- Col 2 ---][------- Col 3 --------][--- Col 4 ---][--- Col 5 ---]