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

[Solved] RadGrid tooltip

1 Answer 296 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Tony Abou-Akl
Top achievements
Rank 1
Tony Abou-Akl asked on 04 Aug 2009, 06:22 PM
Hi there

For some reason the tooltip on telerik:GridButtonColumn and on telerik:GridEditCommandColumn
do not show, is there something i need to do for it to show thanks

here is my code

<

 

telerik:RadGrid ID="radCategory" runat="server" DataSourceID="dsCategory"

 

 

 

Skin="Vista" GridLines="None" Width="700px" Height="500px"

 

 

 

AllowFilteringByColumn="True" AllowPaging="True" AllowSorting="True">

 

 

 

<GroupingSettings CaseSensitive="false" />

 

 

 

<MasterTableView AutoGenerateColumns="False" DataSourceID="dsCategory" EditMode="InPlace"

 

 

 

CommandItemDisplay ="Top" AllowAutomaticUpdates="true" DataKeyNames="CategoryId"

 

 

 

AllowAutomaticInserts="true" AllowAutomaticDeletes="true">

 

 

 

<CommandItemTemplate>

 

 

 

<div style="padding:10px 0px;">Course Category&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;

 

 

 

<asp:LinkButton ID="lnkAddNew" runat="server" CommandName="InitInsert" Visible="True">

 

 

 

<img style="border:0px;vertical-align:middle;" alt="" src="../Images/add.gif" /> Add new Category</asp:LinkButton>&nbsp;&nbsp;

 

 

 

<asp:LinkButton ID="lnkExportExcel" runat="server" CommandName="ExporttoExcel" >

 

 

 

<img style="border:0px;vertical-align:middle;" alt="" src="../Images/Excel.gif" /> Export To Excel </asp:LinkButton>&nbsp;&nbsp;

 

 

 

<asp:LinkButton ID="lnkExportWord" runat="server" CommandName="ExporttoWord" >

 

 

 

<img style="border:0px;vertical-align:middle;" alt="" src="../Images/Word.gif" /> Export To Word </asp:LinkButton>&nbsp;&nbsp;

 

 

 

<asp:LinkButton ID="lnkRefresh" runat="server" CommandName="RebindGrid">

 

 

 

<img style="border:0px;vertical-align:middle;" alt="" src="../Images/Refresh.gif" /> Refresh</asp:LinkButton>

 

 

 

</div>

 

 

 

</CommandItemTemplate>

 

 

 

<RowIndicatorColumn>

 

 

 

<HeaderStyle Width="20px"></HeaderStyle>

 

 

 

</RowIndicatorColumn>

 

 

 

<ExpandCollapseColumn>

 

 

 

<HeaderStyle Width="20px"></HeaderStyle>

 

 

 

</ExpandCollapseColumn>

 

 

 

<Columns>

 

 

 

<telerik:GridBoundColumn DataField="CategoryId" DataType="System.Guid"

 

 

 

EmptyDataText="&amp;nbsp;" HeaderText="CategoryId" SortExpression="CategoryId"

 

 

 

UniqueName="CategoryId" ReadOnly="true" Visible="False">

 

 

 

</telerik:GridBoundColumn>

 

 

 

<telerik:GridBoundColumn DataField="Name" EmptyDataText="&amp;nbsp;"

 

 

 

HeaderText="Name" SortExpression="Name" UniqueName="Name" CurrentFilterFunction="Contains" AutoPostBackOnFilter="true">

 

 

 

</telerik:GridBoundColumn>

 

 

 

<telerik:GridBoundColumn DataField="Description" EmptyDataText="&amp;nbsp;"

 

 

 

HeaderText="Description" SortExpression="Description" UniqueName="Description" CurrentFilterFunction="Contains" AutoPostBackOnFilter="true">

 

 

 

</telerik:GridBoundColumn>

 

 

 

<telerik:GridButtonColumn ConfirmText="Delete this product?" ConfirmDialogType="RadWindow" ConfirmTitle="Delete" ButtonType="ImageButton"

 

 

 

CommandName="Delete" Text="Delete" UniqueName="DeleteColumn">

 

 

 

<HeaderStyle Width="20px" />

 

 

 

<ItemStyle HorizontalAlign="Center" CssClass="MyImageButton" />

 

 

 

</telerik:GridButtonColumn>

 

 

 

<telerik:GridEditCommandColumn ButtonType="ImageButton" UniqueName="EditCommandColumn" >

 

 

 

<ItemStyle CssClass="MyImageButton" />

 

 

 

</telerik:GridEditCommandColumn>

 

 

 

</Columns>

 

 

 

</MasterTableView>

 

 

 

<ClientSettings AllowColumnsReorder="True" ReorderColumnsOnClient="True">

 

 

 

<Selecting AllowRowSelect="True" />

 

 

 

</ClientSettings>

 

 

 

<FilterMenu EnableTheming="True">

 

 

 

<CollapseAnimation Type="OutQuint" Duration="200"></CollapseAnimation>

 

 

 

</FilterMenu>

 

 

 

</telerik:RadGrid>

 

 

1 Answer, 1 is accepted

Sort by
0
Princy
Top achievements
Rank 2
answered on 05 Aug 2009, 06:55 AM
Hi Tony,

From  the above given aspx code I can see that you have set the ButtonType property to ImageButton. Once you have the ImageButton in the Edit/Button Column, the value  that you have set for Text property of the Grid column will be appearing as the tooltip.

 One another suggestion will be to access the Imagebutton in the code behind and set the tool tip explicitly as shown below.

CS:
 
  protected void RadGrid1_ItemDataBound(object sender, GridItemEventArgs e) 
    { 
        if (e.Item is GridDataItem) 
        { 
            GridDataItem item = (GridDataItem)e.Item; 
            ImageButton editBtn=(ImageButton)item["EditCommandColumn"].Controls[0]; 
            editBtn.ToolTip = "Edit the Item"
 
            ImageButton DeleteBtn = (ImageButton)item["DeleteColumn"].Controls[0]; 
            DeleteBtn.ToolTip = "Delete the Item"
        } 
    } 


Regards
Princy
Tags
Grid
Asked by
Tony Abou-Akl
Top achievements
Rank 1
Answers by
Princy
Top achievements
Rank 2
Share this question
or