Customizing Drop Down

14 posts, 0 answers
  1. Binu
    Binu  avatar
    8 posts
    Member since:
    Apr 2012

    Posted 03 Jun Link to this post

    In my RadMultiColumnCombobox. I have added two buttons to the  EditorControl's GridView area( image 2) . i want to add controls above and below of the radgridview. Also how to change the radgridview's header text color and  background as well as alternate row background like the image given below.( image 1).

    Please help

     

  2. Dimitar
    Admin
    Dimitar avatar
    1411 posts

    Posted 08 Jun Link to this post

    Hello Binu,

    Thank you for writing.

    In this case, the grid and the sizing grip are added to a DockLayoutPanel. So to add other elements you need to override the CreatePopupForm method and insert the new items. Please note that the items should be inserted in the first position and you need to set their Dock property. For example:
    class MyMCCB : RadMultiColumnComboBox
    {
        protected override RadMultiColumnComboBoxElement CreateMultiColumnComboBoxElement()
        {
            return new MyMCCBElemnt();
        }
        public override string ThemeName
        {
            get
            {
                return typeof(RadMultiColumnComboBox).FullName;
            }
        }
    }
    class MyMCCBElemnt : RadMultiColumnComboBoxElement
    {
        protected override Type ThemeEffectiveType
        {
            get
            {
                return typeof(RadMultiColumnComboBoxElement);
            }
        }
        protected override RadPopupControlBase CreatePopupForm()
        {
            var form = base.CreatePopupForm() as MultiColumnComboPopupForm;
     
            StackLayoutElement stack = new StackLayoutElement();
     
            stack.Orientation = Orientation.Horizontal;
     
            RadButtonElement button1 = new RadButtonElement();
            button1.Text = "Button1";
            button1.StretchHorizontally = false;
            button1.StretchVertically = false;
     
            RadButtonElement button2 = new RadButtonElement();
            button2.Text = "Button2";
            button2.StretchHorizontally = false;
            button2.StretchVertically = false;
     
            stack.Children.Add(button1);
            stack.Children.Add(button2);
     
            DockLayoutPanel.SetDock(stack, Telerik.WinControls.Layouts.Dock.Top);
     
     
            form.SizingGripDockLayout.Children.Insert(0, stack);
     
            return form;
        }
     
    }

    Detailed information about how you can build controls with TPF is available in the following articles:
    Another approach would be to use the PopupEditor control.

    I hope this will be useful. 

    Regards,
    Dimitar
    Telerik
    Check out the Windows Forms project converter, which aids the conversion process from standard Windows Forms applications written in C# or VB to Telerik UI for WinForms.For more information check out this blog post and share your thoughts.
  3. UI for WinForms is Visual Studio 2017 Ready
  4. Binu
    Binu  avatar
    8 posts
    Member since:
    Apr 2012

    Posted 08 Jun in reply to Dimitar Link to this post

    Hi Dimitar ,

    thanks, we will check these options and get back.

  5. Dimitar
    Admin
    Dimitar avatar
    1411 posts

    Posted 10 Jun Link to this post

    Hello Binu,

    Take all the time you need to examine this and do not hesitate to contact us if you have further questions.

    Regards,
    Dimitar
    Telerik
    Check out the Windows Forms project converter, which aids the conversion process from standard Windows Forms applications written in C# or VB to Telerik UI for WinForms.For more information check out this blog post and share your thoughts.
  6. Rashad
    Rashad avatar
    6 posts
    Member since:
    Oct 2013

    Posted 13 Jun in reply to Dimitar Link to this post

    Hi Dimitar,

    I want to change the RadButtonElement's style inside the StackLayoutElement.  I tried to change its properties and it is not reflecting in the button.Please help me.

  7. Dimitar
    Admin
    Dimitar avatar
    1411 posts

    Posted 14 Jun Link to this post

    Hello Binu,

    Thank you for writing back.

    Could you please specify which properties you want to change? This way I will be able to provide you with the proper solution.

    I am looking forward to your reply.

    Regards,
    Dimitar
    Telerik
    Check out the Windows Forms project converter, which aids the conversion process from standard Windows Forms applications written in C# or VB to Telerik UI for WinForms.For more information check out this blog post and share your thoughts.
  8. Rashad
    Rashad avatar
    6 posts
    Member since:
    Oct 2013

    Posted 14 Jun Link to this post

    Hi Dimitar,

    This is how the combobox (See the image dropdown) look like now. I want to change the close button's style. Changing style not reflecting on the button. Please help me.

    Thanks,

    Rashad

  9. Dimitar
    Admin
    Dimitar avatar
    1411 posts

    Posted 15 Jun Link to this post

    Hello Rashad,

    Thank you for writing back.

    You cannot change the theme of a single element, in this case, you need to manually change the styles. For example:
    RadButtonElement button1 = new RadButtonElement();
    button1.Text = "Button1";
    button1.StretchHorizontally = false;
    button1.StretchVertically = false;
    button1.ButtonFillElement.BackColor = Color.Blue;
    button1.ButtonFillElement.GradientStyle = GradientStyles.Solid;
    button1.ForeColor = Color.Red;

    Let me know if I can assist you further.

    Regards,
    Dimitar
    Telerik
    Check out the Windows Forms project converter, which aids the conversion process from standard Windows Forms applications written in C# or VB to Telerik UI for WinForms.For more information check out this blog post and share your thoughts.
  10. Rashad
    Rashad avatar
    6 posts
    Member since:
    Oct 2013

    Posted 15 Jun in reply to Dimitar Link to this post

    Hi Dimitar,

    Thank you for your response. I tried the above code and still I cannot not change the background or foreground color. The button theme is same as 'office2007Silver' theme. What may be the reason, Am I missing anything.

    Thanks,

    Rashad

  11. Dimitar
    Admin
    Dimitar avatar
    1411 posts

    Posted 16 Jun Link to this post

    Hi Rashad,

    Thank you for writing back.

    Without examining your project I cannot say why this is not working on your side. This is why I would suggest you to post a support ticket. This way you can attach your project and we will be able to examine it and determine why the styles are not applied. 

    Should you have any other questions do not hesitate to ask.

    Regards,
    Dimitar
    Telerik
    Check out the Windows Forms project converter, which aids the conversion process from standard Windows Forms applications written in C# or VB to Telerik UI for WinForms.For more information check out this blog post and share your thoughts.
  12. Rashad
    Rashad avatar
    6 posts
    Member since:
    Oct 2013

    Posted 30 Jun in reply to Dimitar Link to this post

    Hi Dimitar,

    I need one more help. In my multicolumncombobox I feel difficult to scroll the grid. It is like deferred scrolling. I checked with changing the scroll mode using the below code.

    this.MultiColumnComboBoxElement.EditorControl.TableElement.RowScroller.ScrollMode = ItemScrollerScrollModes.Smooth;

    but it seems not working. Still it scrolls like deferred. Please help me.

  13. Dimitar
    Admin
    Dimitar avatar
    1411 posts

    Posted 30 Jun Link to this post

    Hi Rashad,

    Thank you for writing.

    This is controlled by the EnableFastScrolling property:
    myMCCB1.EditorControl.EnableFastScrolling = false;

    Please let me know if there is something else I can help you with. 
     
    Regards,
    Dimitar
    Telerik
    Check out the Windows Forms project converter, which aids the conversion process from standard Windows Forms applications written in C# or VB to Telerik UI for WinForms.For more information check out this blog post and share your thoughts.
  14. Rashad
    Rashad avatar
    6 posts
    Member since:
    Oct 2013

    Posted 30 Nov Link to this post

    Hi Dimitar,

    I want to get the scroll event for MultiColumnComboBox. How to catch the scroll event when the EditorControl(RadGridView) is scrolled.

  15. Dimitar
    Admin
    Dimitar avatar
    1411 posts

    Posted 30 Nov Link to this post

    Hi Rashad,

    You can use the CellEditorInitialized event to access the editor:
    private void RadGridView1_CellEditorInitialized(object sender, GridViewCellEventArgs e)
    {
        if (e.ActiveEditor is RadMultiColumnComboBoxElement)
        {
            var editor = e.ActiveEditor as RadMultiColumnComboBoxElement;
            editor.EditorControl.TableElement.VScrollBar.Scroll -= VScrollBar_Scroll;
            editor.EditorControl.TableElement.VScrollBar.Scroll += VScrollBar_Scroll;
     
        }
     
    }
     
    private void VScrollBar_Scroll(object sender, ScrollEventArgs e)
    {
         
    }

    I hope this will be useful. 

    Regards,
    Dimitar
    Telerik by Progress
    Telerik UI for WinForms is ready for Visual Studio 2017 RC! Learn more.
Back to Top
UI for WinForms is Visual Studio 2017 Ready