datagrid

  • Thread starter Thread starter Guest
  • Start date Start date
You need to apply a DataGridTableStyle

DataGridTableStyle tableStyle = new DataGridTableStyle("myTable")
DataGridTextBoxColumn colStyle = new DataGridTextBoxColumn()

colStyle.MappingName = "id_name"
colStyle.HeaderText = "firstname"

tableStyle.GridColumnStyles.Add(colStyle)

dataGrid1.TableStyles.Add(tabStyle);
 
Oops..

First line should be changed t

DataGridTableStyle tableStyle = new DataGridTableStyle()
tableStyle.MappingName = "myTable"

This is why I code in an IDE and not Internet Explorer :)
 
Do you know if it's possible to use different font for the headertext for different column? and how to achive that?

Thanks

Henry
 
The stock datagrid doesn't have that capability; you are limited to changing the font on all column headers at once

Your best bet would be to derive a control from datagrid and draw the headers yourself. You may also be able to find someone who has already done this. There is no shortage of customized datagrids floating around the internet, many of them for use without charge

Charlie
 
Back
Top