RadpopupEditor associated control

6 posts, 0 answers
  1. Jessica
    Jessica avatar
    2 posts
    Member since:
    Apr 2014

    Posted 30 Nov 2015 Link to this post

    Can the associated control be set at runtime?
  2. Dimitar
    Admin
    Dimitar avatar
    1414 posts

    Posted 01 Dec 2015 Link to this post

    Hi Jessica,

    Thank you for writing.

    The AssociatedControl property can be set only at design time. For now you can set the associated control with the following code:
    private void radButton1_Click(object sender, EventArgs e)
    {
        this.radPopupEditor1.PopupEditorElement.PopupForm.Controls.Add(this.radPopupContainer1);
        var field = typeof(RadPopupContainerForm).GetField("panel", System.Reflection.BindingFlags.NonPublic | System.Reflection.BindingFlags.Instance);
        field.SetValue(this.radPopupEditor1.PopupEditorElement.PopupContainerForm, this.radPopupContainer1.PanelContainer);
     
        this.radPopupEditor1.PopupEditorElement.ShowPopup();
    }

    When the next official version is released you will be able to add the control with the following code:
    this.radPopupEditor1.SetAssociatedControlRuntime(editorContainer);

    Please let me know if there is something else I can help you with. 
     
    Regards,
    Dimitar
    Telerik

  3. UI for WinForms is Visual Studio 2017 Ready
  4. Daniel
    Daniel avatar
    6 posts
    Member since:
    Nov 2010

    Posted 24 Apr in reply to Dimitar Link to this post

    Hello, it would be possible to translate me this line code to vb please would appreciate is the only thing I'm missing

     

    var field = typeof(RadPopupContainerForm).GetField("panel", System.Reflection.BindingFlags.NonPublic | System.Reflection.BindingFlags.Instance)
  5. Dimitar
    Admin
    Dimitar avatar
    1414 posts

    Posted 25 Apr Link to this post

    Hi Daniel,

    Here is the line:
    Dim field = GetType(RadPopupContainerForm).GetField("panel", System.Reflection.BindingFlags.NonPublic Or System.Reflection.BindingFlags.Instance)

    You can use our free online converter for this: VB Converter.

    I hope this helps.

    Regards,
    Dimitar
    Telerik
    Do you need help with upgrading your AJAX, WPF or WinForms project? Check the Telerik API Analyzer and share your thoughts.
  6. Daniel
    Daniel avatar
    6 posts
    Member since:
    Nov 2010

    Posted 25 Apr in reply to Dimitar Link to this post

    Many thanks
  7. Daniel
    Daniel avatar
    6 posts
    Member since:
    Nov 2010

    Posted 25 Apr in reply to Dimitar Link to this post

    Many thanks
Back to Top
UI for WinForms is Visual Studio 2017 Ready