mouse over hint on combo box

6 posts, 0 answers
  1. Kieran
    Kieran avatar
    23 posts
    Member since:
    Feb 2009

    Posted 01 Sep 2009 Link to this post

    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
  2. Valeri Hristov
    Admin
    Valeri Hristov avatar
    2252 posts

    Posted 02 Sep 2009 Link to this post

    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.
  3. UI for WPF is Visual Studio 2017 Ready
  4. Kieran
    Kieran avatar
    23 posts
    Member since:
    Feb 2009

    Posted 02 Sep 2009 Link to this post

    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
  5. Valeri Hristov
    Admin
    Valeri Hristov avatar
    2252 posts

    Posted 03 Sep 2009 Link to this post

    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.
  6. Kieran
    Kieran avatar
    23 posts
    Member since:
    Feb 2009

    Posted 03 Sep 2009 Link to this post

    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
  7. Valeri Hristov
    Admin
    Valeri Hristov avatar
    2252 posts

    Posted 03 Sep 2009 Link to this post

    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.
Back to Top
UI for WPF is Visual Studio 2017 Ready