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

mouse over hint on combo box

5 Answers 191 Views
ComboBox
This is a migrated thread and some comments may be shown as answers.
Kieran
Top achievements
Rank 1
Kieran asked on 01 Sep 2009, 12:42 PM
hi

is there any easy to implement a mouse over hint on a combo box that will display what the full text of the combo box is. The actual dropdown hint can be much wider than the combo box to deal with extra long strings and need to be able to show on mouse over what is in the combo box.

any ideas or pointers gratefully accepted. Don't want to have implement a bespoke javascript/dhtml solution if I can help it

5 Answers, 1 is accepted

Sort by
0
Valeri Hristov
Telerik team
answered on 02 Sep 2009, 04:01 PM
Hello Kieran,

You could add a tooltip on RadComboBox:
<telerik:RadComboBox ToolTipService.ToolTip="{Binding Text, RelativeSource={RelativeSource Self}}" ...>

The same will work in Silverlight too.

Greetings,
Valeri Hristov
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.
0
Kieran
Top achievements
Rank 1
answered on 02 Sep 2009, 08:46 PM
Hi

When I add that or any part of that I get told that the server tag is not well formed. Do you have a concrete example? what goes into the {".."}} part - the value of a field or is it a reference to the control?

thanks
0
Valeri Hristov
Telerik team
answered on 03 Sep 2009, 08:01 AM
Hi Kieran,

The ... are the rest of the control properties that you would want to set, they are irrelevant to the sample, that's why I didn't include them. As for the "not well formed" error - the sample is for Silverlight 3/WPF, I guess you are pasting the snippet in a ASP.NET page, hence the error. If you place the XAML into a WPF application it should work if you have the right references.

Here is the full sample:

<

 

Window x:Class="WpfApplication1.Window1" Title="Window1" 
    Height
="600" Width="600"
    xmlns=http://schemas.microsoft.com/winfx/2006/xaml/presentation
    xmlns:x=http://schemas.microsoft.com/winfx/2006/xaml
    xmlns:telerik="http://schemas.telerik.com/2008/xaml/presentation">
    <StackPanel x:Name="LayoutRoot" Background="White">
        <telerik:RadComboBox ToolTipService.ToolTip="{Binding Text, RelativeSource={RelativeSource Self}}">
            <telerik:RadComboBoxItem Content="item 1" />
            <telerik:RadComboBoxItem Content="item 2" />
            <telerik:RadComboBoxItem Content="item 3" />
        </telerik:RadComboBox>
    </StackPanel>
</
Window>

Kind regards,
Valeri Hristov
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.
0
Kieran
Top achievements
Rank 1
answered on 03 Sep 2009, 01:46 PM
Hi

I am still confused - what does the "{Binding Text, RelativeSource={RelativeSource Self}}" refer to? Can't figure this put or get bit work with things I have tried

Kieran
0
Valeri Hristov
Telerik team
answered on 03 Sep 2009, 01:53 PM
Hi Kieran,

This is a common WPF syntax for binding the values of properties - in this case the ToolTip attached property is bound to the Text property of RadComboBox - when the Text property changes, the ToolTip will also change. The RelativeSource part specifies the source of the binding, e.g. the object that contains the Text property, in this case Self means the element where the binding is applied to.

All the best,
Valeri Hristov
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.
Tags
ComboBox
Asked by
Kieran
Top achievements
Rank 1
Answers by
Valeri Hristov
Telerik team
Kieran
Top achievements
Rank 1
Share this question
or