This question is locked. New answers and comments are not allowed.
I would like to know what is the best practice to do the following:
The columns are generated runtime. (easily done from previous examples I've seen - just set "AutoGenerateColumns" to false, and then add columns of type GridViewDataColumn to the columns collection.
But, I would also like to add columns at runtime that have custom CellEditTemplates - how would I go about this?
ex.: I want my grid to bind to a collection of StaffMember objects.
The columns need to be added at runtime to the grid, and, for the "Age" property, I would
like the CellEditTemplate to be a NumericUpDown Control.
Ideally, I would have liked to implement my own GridViewNumericColumn that inherits from GridViewDataColumn,
and override the CellEditTemplate to use the NumericUpDownControl.
I could then add this column to the grid.Columns collection at runtime.
2nd prize would just to create a new GridViewDataColumn, set the CellEditTemplate to the NumericUpDown control, and then add the column to the Columns collection.
The columns are generated runtime. (easily done from previous examples I've seen - just set "AutoGenerateColumns" to false, and then add columns of type GridViewDataColumn to the columns collection.
But, I would also like to add columns at runtime that have custom CellEditTemplates - how would I go about this?
ex.: I want my grid to bind to a collection of StaffMember objects.
The columns need to be added at runtime to the grid, and, for the "Age" property, I would
like the CellEditTemplate to be a NumericUpDown Control.
Ideally, I would have liked to implement my own GridViewNumericColumn that inherits from GridViewDataColumn,
and override the CellEditTemplate to use the NumericUpDownControl.
I could then add this column to the grid.Columns collection at runtime.
2nd prize would just to create a new GridViewDataColumn, set the CellEditTemplate to the NumericUpDown control, and then add the column to the Columns collection.