This is a migrated thread and some comments may be shown as answers.

Customizing Drop Down

13 Answers 194 Views
MultiColumn ComboBox
This is a migrated thread and some comments may be shown as answers.
Binu
Top achievements
Rank 1
Binu asked on 03 Jun 2016, 12:17 PM

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

 

13 Answers, 1 is accepted

Sort by
0
Dimitar
Telerik team
answered on 08 Jun 2016, 08:44 AM
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.
0
Binu
Top achievements
Rank 1
answered on 08 Jun 2016, 09:04 AM

Hi Dimitar ,

thanks, we will check these options and get back.

0
Dimitar
Telerik team
answered on 10 Jun 2016, 06:30 AM
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.
0
Rashad
Top achievements
Rank 1
answered on 13 Jun 2016, 02:51 PM

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.

0
Dimitar
Telerik team
answered on 14 Jun 2016, 02:14 PM
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.
0
Rashad
Top achievements
Rank 1
answered on 14 Jun 2016, 02:32 PM

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

0
Dimitar
Telerik team
answered on 15 Jun 2016, 08:31 AM
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.
0
Rashad
Top achievements
Rank 1
answered on 15 Jun 2016, 09:56 AM

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

0
Dimitar
Telerik team
answered on 16 Jun 2016, 06:52 AM
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.
0
Rashad
Top achievements
Rank 1
answered on 30 Jun 2016, 06:08 AM

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.

0
Dimitar
Telerik team
answered on 30 Jun 2016, 08:53 AM
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.
0
Rashad
Top achievements
Rank 1
answered on 30 Nov 2016, 06:02 AM

Hi Dimitar,

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

0
Dimitar
Telerik team
answered on 30 Nov 2016, 07:57 AM
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.
Tags
MultiColumn ComboBox
Asked by
Binu
Top achievements
Rank 1
Answers by
Dimitar
Telerik team
Binu
Top achievements
Rank 1
Rashad
Top achievements
Rank 1
Share this question
or