Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Hyperlink column in a datagrid

Status
Not open for further replies.

jartman

Programmer
Oct 16, 2001
34
US
I've got a datagrid with a HyperLinkColumn in it. What I want to do is take a part number (in another column) and link to an image of the part by adding .jpg to the end of it. I'm using "/images{0}.jpg" as the URL format string.

The problem is that the result I get has the part number padded out with spaces, to the field width defined in the database. So if the pn is "12345", I get "images/12345%20%20%20%20%20%20%20.jpg". If I just use "/images{0}" as the URL format string, there's no padding. Any tricks for getting rid of this? It seems to be happening in the hyperlink itself, for example if I edit the row with an edit/update/cancel column, the spaces are not there in the data.

I also tried changing the hyperlink column to a button so I could write code behind it, but I couldn't figure out how to get a browser window open on the client from this server-side code.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top