Seting HyperLinkColumn DataNavigateUrlFormatString From Code Behind

2 posts, 0 answers
  1. Kareem
    Kareem avatar
    8 posts
    Member since:
    Sep 2015

    Posted 22 Sep 2015 Link to this post

    I want to set the a navigation URL of  ​a GridHyperLinkColumn to a value with query string which is the date selected from a radatepicker

    I tried using the embedded C# code method using <% %> but it didn't show me any love, it just posted the plain text in the URL including the <% %> enclosing marks

    I would like to know if there's a way to set this in the code behind link in the onload event or something

  2. Daniel
    Daniel avatar
    4949 posts

    Posted 22 Sep 2015 Link to this post

    Hello Kareem,

    You can try something like this:
    protected void RadGrid1_DataBinding(object sender, EventArgs e)
        var col = RadGrid1.MasterTableView.GetColumn("MyHyperLinkColumn") as GridHyperLinkColumn;
        col.DataNavigateUrlFormatString = "{0}";

    I hope this helps.

    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
Back to Top