Skip to main content
Solved

How to dynamically enable and disable action button in the grid toolbar based on a field value.

  • December 16, 2024
  • 3 replies
  • 73 views

Forum|alt.badge.img

There is a requirement to dynamically enable and disable an action button in the grid toolbar based on a column value in the grid. If there are multiple lines in the grid, the action button should be enabled for some lines and disabled for others.

How can I implement this?
Any detailed instructions, tips, or code snippets would be greatly appreciated. Thank you!

Best answer by aiwan

Hi ​@RKarunarathne51 

 

You could use a RowSelected handler for the header DAC and use a ResultSet<> for your child DAC.

 

You would need to use a foreach statement to make sure you iterate through the results of the query.

 

Aleks

View original
Did this topic help you find an answer to your question?

3 replies

jinin
Pro I
Forum|alt.badge.img+11
  • Pro I
  • 693 replies
  • December 16, 2024

Forum|alt.badge.img

Hi ​@jinin ,

I tried using the articles mentioned above, but it’s not working correctly. I used the RowSelected event handler to SetEnable the action button. It works correctly only for the first row of the grid. The RowSelected event is triggered only for the first line of the grid. As a result, the other rows display the action button based on the value of the first row, rather than their own values.


Forum|alt.badge.img+8
  • Captain II
  • 362 replies
  • Answer
  • December 17, 2024

Hi ​@RKarunarathne51 

 

You could use a RowSelected handler for the header DAC and use a ResultSet<> for your child DAC.

 

You would need to use a foreach statement to make sure you iterate through the results of the query.

 

Aleks


Reply


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings