Is there any way to edit column names in a DataGridView?
相关问题
- Sorting 3 numbers without branching [closed]
- Graphics.DrawImage() - Throws out of memory except
- Why am I getting UnauthorizedAccessException on th
- 求获取指定qq 资料的方法
- How to know full paths to DLL's from .csproj f
You can edit the header directly:
And so on for as many columns you have.
I guess what you want is to edit the HeaderText property of the column:
Source: http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=186908&SiteID=1
Try this
I don't think there is a way to do it without writing custom code. I'd implement a ColumnHeaderDoubleClick event handler, and create a TextBox control right on top of the column header.
You can also change the column name by using:
but the
myDataGrid
will need to have been bound to aDataSource
.You can also edit directly without knowing anything as posted above :