identify button

2 posts, 0 answers
  1. jojo
    jojo avatar
    1 posts
    Member since:
    Nov 2007

    Posted 29 Nov 2007 Link to this post

    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)

  2. Nikolay
    Nikolay avatar
    1802 posts

    Posted 30 Nov 2007 Link to this post

    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,
    the Telerik team

    Instantly find answers to your questions at the new Telerik Support Center
  3. DevCraft banner
Back to Top