Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Change the backcolor of a specific Datagrid column ?

Status
Not open for further replies.

Takis

Instructor
Oct 12, 2001
57
0
0
GR
I have added programmatically some columns of a dataset in a datagrid. Although i tried to change the back color of a specific column in my datagrid this was not possible. I couldnt find any attribute or method for that purpose.

My code:

dim t As New DataGridTableStyle
Dim c As DataGridTextBoxColumn

t.MappingName = " .... "

columnnames("rccharat", "Charge Rate")
t.GridColumnStyles.Add(c)

columnnames("rctaxtot", "Amount of Charge")
t.GridColumnStyles.Add(c)

....

DataGrid1.TableStyles.Add(t)


And the columnnames sub is:

Sub columnnames(ByVal truename As String, ByVal colname As String)
c = New DataGridTextBoxColumn
c.MappingName = truename
c.HeaderText = colname

c.Width = 100
c.Alignment = HorizontalAlignment.Center
End Sub


Does anyone knows if this possible?

Thank you,
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top