Hallo
Can anybody tell me how to change the column name of a DataGrid Column, Not in Asp .Net, but in Windows Based. Please.
They said that i should try the following, but it does not work.
Suppose your datagrid is dgEmployees
Dim dgTS As New DataGridTableStyle
Dim ColStyle As New DataGridTextBoxColumn
ColStyle.MappingName = "Emp_Name"
ColStyle.HeaderText = "Employee Name"
dgTS.GridColumnStyles.Add(ColStyle)
dgEmployees.TableStyles.Add(dgTS)
VB.Net! Damn DataGrid Column Names!
Well I usually create a datatable and then datacolumns and then assign the datatable to the datagrid and the column names pass through
eg
dim tbl as datatable
dim col1 as datacolumn
dim col2 as datacolumn
col1.columnname = "Column1"
col1.caption = "Column1"
col2.columnname = "Column2"
col2.caption = "Column2"
tbl.columns.add(col1)
tbl.columns.add(col2)
datagrid1.datasource = tbl
but thats just me...I'm no .net programmer though, just a database programmer
eg
dim tbl as datatable
dim col1 as datacolumn
dim col2 as datacolumn
col1.columnname = "Column1"
col1.caption = "Column1"
col2.columnname = "Column2"
col2.caption = "Column2"
tbl.columns.add(col1)
tbl.columns.add(col2)
datagrid1.datasource = tbl
but thats just me...I'm no .net programmer though, just a database programmer