I often have the need to display a list of items and have actions for them. The “action”-button should be disabled by default unless I have selected one of the items in the grid. I thought I could solve it by handling the event “RowSelected” and then have a “set property” type and use something like this: Name=${button0.Disabled} with Value=True. But this doesn’t work.
What could I use instead?
Thanks, Markus
1 Like
Hi @YnotBetter,
Do you want to have only one button enabled at a time (the one belonging to the selected row)? If yes you can try something like this:
- Set a page property e.g. ‘selectedID’ to null
- Set the Disabled property of the button to
${data.ID != selectedID}
- In the RowSelected event set the selectedID property to
${event.ID}
Replace ID with some property which uniquely identifies a data item from the DataGrid.
What this should do is enable only the button corresponding to the currently selected data item.