Datagridview tablestyles?

jeva39

Well-known member
Joined
Jan 28, 2005
Messages
135
Location
Panama
Programming Experience
1-3
In VB.NET 2003 this sintax is valid:

VB.NET:
Private sub columnsFormat()
Dim TSPrograms As New DataGridTableStyle
TSPrograms.MappingName = "Programs"
TSPrograms.AllowSorting = True
Dim oID As New DataGridTextBoxColumn
oID.MappingName = "ID"
oID.HeaderText = "ID"
oID.Width = 70
TSProgramas.GridColumnStyles.Add(oID)
 
......others columns....
 
myGrid.TableStyles.Add(TSPrograms)
End Sub



The problem is that TABLESTYLES don't work in 2005. Please, what is the correct Syntax?

Thanks...
 
The DataGrid and the DataGridView are two different controls. The DataGrid still exists in .NET 2.0 but mainly for backward-compatibility. The DataGridView is much more functional but, to achieve this, it works in a quite different way. I suggest you do some reading on the DataGridView to familiarise yourself with its functionality:

http://msdn2.microsoft.com/en-us/library/k39d6s23.aspx

Pay special attention to the first link in the Related Sections section.
 
Back
Top