CSD
October 11th, 2005, 06:56 PM
How do I add Buttons to a DataGrid? Keeping in mind that the DataGrid may have 5 records, 10 records or perhaps only 1 record.
I basically wish to add a column of buttons to any possible amount of records in a DataGrid.
Is this possible?
jhammer
October 16th, 2005, 04:55 AM
What you are trying to accomplish is quite difficult. Here is a link that might help:
http://www.codeproject.com/cs/miscctrl/WindowsDataGridColumns.asp
However the implementation there is with two images and not buttons.
I would recommend putting one button outside the grid, which correspond with the current selected row in the grid. This will be an easier user interface, more comfortable, prettier and less complex to create. You will also avoid the need for a dummy column in the table.
However, I may think of scenarios that I would prefer a column of buttons, but those are very rare.
CSD
October 16th, 2005, 05:19 PM
Thanks for that jhammer. I will go down the path of the button that corresponds to the selected row in the datagrid.