Set Default Button

2 posts, 0 answers
  1. Frustrated Dev
    Frustrated Dev avatar
    35 posts
    Member since:
    Oct 2006

    Posted 20 Feb 2010 Link to this post

    Hello,

    I am using the RadWindow to display dialogs in my application. Is there a way to set the default button in the dialog? If so, how?

    For instance, I have an "ok" and a "cancel" button. If a user hits "enter" on their keyboard, I would automatically like to "click" the "ok" button.

    Thank you,
  2. Hristo Borisov
    Admin
    Hristo Borisov avatar
    298 posts

    Posted 22 Feb 2010 Link to this post

    Hello Paranoid Andriod,

    Yes, you can specify the default behavior of a button in your RadWindow control. You just have to set the attached property RadWindow.ResponseButton that defines what type of action you want it to perform. The ResponseButton property has two enum values, Accept and Cancel. If the user hits the enter keyboard button, the button in your RadWindow which has ResponseButton="Accept" will be clicked. The same goes for the Cancel value, and the ESC keyboard button. We have an article explaining in details how to achieve the behavior here - Use keyboard to get user response with RadWindow .

    If you have any further questions, please get back to us immediately.

    All the best,
    Hristo Borisov
    the Telerik team

    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
  3. DevCraft banner
Back to Top