RadButton DialogResult does not work

4 posts, 1 answers
  1. ManniAT
    ManniAT avatar
    877 posts
    Member since:
    Nov 2003

    Posted 28 May 2008 Link to this post

    Hi,

    I created a simple dialg with a "Yes" and a "No" Button (Forms.Button).
    As Dialog Result i set the Values Yes and No to the buttons.

    Clicking the buttons closes the Dialog with the expected resutl.

    When I use RadButton instead the dialog does NOT close!!!

    Of course I can add a handler wiht
    DialogResul=....

    But the RadButton has a different behavior to the Forms.Button or in other words:
    The porperty "DialogResult" has no effect.

    Regards

    Manfred
  2. Answer
    Martin Vasilev
    Admin
    Martin Vasilev avatar
    1061 posts

    Posted 30 May 2008 Link to this post

    Hi Manfred Pohler,

    Thank you for writing.

    We are aware of the RadButton and DialogResult issue. We will address it in one of our future releases.
    Currently, you could achieve the desired behavior by using the button Click event. Please consult the code-block below:

    private void radOKButton_Click(object sender, EventArgs e)   
    {   
        Form currentForm = radOKButton.FindForm();   
        currentForm.DialogResult = DialogResult.OK; 
        currentForm.Close();   
    }  

    I hope this helps. If you have other questions, do not hesitate to contact me again.

    Kind regards,
    Martin Vasilev
    the Telerik team

    Instantly find answers to your questions at the new Telerik Support Center
  3. UI for WinForms is Visual Studio 2017 Ready
  4. ManniAT
    ManniAT avatar
    877 posts
    Member since:
    Nov 2003

    Posted 30 May 2008 Link to this post

    Hi,

    thanks for the answer.
    The reason for my post was to inform you about this bug.

    And the solution (workaround) is simply place
    DialogResult=DialogResult.No;
    into the button handler.

    Im'n not sure why you need three lines of code :)

    Anyhow - this problem seems to be introduced with Q1 release.
    Which means - I have to completely review an app since a lot of dialog no longer take care of "ESC" button and so on.

    Regards

    Manfred
  5. Kiril
    Admin
    Kiril avatar
    158 posts

    Posted 30 May 2008 Link to this post

    Hi Manfred Pohler,

    Thank you for bringing our attention to this issue and for sharing your solution with the community.

    We will address this issue as soon as we can.

    Your Telerik points have been updated.

    Regards,
    Kiril
    the Telerik team

    Instantly find answers to your questions at the new Telerik Support Center
Back to Top