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

RadCombo ToolTip on Hover of Items

1 Answer 108 Views
ComboBox
This is a migrated thread and some comments may be shown as answers.
Alex Odago
Top achievements
Rank 1
Alex Odago asked on 14 May 2010, 03:00 PM
Hi...I am trying to have a tooltip display whenever I hover over the items of a radCombo.
I have done some of the work so far using an Item template, but I only know how to show either the DataTextField or dataValueField , yet the tooltip I want to show is a different field that I pull from the same table as per my query below. I want to show the suburb as my tooltip on hover.
Below is the SQL Query and binding to radcombo:
string AreasQuery = "select AreaID as AreaID,AreaName as AreaName,Suburbs as Suburbs from area order by AreaName ";
dtAreas = dbo.sqldb_select(AreasQuery, 1);
cmbAreas.DataTextField = "AreaName";
cmbAreas.DataValueField = "AreaID";

AreaID is my datavalueField and AreaName is my DataTextField.
Below is my aspx code , and I have also attached a screen shot of how this currently looks at the moment. I just dont know how to bring the Suburb Field into my ItemTemplate...maybe an attribute, but I am not sure how to use that. Kindly assist.

<td align="left" class="style11" valign="middle" bgcolor="#CC3300">
  <telerik:RadComboBox ID="cmbAreas"  Runat="server" Height="150px" MarkFirstMatch="True" 
  Skin="Hay" Width="236px" DataTextField="AreaName" DataValueField="AreaID">
  <ItemTemplate> 
        <asp:Label runat="server" ID="Label1" Text='<%# Eval("AreaName")%>' ></asp:Label> 
        <telerik:RadToolTip ID="RadToolTip1" runat="server" Width="100" Height="10" TargetControlID="Label1" Position="BottomRight" Text='<%# Eval("AreaName")%>' >
        </telerik:RadToolTip> 
  </ItemTemplate> 
  </telerik:RadComboBox>
</td>


1 Answer, 1 is accepted

Sort by
0
Alex Odago
Top achievements
Rank 1
answered on 14 May 2010, 04:45 PM
Fixed with assistance from a previous post on the Telerik radCombo forum.
Below is my solution:

C# Code
------------------------------------

string AreasQuery = "select AreaID as AreaID,AreaName as AreaName,Suburbs as Suburbs from area order by AreaName ";
dtAreas = dbo.sqldb_select(AreasQuery, 1);
cmbAreas.DataTextField = "AreaName";
cmbAreas.DataValueField = "AreaID";

ASPX File
--------------------------------- 

<td align="left" class="style11" valign="middle" bgcolor="#CC3300">
                <telerik:RadComboBox ID="cmbAreas"  Runat="server"
                    Height="150px" 
                    Skin="Sunset" Width="236px" DataTextField="AreaName"
                    DataValueField="AreaID" >
                    <ItemTemplate> 
                    <asp:Label runat="server" ID="Label1"  Text='<%# Eval("AreaName")%>' ></asp:Label> 
                    <telerik:RadToolTip ID="RadToolTip1" runat="server" Width="300" Height="100"  TargetControlID="Label1" Position="BottomRight" Text='<%# DataBinder.Eval(Container.DataItem, "Suburbs") %>' >
                    </telerik:RadToolTip> 
  </ItemTemplate>
                    

                </telerik:RadComboBox>
            </td>

Tags
ComboBox
Asked by
Alex Odago
Top achievements
Rank 1
Answers by
Alex Odago
Top achievements
Rank 1
Share this question
or