How can I get Button's ID to determine which one was clicked

Hello,

I'm working in a situation where I have a table that is dynamically built using a foreach loop.
In this table, each entry will have a button.
See code below



[Goal]
Each time a button is clicked, I need a way to identify which of the buttons was clicked.

[Comments]
When I try to use the "OnClick", it only presents MouseEventArgs that doesn't have any way to distinguish the button.
I think the ClickEventArgs might make more sense, but I can't find out how to use it with the EjsButton.

Does anyone have any suggestions how to achieve this?

Thanks,
Sorin

Attachment: TestPage_8fe59751.zip

2 Replies

SO Sorin February 27, 2020 12:11 PM UTC

Well I was able to answer my own question with help from a friend.
I will share the solution here in case it helps anyone else.
The trick is to use a lambda expression.




AD Arunkumar Devendiran Syncfusion Team February 27, 2020 03:15 PM UTC

Hi Sorin, 
 
Thanks for your update. 
 
Please get back to us if you need further assistance. 
 
Regards, 
Arunkumar D 


Loader.
Up arrow icon