Thank you for writing.
The width of the group row is calculated dynamically while printing the control. The print layout can be customized with a custom renderer if you override the GetRowSize method:
private
void
radButton1_Click(
object
sender, EventArgs e)
{
MyGridPrintStyle style =
new
MyGridPrintStyle();
this
.radGridView1.PrintStyle = style;
this
.radGridView1.PrintPreview();
}
public
class
MyGridPrintStyle : GridPrintStyle
{
protected
override
BaseGridPrintRenderer InitializePrintRenderer(RadGridView grid)
{
return
new
MyTableViewDefinitionPrintRenderer(grid);
}
}
public
class
MyTableViewDefinitionPrintRenderer : TableViewDefinitionPrintRenderer
{
public
MyTableViewDefinitionPrintRenderer(RadGridView grid)
:
base
(grid)
{ }
Size rowSize = Size.Empty;
protected
override
Size GetRowSize(GridViewRowInfo row, TableViewRowLayout rowLayout)
{
if
(!(row
is
GridViewGroupRowInfo))
{
return
base
.GetRowSize(row, rowLayout);
}
if
(
this
.rowSize == Size.Empty)
{
int
width = 0;
int
height = rowLayout.GetRowHeight(row) +
this
.GridView.TableElement.RowSpacing;
foreach
(GridViewColumn col
in
rowLayout.RenderColumns)
{
if
(col
is
GridViewRowHeaderColumn || col
is
GridViewIndentColumn)
{
continue
;
}
TableViewCellArrangeInfo info = rowLayout.LayoutImpl.GetArrangeInfo(col);
if
(info ==
null
)
{
continue
;
}
int
cellWidth = rowLayout.GetColumnWidth(col);
if
(width != 0)
{
cellWidth +=
this
.GridView.TableElement.CellSpacing;
}
width += cellWidth;
}
this
.rowSize =
new
Size(width, height);
}
return
this
.rowSize;
}
}
Generally speaking the group row in your screenshot should have a width equalling the width of the data row. In case you will be needing further assistance, please provide me with more information about your local setup and with details how the behavior on your end can be reproduced.
Regards,
Hristo
Progress Telerik