Sadly it appears there is not.
You are going to have to either
1) inherit a custom grid column style or
2) Buy a third party control. (And if you can figure out a way to get a
refung from MS for the datagrid, let me know ;) )
I feel the same way. In the end I bit the bullet and used the inherited grid
style.
A good example of variations on the technique can be is found at
http://www.syncfusion.com/faq/winforms/search/745.asp
What the article doesn't list is the code to add the custom style to your
grid.
Once you create the custom grid syle, you can test it using this code:
Drop a datagrid on a form and add this code somewhere.
Dim dc As DataColumn
Dim dt As New DataTable("person")
Dim dr As DataRow
dc = New DataColumn("name", GetType(String))
dt.Columns.Add(dc)
dc = New DataColumn("age", GetType(Int32))
dt.Columns.Add(dc)
dr = dt.NewRow
dr(0) = "fred smith"
dr(1) = 55
dt.Rows.Add(dr)
dr = dt.NewRow
dr(0) = "june jones"
dr(1) = 34
dt.Rows.Add(dr)
dr = dt.NewRow
dr(0) = "bob brown"
dr(1) = 73
dt.Rows.Add(dr)
Dim ts As New DataGridTableStyle
ts.MappingName = dt.TableName
Dim coltext As New DataGridTextBoxColumn
coltext.MappingName = dt.Columns(0).ColumnName
coltext.Width = 60
coltext.HeaderText = "Person's Name"
ts.GridColumnStyles.Add(coltext)
Dim colcustom As New CustomGridColStyle
colcustom.MappingName = dt.Columns(1).ColumnName
coltext.HeaderText = "Person's Age"
coltext.Width = 40
ts.GridColumnStyles.Add(colcustom)
Me.DataGrid1.TableStyles.Clear()
Me.DataGrid1.TableStyles.Add(ts)
DataGrid1.DataSource = dt
Good luck. It takes a while to get the hang of.
Jonathan Steinberg
BRCorp
jsteinberg@NOTBRCorp.com
> I have to admit I have never seen a more convaluted Object Model all i want
> to do is color one column in a grid...thats it.
>
> I have downloaded several examples from the web but none that I have been
> able to integrate into my project is there a straight forward way to color
> one column in a DataGrid...PLEASE!