我想显示一个 DataGrid 控件,其中列标题可由用户编辑。这可能吗?
问问题
409 次
1 回答
0
Even though the default DataGrid doesn't provide the functionality, the workaround I used for this was to trap the click event of the column header and then use the InputBox() method to capture the new column header.
The InputBox was prepopulated with the default column header and then post validating the input string, i would update the header.
Please note, I am proposing a workaround to get the functionality baked in.
The InputBox()
is located in the Microsoft.VisualBasic.dll and can be accessed as follows:
Microsoft.VisualBasic.Interaction.InputBox()
with the following signature
InputBox(prompt[, title] [, default] [, xpos] [, ypos] [, helpfile, context])
Hope it helps!
于 2010-08-06T12:32:24.333 回答