Hello Matt,
You can achieve your requirement by using a custom content cell for the group rows. You can hide the text of the cell, add and arrange separate elements for each column summary. Below is an example implementation of this custom cell:
public
class
CustomGroupContentCellElement : GridGroupContentCellElement
{
private
LightVisualElement elementHeader;
private
LightVisualElement elementSummary1;
private
LightVisualElement elementSummary2;
public
CustomGroupContentCellElement(GridViewColumn column, GridRowElement row)
:
base
(column, row)
{
}
public
override
object
Value
{
get
{
return
string
.Empty; }
set
{
base
.Value = value; }
}
public
override
void
Initialize(GridViewColumn column, GridRowElement row)
{
base
.Initialize(column, row);
GridViewGroupRowInfo rowInfo = (GridViewGroupRowInfo)
base
.RowInfo;
string
headerText = rowInfo.HeaderText;
string
summary = rowInfo.GetSummary();
string
[] summaries = summary.Split(
new
char
[] {
','
});
this
.elementHeader.Text = headerText;
this
.elementSummary1.Text = summaries[0];
this
.elementSummary2.Text = summaries[1];
}
protected
override
void
CreateChildElements()
{
base
.CreateChildElements();
this
.elementHeader =
new
LightVisualElement();
this
.elementSummary1 =
new
LightVisualElement();
this
.elementSummary2 =
new
LightVisualElement();
this
.Children.Add(
this
.elementHeader);
this
.Children.Add(
this
.elementSummary1);
this
.Children.Add(
this
.elementSummary2);
}
protected
override
SizeF MeasureOverride(SizeF availableSize)
{
base
.MeasureOverride(availableSize);
this
.elementHeader.Measure(availableSize);
this
.elementSummary1.Measure(availableSize);
this
.elementSummary2.Measure(availableSize);
return
availableSize;
}
protected
override
SizeF ArrangeOverride(SizeF finalSize)
{
IList<GridViewColumn> renderColumns =
base
.TableElement.ViewElement.RowLayout.RenderColumns;
int
x1 = renderColumns[0].Width + renderColumns[1].Width;
int
x2 = x1 + renderColumns[2].Width;
int
x3 = x2 + renderColumns[3].Width;
this
.Children[0].Arrange(
new
RectangleF(0, 0, 0, 0));
this
.Children[1].Arrange(
new
RectangleF(x2, 0, 0, 0));
this
.Children[2].Arrange(
new
RectangleF(x3, 0, 0, 0));
return
finalSize;
}
}
You can use the
CreateCell event of
RadGridView to replace the
GridGroupContentCellElement with the custom cell:
I have used the following sample data to test this approach:
I hope it helps.
Best regards,
Alexander
the Telerik team