This is a migrated thread and some comments may be shown as answers.
is it possiable to show only image in radsplitbutton for dropdown
1 Answer 9 Views
This is a migrated thread and some comments may be shown as answers.
kyunghwan
Top achievements
Rank 1
kyunghwan asked on 15 Dec 2017, 08:07 AM

hello, i have trouble to develop application using telerik ui.

 

i add component as Radsplitbutton to my app,  insert to menuitem some icon, and change property TextimageRelation = overlay, Displaystyle=image.

 

as shown image i did upload, it is done well. but i want remove blank area and only show image.

 

which property should i change?

 

help me please.

1 Answer, 1 is accepted

Sort by
0
Hristo
Telerik team
answered on 15 Dec 2017, 12:23 PM
Hello,

You can achieve your task by setting the MaximumSize property of the drop-down menu element. While looking into this kind of setup I also managed to isolate an issue with the horizontal scrollbar which is displayed although it will not be needed.

I have logged the issue on our feedback portal, here: https://feedback.telerik.com/Project/154/Feedback/Details/239091-fix-radsplitbutton-the-horizontal-scrollbar-is-isible-although-not-needed-whe. I have updated your Telerik points for the report. Additionally, you can subscribe to the item and be updated when its status changes.

You can work around it by setting the Visibility property of the scrollbar element to Collapsed and by canceling its RadPropertyChanging event: 
public partial class RadForm1 : Telerik.WinControls.UI.RadForm
{
    public RadForm1()
    {
        InitializeComponent();
 
        this.radSplitButton1.DropDownButtonElement.DropDownMenu.MaximumSize = new Size(30, 0);
        RadScrollBarElement element = this.radSplitButton1.DropDownButtonElement.DropDownMenu.PopupElement.FindDescendant<RadScrollBarElement>();
        element.Visibility = Telerik.WinControls.ElementVisibility.Collapsed;
        element.RadPropertyChanging += Element_RadPropertyChanging;
    }
 
    private void Element_RadPropertyChanging(object sender, Telerik.WinControls.RadPropertyChangingEventArgs args)
    {
        if (args.Property.Name == "Visibility")
        {
            args.Cancel = true;
        }
    }
}

I am also attaching my test project demonstrating the suggested solution.

I hope this helps. Let me know if you need further assistance.

Regards,
Hristo
Progress Telerik
Try our brand new, jQuery-free Angular components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
Asked by
kyunghwan
Top achievements
Rank 1
Answers by
Hristo
Telerik team
Share this question
or