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

Add Alt or Title to image on GridHyperLinkColumn

1 Answer 259 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Dave
Top achievements
Rank 1
Dave asked on 07 Jan 2014, 01:14 PM
I am using a GridHyperLinkColumn with an ImageUrl defined. This produces a column with an image as the hyperlink. I want to add an ALT or Title tag to the image so that the end-user will know what clicking the image will do. There does not appear to be an "alt" or "title" property for the GridHyperLinkColumn. I've tried using the "text" property, but it does not work. Also, using the "HeaderText" property is not an option as I have the headers blank for those columns. Below is a sample of my code:

<telerik:GridHyperLinkColumn
ItemStyle-Width="20px" 
UniqueName="EditStudent"
ImageUrl="~/Common_Images/icons/View_Student.gif"
HeaderText=""
DataNavigateUrlFields="UserId"
DataNavigateUrlFormatString="~/Secure/EditStudent.aspx?uid={0}"
AllowFiltering="False" />

The screen shot shows four columns, each a separate GridHyperLinkColumn. The "Student" column (obfuscated) is a standard GridBoundColumn.

Any help is appreciated....

1 Answer, 1 is accepted

Sort by
0
Dave
Top achievements
Rank 1
answered on 07 Jan 2014, 01:26 PM
Found the solution....I needed to use the DataTextField and DataTextFormatString properties. 
So the code should look like:

<telerik:GridHyperLinkColumn
ItemStyle-Width="20px"
UniqueName="EditStudent"
ImageUrl="~/Common_Images/icons/View_Student.gif"
HeaderText=""
DataTextField="StudentName"
DataTextFormatString="Edit {0}"
DataNavigateUrlFields="UserId"
DataNavigateUrlFormatString="~/Secure/EditStudent.aspx?uid={0}"
AllowFiltering="False" />
Tags
Grid
Asked by
Dave
Top achievements
Rank 1
Answers by
Dave
Top achievements
Rank 1
Share this question
or