OK. So I realise I had to create my field differently and specify a string
array for for *DataNavigateUrlFields* property.

And for dynamic URL I created a new column for my DataTable called
*URL*that replicated the
*pageid* column and applied my string manipulation there. Added the row
values. Then simply defined my grid field accordingly.

HyperLinkField url = new HyperLinkField();
url.DataTextField = "URL";
url.DataNavigateUrlFields = new String[] {"pageid"};

Don't know if there was a better way. Maybe using the RowDataBound event
handler?

Same deal with adding the footer row for totals. Just grabbed it all from
the DataTable and added a literal control. This class is pretty painful, I
gotta say,


On 18 February 2013 15:24, Web Admin <[email protected]> wrote:

> Hi all,
>
> I have a data field called *pageid* containing URLs which I would like to
> manipulate and display as a hyperlink in a HyperLinkField.
>
> _gridView.Columns.Add(new *HyperLinkField*
>  {
>     DataTextField = "pageid",
>     *DataTextFormatString *= "",
>     *DataNavigateUrlFields *= "pageid",
>     DataNavigateUrlFormatString = "{0}",
>     HeaderText = "URL",
>     SortExpression = "pageid"
> });
>
> I just want to use the field's raw value as the *DataNavigateUrlFields * 
> value.
> And trim the http://domain from the link text.
>
> <a href="*http://site/path/mypage.aspx*";>*/path/mypage.aspx*</a>
>
> But am struggling with the *DefaultTextFormatString *format. All the
> examples I can find deal with numeric formats. I want to manipulate the
> string further.
>
> And *DataNavigateUrlFields *is throwing an error: Cannot implcitly
> convert type string to string[].
>
> Help please.
>
> Regards,
>
> Paul
>
_______________________________________________
ozmoss mailing list
[email protected]
http://prdlxvm0001.codify.net/mailman/listinfo/ozmoss

Reply via email to