Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
100
More than one image button into a Cell
posted

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

  • 469350
    Verified Answer
    Offline posted

    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).