Hi,
Add a tablestyle to a grid. Set the datagridtextboxcolumn readonly
property to false.
Private Sub SetupGrid()
Dim ts As New DataGridTableStyle
ts.MappingName = "Categories"
Dim colPhoto As New DataGridTextBoxColumn
With colPhoto
..MappingName = "Picture"
..HeaderText = "Photo"
..Width = 150
End With
Dim colName As New DataGridTextBoxColumn
With colName
..MappingName = "CategoryName"
..HeaderText = "Name"
..Width = 80
End With
Dim colDescription As New DataGridTextBoxColumn
With colDescription
..MappingName = "Description"
..HeaderText = "Description"
..Width = 80
..ReadOnly = True
End With
ts.GridColumnStyles.Add(colPhoto)
ts.GridColumnStyles.Add(colName)
ts.GridColumnStyles.Add(colDescription)
DataGrid1.TableStyles.Add(ts)
ts = Nothing
colDescription = Nothing
colName = Nothing
colPhoto = Nothing
End Sub
Ken