Hi Sheldon,
Thank you for writing.
You can do this by handling the
CellFormatting event. You can use
HeaderText property to identify whether the processed cell belongs to the last column and the row index to determine whether this is the last row. Consider the sample below:
void
radListView1_CellFormatting(
object
sender, ListViewCellFormattingEventArgs e)
{
if
(e.CellElement.VisualState.Contains(
"DetailListViewHeaderCellElement"
))
{
e.CellElement.ResetValue(LightVisualElement.DrawBorderProperty, ValueResetFlags.Local);
e.CellElement.ResetValue(LightVisualElement.BorderBoxStyleProperty, ValueResetFlags.Local);
e.CellElement.ResetValue(LightVisualElement.BorderLeftWidthProperty, ValueResetFlags.Local);
e.CellElement.ResetValue(LightVisualElement.BorderRightWidthProperty, ValueResetFlags.Local);
e.CellElement.ResetValue(LightVisualElement.BorderTopWidthProperty, ValueResetFlags.Local);
e.CellElement.ResetValue(LightVisualElement.BorderBottomWidthProperty, ValueResetFlags.Local);
e.CellElement.ResetValue(LightVisualElement.BorderRightColorProperty, ValueResetFlags.Local);
e.CellElement.ResetValue(LightVisualElement.BorderBottomColorProperty, ValueResetFlags.Local);
}
else
{
if
(e.CellElement.Data.HeaderText ==
"Column 3"
)
{
e.CellElement.DrawBorder =
true
;
e.CellElement.BorderBoxStyle = BorderBoxStyle.FourBorders;
e.CellElement.BorderLeftWidth = 0;
e.CellElement.BorderTopWidth = 0;
e.CellElement.BorderBottomWidth = 1;
e.CellElement.BorderRightWidth = 0;
e.CellElement.BorderRightColor = Color.Gray;
}
else
{
e.CellElement.DrawBorder =
true
;
e.CellElement.BorderBoxStyle = BorderBoxStyle.FourBorders;
e.CellElement.BorderLeftWidth = 0;
e.CellElement.BorderTopWidth = 0;
e.CellElement.BorderBottomWidth = 1;
e.CellElement.BorderRightWidth = 1;
e.CellElement.BorderBottomColor = Color.Gray;
e.CellElement.BorderRightColor = Color.Gray;
}
DetailListViewDataCellElement detailCell = e.CellElement
as
DetailListViewDataCellElement;
if
(detailCell !=
null
&&
this
.radListView1.Items.IndexOf(detailCell.Row) ==
this
.radListView1.Items.Count - 1)
{
e.CellElement.BorderBottomWidth = 0;
}
}
}
I hope it helps.
Kind regards,
Jack
the Telerik team