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

[Solved] Use Image as hyperlink..

2 Answers 286 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Bryan Davis
Top achievements
Rank 1
Bryan Davis asked on 27 Jan 2010, 02:36 PM
Hello all I need to use an image in my gridview as a hyperlink.  I read a similar post on here but I could not get it to work for me.

I can get the image in a GridButtonColumn but no hyperlink.. I can get a hyperlink in the GridHyperLinkColumn but no image.  Here is my clientside code.

Thanks for the help.

<Columns> 
                    <telerik:GridHyperLinkColumn NavigateUrl="mylink.aspx"   
                      ItemStyle-Width="20px"  HeaderText="Button Column" Text="Link" > 
                    </telerik:GridHyperLinkColumn> 
                    <telerik:GridButtonColumn FooterText="ImageButtonColumn<br/>footer" DataTextFormatString="Select {0}" 
                        ButtonType="ImageButton" UniqueName="column" HeaderText="Teachers" ItemStyle-Width="20px" 
                        ItemStyle-HorizontalAlign="Center" HeaderStyle-HorizontalAlign="Center" CommandName="Select" 
                        DataTextField="CustomerID" ImageUrl="App_Themes/NewTheme/images/Teachers.gif">  
                        <HeaderStyle HorizontalAlign="Center"></HeaderStyle> 
                        <ItemStyle HorizontalAlign="Center" Width="20px"></ItemStyle> 
                    </telerik:GridButtonColumn> 

2 Answers, 1 is accepted

Sort by
0
Schlurk
Top achievements
Rank 2
answered on 27 Jan 2010, 03:20 PM
I believe the property you are looking for is "ImageURL" and this forum thread goes into details of how you can add this image to the column through code-behind (both C# and VB.NET).
0
Bryan Davis
Top achievements
Rank 1
answered on 27 Jan 2010, 03:41 PM
Hello Schlurk, I have been over this post back and forth yesterday and today.  I can not seem to get it to work with my client side code though.  Whenever I add the server side code it just populates my grid with a blank field.  I tried this several times yesterday I will re-add the code and see if it produces any results.  Thanks for the help anyway.

Thanks,
Bryan
Tags
Grid
Asked by
Bryan Davis
Top achievements
Rank 1
Answers by
Schlurk
Top achievements
Rank 2
Bryan Davis
Top achievements
Rank 1
Share this question
or