Jump to content
Software FX Community

hyperlink fields with data value in the link but not in the text?


klimekt

Recommended Posts

Hi,

Sorry about the delayed response.  While a constant Text string is not available in the Column, what you are asking for is relatively easy.  First, you need to create a FieldColumn in Grid.Columns.  Then, you need to set the necessary properties in its Hyperlink property.  The markup will resemble something like:

<GridFX:FieldColumn Field="transaction_id">

<HyperLink Url="report.aspx?propertyid={property_id}" /></GridFX:FieldColumn>

That will render the link in the grid, with the field data being shown.  Once the link is correct, the next step will be to set the Text of the output cells to your constant.  To do that, handle the Rendering event on the Grid using the Properties window in Visual Studio.  In the event handler you need to do the following:

    protected void Grid1_Rendering(object sender, EventArgs e)

    {

      foreach (GridItem currItem in ((Grid)sender).Items)

      {

        currItem.Cells[0].Text = "Click here";

      }

    }

Note: the index in the Cells collection depends on the index of the column.  In this example, it's the first one. Just adjust that and it will work fine.

Hope this helps.  Thanks for using Grid FX.

 

 

 

 

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...