I should clarify, It's a windows forms app, visual studio 2002, populated in
the code below.
I don't know what the syntax is for setting the column color of a specific
column (for example, when i=2, I need to column color to be gray). I don't
think the property builder is available in this situation (is that just for
web apps?).
Thanks,
Dave
DataGridTableStyle tableStyle = new DataGridTableStyle();
tableStyle.MappingName = "Defs";
DataTable dt = dsDefs.Tables["Defs"];
for(int i = 0; i < dt.Columns.Count; ++i)
{
DataGridTextBoxColumn TextCol = new DataGridTextBoxColumn();
TextCol.MappingName = dt.Columns
.ColumnName;
TextCol.HeaderText = dt.Columns.ColumnName;
tableStyle.GridColumnStyles.Add(TextCol);
}
dataGrid1.TableStyles.Clear();
dataGrid1.TableStyles.Add(tableStyle);
dataGrid1.DataSource = dt;
Dave Petersen said:
How do I set the color of a specific column in my C# winforms datagrid?
Thanks,
Dave