Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
180
TemplateDataField
posted

I am using the webdatagrid Version=11.1.20111.2075.

We have developed  a wrapper that automatically generates the columns and all our standard settings in code behind which is working fine.

We now have a requirement for one of those columns to be a hyperlink, looking through the various posts the recommended way to achieve this in a webdatagrid is through a templatedatafield.

I have found the following example from a previous post (sorry did not save link)

<ig:WebDataGrid ID="wgLinks" runat="server" Width="80px" AutoGenerateColumns="False"
 DataKeyFields="Web_Link" StyleSetName="WestonBlue" AltItemCssClass="WestonAltBlueItem"
 ShowHeader="False">
 <Columns>
  <ig:TemplateDataField Key="Web_Link" Width="100%">
   <ItemTemplate>
    <asp:HyperLink ID="HyperLink1" runat="server"
     NavigateUrl='<%# Eval("Web_Link") %>'
     Text='<%# Eval("HTML_Desc") %>' >
    </asp:HyperLink>
   </ItemTemplate>
  </ig:TemplateDataField>
 </Columns>
</ig:WebDataGrid>

Which works fine for us, but I would like to add support for this in our wrapper and we are struggling and adding a templatedatafield in vb.bnet code behind? or is there a better way to acheive hyperlinks in code behind.

Any help would be appreciated and any links to any articles or help on the uses of templatedatafield would also be helpful.

thanks

Kevin