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

horizontal scroll

6 Answers 38 Views
ComboBox
This is a migrated thread and some comments may be shown as answers.
iramz
Top achievements
Rank 1
iramz asked on 06 Apr 2010, 07:29 AM
hi,

how do i make the horizontal scroll show up in the drop down panel when the selection item is longer than the width of  the ComboBox control? Currently the panel just adjust its length making it longer than the actual control's length.

thank u!

6 Answers, 1 is accepted

Sort by
0
Konstantina
Telerik team
answered on 08 Apr 2010, 11:42 AM
Hello iramz,

Thank you for contacting us.

Attached you will find a sample project in which this is illustrated. I have set the Width property of the Grid which is in the Popup in order to fix the length of the items, because as you said, it adjusts its length.
Please mind for the "NOTE:" comments which indicate the place where changes have been made.

Let us know if you need further assistance.

All the best,
Konstantina
the Telerik team

Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
0
iramz
Top achievements
Rank 1
answered on 08 Apr 2010, 11:53 AM
great thanks. i somewhat get the idea. but for the grid area, say i want the width to be the same as the combobox instead of just setting it to 100? how do i do that? template binding?
0
Accepted
Konstantina
Telerik team
answered on 09 Apr 2010, 02:37 PM
Hello iramz,

Thank you for your question.

Attached you will find the sample project with some corrections made. Again, please mind for the "NOTE:" comments. Generally, this is not a recommended way of binding.

If you have further questions please feel free to ask again.

All the best,
Konstantina
the Telerik team

Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
0
iramz
Top achievements
Rank 1
answered on 12 Apr 2010, 04:34 AM
wow this works amazing! thank a lot solves my problem. just one last question though, not really good with using templates, but how can i still do this and the combobox still follow my theme? can i omit the hard coded values in your static resource?
0
iramz
Top achievements
Rank 1
answered on 12 Apr 2010, 09:08 AM

this worked for me.

public override void OnApplyTemplate()  
        {  
            AddHorizontalScrollToDropDownArea();      
            base.OnApplyTemplate();  
        }  
 
private void AddHorizontalScrollToDropDownArea()  
        {  
            Popup popup = GetTemplateChild("PART_Popup"as Popup;  
            FrameworkElement popupContent = popup.Child as FrameworkElement;  
            if (popupContent != null) popupContent.Width = this.Width;  
            ScrollViewer scrollViewer = GetTemplateChild("PART_ScrollViewer"as ScrollViewer;  
            if (scrollViewer != null) scrollViewer.HorizontalScrollBarVisibility = ScrollBarVisibility.Auto;  
        }  
   
   
         
0
Konstantina
Telerik team
answered on 14 Apr 2010, 02:13 PM
Hello iramz,

Glad that you have found solution yourself.

If you have any other questions please feel free to ask again.

Regards,
Konstantina
the Telerik team

Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
Tags
ComboBox
Asked by
iramz
Top achievements
Rank 1
Answers by
Konstantina
Telerik team
iramz
Top achievements
Rank 1
Share this question
or