Creating Hyperlinks in a datagrid

Results 1 to 2 of 2

Thread: Creating Hyperlinks in a datagrid

  1. #1
    Join Date
    Dec 1969

    Default Creating Hyperlinks in a datagrid

    Hi<BR><BR>I want to dynamically create hyperlinks in a column of a datagrid. The problem I am having is that the page which the URL is made up of will be one of 5 different options plus I also need to additionally specify a querystring. <BR><BR>The page name and querystring parameters are all returned by the query to which the datagrid is bound<BR><BR>if I use the DataNavigateUrlField ="url" attribute then the correct page will be pulled from the URL field in the database<BR><BR>But I don&#039;t have any options to specify a querystring after that<BR> <BR>The DataNavigateUrlFormatString="?id={0}" attribute seems to assume the page will always be the same URL<BR><BR>Have tried all the combinations of the attributes that I can think of but none have produced the desired result<BR><BR>Now the other option would be to not use a "bound" column but create the hyperlink in the codebehind by calling a function from a templated column.<BR><BR>But wouldn&#039;t this mean I lost the ability to specify a sort expression on this column??<BR><BR>any help would be greatly appreciated <BR><BR>thanks<BR><BR>&#060;asp:HyperLinkColumn DataNavigateUrlField="url" DataNavigateUrlFormatString="?id={0}" DataTextFormatString="{0}" DataTextField="app_key" HeaderText="ID" SortExpression="app_key"&#062;<BR>&#060;/asp:HyperLinkColumn&#062;

  2. #2

    Default RE: Creating Hyperlinks in a datagrid

    Use a template column, the databound columns are for simple needs.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts