Hello Christian,
Thank you for writing.
I am not sure whether you use the
ControlDeafult theme, but note that by default cell elements have applied border as well. In order to apply a row border, it is necessary to hide the cell border. Here is a sample code snippet which result is illustrated on the attached screenshot:
private
void
radGridView1_RowFormatting(
object
sender, Telerik.WinControls.UI.RowFormattingEventArgs e)
{
if
(e.RowElement.RowInfo.IsExpanded)
{
e.RowElement.DrawBorder =
true
;
e.RowElement.BorderColor = Color.Red;
e.RowElement.BorderGradientStyle = GradientStyles.Solid;
e.RowElement.BorderWidth = 2;
}
else
{
e.RowElement.ResetValue(Telerik.WinControls.UI.LightVisualElement.DrawBorderProperty, ValueResetFlags.Local);
e.RowElement.ResetValue(Telerik.WinControls.UI.LightVisualElement.BorderColorProperty, ValueResetFlags.Local);
e.RowElement.ResetValue(Telerik.WinControls.UI.LightVisualElement.BorderGradientStyleProperty, ValueResetFlags.Local);
e.RowElement.ResetValue(Telerik.WinControls.UI.LightVisualElement.BorderWidthProperty, ValueResetFlags.Local);
}
}
private
void
radGridView1_CellFormatting(
object
sender, Telerik.WinControls.UI.CellFormattingEventArgs e)
{
if
(e.Row.IsExpanded)
{
e.CellElement.DrawBorder =
false
;
}
else
{
e.CellElement.ResetValue(Telerik.WinControls.UI.LightVisualElement.DrawBorderProperty, ValueResetFlags.Local);
}
if
(e.CellElement.IsCurrent)
{
e.CellElement.DrawFill =
false
;
}
else
{
e.CellElement.ResetValue(Telerik.WinControls.UI.LightVisualElement.DrawFillProperty, ValueResetFlags.Local);
}
}
I hope this information helps. Should you have further questions I would be glad to help.
Regards,
Dess
Telerik
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the
Telerik Feedback Portal and vote to affect the priority of the items