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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

gridview - show only 1st couple words of the data field

Status
Not open for further replies.

stonehead

Technical User
May 2, 2007
58
US
Hi all,

I use gridview to show my data. There's one field called description. It's very long so it looks really ugly if I have everything shown. Is there a way for me to show just 1st couple words the field & (make it hyperlink) so users can click on those words of that one record to expand if they want to read the whole thing? Any help is greatly appreciated.
 
Yes. Just return the first x characters of that colum(I assume from some DB) and add "..." after it. I suggest that so the user knows there is more text. Then you can just make that column a hyperlink column or a template column with a link in it to a pop up page. In that page(pass it an id) and query the db with that ID to show that column.
 
I wrote a little function for it and it worked. Thank you.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top