Search code examples
asp.netgridviewimagebuttonbuttonfieldalt

ASP.net gridview image button alternative text


There is a AlternateText property in image-buttons so that while hovering mouse on image buttons, alternate text could clarify the functionality of the button. I want to do so with ASP.net standard gridview and show a text while mouse being stopped on buttonfield button that I've added to my gridview. But such a property does not exist and my searches using Intellisense reached nowhere.


Solution

  • Use TemplateField instead of ButtonField like below:

    <asp:TemplateField>
        <ItemTemplate>
           <asp:ImageButton ID="ImageButton1" runat="server" AlternateText="My Text" />
        </ItemTemplate>
    </asp:TemplateField>