This is a migrated thread and some comments may be shown as answers.
identify button
1 Answer 22 Views
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
jojo
Top achievements
Rank 1
jojo asked on 29 Nov 2007, 02:52 PM
i have insert 3 radbuttonelement in my radtoolstrip
the click event is the same for all buttons
and i want identify each button
but i can't get their name

==> switch (((RadButtonElement)sender).Name)


why?

1 Answer, 1 is accepted

Sort by
0
Nikolay
Telerik team
answered on 30 Nov 2007, 02:07 PM
Hello jojo,

RadButtonElement does not have a Name property in its API. The Name value you set is only for its instance name. Still, you can identify which button is clicked by comparing RadButtonElements in your Click event handler. Please refer to the following snippet:

RadButtonElement buttonClicked = sender as RadButtonElement;        
       
if (button1 == buttonClicked)        
{        
// An action when the first button is clicked        
}        
if (button2 == buttonClicked)        
{        
// An action when the second button is clicked        
}       
 

Do not hesitate to contact us, if you have further questions.

 
Best wishes,
Nikolay
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
Asked by
jojo
Top achievements
Rank 1
Answers by
Nikolay
Telerik team
Share this question
or