The default column name is set to the name coming from your DB. If you want to change it to something else then you can use the this:
Assume DataGrid name as 'dg', 'Emp_name' is default from DB, 'Employee Name' as custom name.
Code:
Dim dgTS As New DataGridTableStyle
Dim ColStyle As New DataGridTextBoxColumn
ColStyle.MappingName = "Emp_name"
ColStyle.HeaderText = "Employee Name"
dgTS.GridColumnStyles.Add(ColStyle)
dg.TableStyles.Add(dgTS)
You can do this at design time also so that you can specify all the fields as per your order.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.