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

Seting HyperLinkColumn DataNavigateUrlFormatString From Code Behind

1 Answer 333 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Kareem
Top achievements
Rank 1
Kareem asked on 22 Sep 2015, 10:14 AM

Hello,
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

1 Answer, 1 is accepted

Sort by
0
Daniel
Telerik team
answered on 22 Sep 2015, 02:27 PM
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 = "https://en.wikipedia.org/wiki/{0}";
}

I hope this helps.

Regards,
Daniel
Telerik
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
Tags
Grid
Asked by
Kareem
Top achievements
Rank 1
Answers by
Daniel
Telerik team
Share this question
or