Code is below Ollie;
public void LoadGridData(Sy stem.Data.DataV iew dvData)
{
dvData.AllowNew = false;
dvData.AllowEdi t = false;
dvData.AllowDel ete = false;
this.dgStockMas terSummary.Colu mnHeadersVisibl e = false;
DataGridTableSt yle tableStyle = new DataGridTableSt yle();
tableStyle.Mapp ingName = "DVSummary" ;
DataGridTextBox Column textboxColStyle = null;
for(int i = 0; i<dvData.Table. Columns.Count; i++)
{
switch(dvData.T able.Columns[i].ColumnName)
{
case "Manufactur er":
textboxColStyle = new DataGridTextBox Column();
textboxColStyle .HeaderText = "Manufactur er";
textboxColStyle .MappingName = dvData.Table.Co lumns[i].ColumnName;
tableStyle.Grid ColumnStyles.Ad d(textboxColSty le);
textboxColStyle .Width = 128;
textboxColStyle .WidthChanged +=new
EventHandler(te xtboxColStyle_W idthChanged);
break;
case "Product Line":
textboxColStyle = new DataGridTextBox Column();
textboxColStyle .HeaderText = "Product Line";
textboxColStyle .Width = 178;
textboxColStyle .MappingName = dvData.Table.Co lumns[i].ColumnName;
tableStyle.Grid ColumnStyles.Ad d(textboxColSty le);
break;
case "Mill Name":
textboxColStyle = new DataGridTextBox Column();
textboxColStyle .HeaderText = "Mill Name";
textboxColStyle .Width = 177;
textboxColStyle .MappingName = dvData.Table.Co lumns[i].ColumnName;
tableStyle.Grid ColumnStyles.Ad d(textboxColSty le);
break;
case "Cost":
textboxColStyle = new DataGridTextBox Column();
textboxColStyle .HeaderText = "Cost";
textboxColStyle .Format = "C";
textboxColStyle .Alignment = System.Windows. Forms.Horizonta lAlignment.Righ t;
textboxColStyle .Width = 115;
textboxColStyle .MappingName = dvData.Table.Co lumns[i].ColumnName;
tableStyle.Grid ColumnStyles.Ad d(textboxColSty le);
break;
case "C&C Price":
textboxColStyle = new DataGridTextBox Column();
textboxColStyle .Format = "C";
textboxColStyle .Alignment = System.Windows. Forms.Horizonta lAlignment.Righ t;
textboxColStyle .Width = 115;
textboxColStyle .HeaderText = "C&C Price";
textboxColStyle .MappingName = dvData.Table.Co lumns[i].ColumnName;
tableStyle.Grid ColumnStyles.Ad d(textboxColSty le);
break;
case "Price":
textboxColStyle = new DataGridTextBox Column();
textboxColStyle .HeaderText = "Price";
textboxColStyle .Format = "C";
textboxColStyle .Alignment = System.Windows. Forms.Horizonta lAlignment.Righ t;
textboxColStyle .Width = 115;
textboxColStyle .MappingName = dvData.Table.Co lumns[i].ColumnName;
tableStyle.Grid ColumnStyles.Ad d(textboxColSty le);
break;
}
}
this.dgStockMas terSummary.Tabl eStyles.Clear() ;
this.dgStockMas terSummary.Tabl eStyles.Add(tab leStyle);
this.dgStockMas terSummary.RowH eadersVisible = false;
//this.dgStockMas terSummary.RowH eaderWidth = 10;
this.dgStockMas terSummary.Data Source = dvData;
}
"Ollie Riches" <ol**********@p honeanalyser.ne t> wrote in message
news:eE******** *****@TK2MSFTNG P12.phx.gbl...
It should work fine can you post the example code?
HTH
Ollie Riches
"Tim" <ti*@home.com > wrote in message
news:UJ******** ***********@new s20.bellglobal. com... Hi,
I am trying to hide the datagrid row header (the left most column that
has the 'select' triangle in it which moves with the selected row). It
seems to be fairly simple; this.dgStockMas terSummary.RowH eadersVisible =
false;
however it doesn't hide it. Hiding the column headers works just fine.
Does anyone have any ideas?
Tim