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

[Solved] Iconic Edit Column with Link

1 Answer 117 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Richard
Top achievements
Rank 1
Richard asked on 17 Aug 2009, 06:47 PM
I have the following column which takes the user to a new page when clicking on the Edit Text:

<telerik:GridHyperLinkColumn Text="Edit" HeaderText="Edit" DataNavigateUrlFields="AccountID" 
  DataNavigateUrlFormatString="Account.aspx?AccountID={0}"
  <HeaderStyle HorizontalAlign="Center" /> 
  <ItemStyle HorizontalAlign="Center" /> 
</telerik:GridHyperLinkColumn> 
 

How can I replace the field text with the Edit Item Icon?

1 Answer, 1 is accepted

Sort by
0
Shinu
Top achievements
Rank 2
answered on 18 Aug 2009, 05:18 AM
Hi Richard,

One suggestion will be to use a GridTemplateColumn with a Hyperlink in its ItemTemplate instead of GridHyperLinkColumn. Give a try with the following approach and see whether it helps.

ASPX:
 
   <telerik:GridTemplateColumn UniqueName="TemplateCol" HeaderText="EditColumn" > 
            <ItemTemplate> 
                <href='Account.aspx?AccountID=<%# Convert.ToString(DataBinder.Eval(Container.DataItem,"AccountID")) %>'
                   <asp:Image ID="Image1" ImageUrl="~/Image/Edit.gif" Runat="server"></asp:Image>  
                </a> 
             </ItemTemplate> 
   </telerik:GridTemplateColumn> 


Regards
Shinu
Tags
Grid
Asked by
Richard
Top achievements
Rank 1
Answers by
Shinu
Top achievements
Rank 2
Share this question
or