Hi,
We want to remove the
column separators in the RadListView control (DetailsView) and set the headers
to align to the left (see the attached image).
We can do this in design view by going in to the Edit UI Elements-dialog and go to the DetailsListViewColumnContainers Children property and edit our two columns DrawBorder-property to false and TextAlignment-property to MiddleLeft. The problem is when we do that and run our project we get a runtime error, ArgumentOutOfRangeException, on the first row, of the ones down below. Is this not the way to remove the separators? Is there a better way to achieve this?
ArgumentOutOfRangeException on
the first of these rows (more specifically the last GetChildAt() fails):
((Telerik.WinControls.UI.DetailListViewHeaderCellElement)(this.radListViewServer.GetChildAt(0).GetChildAt(0).GetChildAt(3).GetChildAt(0))).DrawBorder = false;((Telerik.WinControls.UI.DetailListViewHeaderCellElement)(this.radListViewServer.GetChildAt(0).GetChildAt(0).GetChildAt(3).GetChildAt(0))).TextAlignment = System.Drawing.ContentAlignment.MiddleLeft;((Telerik.WinControls.UI.DetailListViewHeaderCellElement)(this.radListViewServer.GetChildAt(0).GetChildAt(0).GetChildAt(3).GetChildAt(0))).Text = "Server";((Telerik.WinControls.UI.DetailListViewHeaderCellElement)(this.radListViewServer.GetChildAt(0).GetChildAt(0).GetChildAt(3).GetChildAt(1))).DrawBorder = false;((Telerik.WinControls.UI.DetailListViewHeaderCellElement)(this.radListViewServer.GetChildAt(0).GetChildAt(0).GetChildAt(3).GetChildAt(1))).TextAlignment = System.Drawing.ContentAlignment.MiddleLeft;((Telerik.WinControls.UI.DetailListViewHeaderCellElement)(this.radListViewServer.GetChildAt(0).GetChildAt(0).GetChildAt(3).GetChildAt(1))).Text = "Kommentar";