开发者

Editable Column headers for WinForms DataGrid Control?

I'd like t开发者_JS百科o display a DataGrid control where the column headers are editable by the user. Is this possible?


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!

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜