Hello,
Can a put two or more images buttons into a cell? If is it possible how can I catch the click event for each button.
Now I'm using one column for each button, but some rows have one image button, others 2 and others 4, then I have a little mess in the table. My buttons are icons.
Thanks for your help,
Victor
Hi Mike,
Thank you very much.
Everything works perfect.
Thanks
Hi Victor,
Yes. :)
You can do this using an editor. Which editor you use depends on the column's DataType and how you approach this depends on your requirements.
In the simplest case, what you would do is create an UltraTextEditor control on the form with your grid. Then you use the ButtonsRight or ButtonsLeft collection to add buttons to the UltraTextEditor. You can assign text or an image to each button. You will also want to assign a Key to each button so you can identify which button is pressed.
Attach the editor to the grid column via the EditorComponent property of the column.
To handle the click, you handle the EditorButtonClick event of the UltraTextEditor control (not the grid). The e.Context parameter will return the grid cell for which the button was clicked.
If you need some columns with 2 buttons and some with 4, then you need to UltraTextEditors, one for each column that has the appropriate buttons.
If you need different buttons in different rows for the same column, then you can use the InitializeRow event and assign the appropriate UltraTextEditor to the Cell (instead of the Column).