I have a dynamic Spgridview. I add column in page load.
I use this code for add Hyperlinkfield in SPFieldType.URL :
string[] url = new string[1];
url[0] = field.InternalName;
HyperLinkField link = new HyperLinkField();
link.HeaderText = field.Title;
link.DataNavigateUrlFields = url;
link.DataNavigateUrlFormatString = "{0}";
link.DataTextField = field.InternalName;
link.SortExpression = field.InternalName;
grid.Columns.Add(link);
my problem is : for example my url is "http://Test1.docx, http://Test1.docx".
I want navigateurl set "http://Test1.docx" .