views:

11

answers:

1

Hi all,

I'd like to display a DataGrid control where the column headers are editable by the user. Is this possible?

A: 

Hi,

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!

Vaibhav