How to Use Image Button as hyperlink

7 posts, 0 answers
  1. AL
    AL avatar
    40 posts
    Member since:
    May 2008

    Posted 13 May 2008 Link to this post

    How to use an Image button as a hyperlink in a radGrid?

    I have a grid that displays customerID, firstname, lastname. The customerID field contains "View Details" image. When I click the "View Details" image button, I want the user to be redirected to: customerdetails.aspx?customerID = ALFKI

    The following code does not work for an imageButton:-
    CommandArgument="customerdetails.aspx?customerID=customerID.....does not work.

    Appreciate your help.


  2. Shinu
    Shinu avatar
    17764 posts
    Member since:
    Mar 2007

    Posted 14 May 2008 Link to this post

    Hi Luv,

    Try the following code snippet to achieve the desired scenario.

    <telerik:GridTemplateColumn HeaderText="Temp" UniqueName="Temp" > 
                             <asp:ImageButton ID="ImageButton1" runat="server" ImageUrl="~/RadControls/Hay/Grid/AddRecord.gif" OnClick="ImageButton1_Click" /> 

     protected void ImageButton1_Click(object sender, ImageClickEventArgs e) 

  3. DevCraft R3 2016 release webinar banner
  4. AL
    AL avatar
    40 posts
    Member since:
    May 2008

    Posted 14 May 2008 Link to this post

    Hi Shinu,

    The code you are suggesting may work in older version of radGrid (2007), but not in 2008 Q1. I get error on ImageClickEventArgs e

    I am trying to achieve the following action, but I get errors on CommandName and CommandArguments:--

    protected void RadGrid1_ItemCommand(object source, Telerik.Web.UI.GridItemEventArgs e)
            if (e.CommandName == "viewdetails")

                Response.Redirect("~/customerdetails.aspx?CustomerID=" + e.CommandArgument);


  5. AL
    AL avatar
    40 posts
    Member since:
    May 2008

    Posted 14 May 2008 Link to this post

    It seems Raju Kumar has the same request:--

    Binding OnitemCommand event:

    ANy CORRECT and UPDATED telerik Grid documentation will be greatly appreciated. I downloaded the latest documentation, but it contains documentation for 2007 version???????
  6. Sebastian
    Sebastian avatar
    9934 posts

    Posted 15 May 2008 Link to this post

    Hello Luv,

    The latest version of the online documentation of RadControls for ASP.NET AJAX can be found here:

    It will be updated by the end of the week along with the Q1 2008 SP1 release of the suite. CHM version of the documentation is also available for download at this location.

    the Telerik team

    Instantly find answers to your questions at the new Telerik Support Center
  7. Mario
    Mario avatar
    75 posts
    Member since:
    Jun 2009

    Posted 18 Jun 2009 Link to this post


    im using the actual 2009 version of the radgrid but i still got that problem that i cant put objectinfo into my CommandArguments of my GridButtonColumn (ImageButton).

    I red the actual online help to the template column @ ,but i couldnt choose a field of my dataset, maybe cause i do not allow automatic column generation, because i defined all my columns myself.

    So how get the via Linq's DAL Object via that code input ?! document is the table im selecting all on and metainformation is the next table where document got a foreign key from. there i have the name i want to use. so i can open a filepath via imagebutton.

    thx mario
  8. Karl
    Karl avatar
    172 posts
    Member since:
    Sep 2010

    Posted 28 Oct 2010 Link to this post

    I got around this issue by encoding an image into the Text property of the telerik:GridHyperLinkColumn like so...

            Text="<img src='../App_Themes/MyTheme/Images/SmallButtons/PDF-20x20.png' width='20' height='20' border='0' alt='' />"
            AllowFiltering="false" >
        <HeaderStyle HorizontalAlign="Center" Width="48px" />
        <ItemStyle HorizontalAlign="Center" Width="48px" />
Back to Top
DevCraft R3 2016 release webinar banner