priyamtheone
Well-known member
- Joined
- Sep 20, 2007
- Messages
- 96
- Programming Experience
- Beginner
I have a readonly datagridview that is bound to a datasource. It has two columns. Now I want the first column to have no cell borderstyle; and the second one to have 'All' (i.e. all sides of the cell shall have a border) as cell borderstyle. Before binding the datagridview to the datasource, I'm writing something like mentioned below but it's taking no effect. Assume the column in question is named DisplayName.
Please rectify or suggest a better way. Regards.
VB.NET:
Dim newStyle As New DataGridViewAdvancedBorderStyle()
With newStyle
[INDENT].Top = DataGridViewAdvancedCellBorderStyle.Single
.Left = DataGridViewAdvancedCellBorderStyle.Single
.Bottom = DataGridViewAdvancedCellBorderStyle.Single
.Right = DataGridViewAdvancedCellBorderStyle.Single[/INDENT]
End With
DisplayName.CellTemplate.AdjustCellBorderStyle(newStyle, newStyle, True, True, True, True)
Please rectify or suggest a better way. Regards.