Hello!
I try to create dynamic url like https://mylink.com/?parameter1={0}¶meter2={1}, but I can get only single parameter from field DataNavigateUrlFields="myfield".
Any ideas?
After that, I tried to resolve my issue dynamically with code:
protected void OrdersRadGrid_ItemDataBound(object sender, GridItemEventArgs e)
{
if (e.Item is GridDataItem)
{
GridDataItem item = (GridDataItem)e.Item;
TableCell tb = item["item1"];
HyperLink lnk = new HyperLink();
lnk.ID = "routeId";
lnk.Text = item["item1"].Text;
string str1 = item["item2"].Text;
string str2 = item["item3"].Text;
lnk.NavigateUrl = string.Format("https://mylink.com/?parameter={0}{1}", str1, str2);
tb.Controls.Clear();
tb.Controls.Add(lnk);
}
}
But, I get an interesting bug: in construction item["item"].Text not all fields displays correct. In debugger, i can see in the item all the fields with their correct values. But some of them (right these I need to use!), give me ' ' value. Thus, expression siring str=item["item1"].Text returns me value ' ' (not in all text type fields, but only in several in the same item). May it be encoding problem? Or any other ideas?