RadMaskedEditBoxElement in ribbonBar

2 posts, 1 answers
  1. Iason Demiros
    Iason Demiros avatar
    6 posts
    Member since:
    Nov 2007

    Posted 11 Jan 2010 Link to this post

    Hi,
    I am trying to add a RadMaskedEditBoxElement in RadRibbonBarButtonGroup on the ribbonBar. I am fine with adding it but when i am trying to set the mask value , the mask does not exists. All the properties of the RadMaskedEditBoxElement are like  radtextbox. On the other hand when i am adding the RadMaskedEditBoxElement on winform it works perfectly.

    I tried to add the RadMaskedEditBoxElement from the code with a host element , nothing.

    Can you help me ?
  2. Answer
    Deyan
    Admin
    Deyan avatar
    2039 posts

    Posted 14 Jan 2010 Link to this post

    Hi Iason,

    Thanks for contacting us and for your question. Please check the following code snippet:
    RadMaskedEditBox maskTextBox = new RadMaskedEditBox();
    maskTextBox.Mask = "T";
    maskTextBox.MaskType = MaskType.DateTime;
    maskTextBox.Size = new Size(120, 20);
    RadHostItem hostItem = new RadHostItem(maskTextBox);
    hostItem.StretchHorizontally = false;
    hostItem.StretchVertically = false;
    this.radRibbonBarButtonGroup1.Items.Add(hostItem);

    I am using the RadHostItem approach to add a RadMaskedEditBox to a RadRibbonBarButtonGroup. As you can see, I explicitly define the size of the masked edit box and I also turn off StretchHorizontally and StretchVertically properties of RadHostItem so that it can be resized according to the control host.

    I hope this helps. Do not hesitate to write back anytime you need assistance.

    Greetings,

    Deyan
    the Telerik team


    Instantly find answers to your questions on the new Telerik Support Portal.
    Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
  3. UI for WinForms is Visual Studio 2017 Ready
Back to Top