Wrox Programmer Forums
Go Back   Wrox Programmer Forums > ASP.NET and ASP > ASP.NET 2.0 > ASP.NET 2.0 Basics
|
ASP.NET 2.0 Basics If you are new to ASP or ASP.NET programming with version 2.0, this is the forum to begin asking questions. Please also see the Visual Web Developer 2005 forum.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 2.0 Basics section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old July 23rd, 2008, 07:01 PM
Friend of Wrox
 
Join Date: Mar 2007
Posts: 205
Thanks: 4
Thanked 0 Times in 0 Posts
Default GridView - Hide column and retrieve value

I have an application that shows:

Date
Job Number
Quantity
Description

in a GridView.

Date, Job Number and Quantity are in one table. Description exists in a separate table linked by uniqueidentifier field like JobGuid. Description is 200 char long.

When I show the GridView, I use substring in my sp and show only the 1st 25 characters. Fields in my grid view are bound fields except for the description field that is a "link button" field. The purpose of this is to be able to click the description in the grid view and show the full 200 character text.

I was hoping to use a hidden field for the extended text in the GridView (in addidtion to the short description that I show) but read that you cannot retrieve value from hidden fields (visible = false). Somewhere I read you could convert the "link button" filed into a template field, make it hidden and be able to retrieve the value using "Find control" and hopefully display the full description in a tooltip. Is this a good way or are there better solutions (I am not good at dealing with CSS which would support a similar solution).

Note: When I have the GridView displayed I do not have the JobGuid key any longer that links the job table and the description table si I cannot easily retrieve the extended description.

Thank you for every suggestion.....

 
Old July 24th, 2008, 03:22 PM
planoie's Avatar
Friend of Wrox
 
Join Date: Aug 2003
Posts: 5,407
Thanks: 0
Thanked 16 Times in 16 Posts
Default

There are HTML attributes that can generate tool tips. I believe the "title" attribute on an <a> tag will create a tooltip.

If you make the hidden field not visible at the server side, it won't render. I can't imagine why one would do this however, as the hidden field is, well..., already hidden.

You could change the description field into a template column, put a hidden relative position div with the complete description and show it when you mouse over the truncated value.

-Peter
compiledthoughts.com





Similar Threads
Thread Thread Starter Forum Replies Last Post
Export Gridview to Excel and Hide column PDALUX ASP.NET 2.0 Basics 2 March 1st, 2012 02:16 AM
Get GridView Cell Value Based on GridView Column stublair C# 2008 aka C# 3.0 0 September 4th, 2008 08:30 AM
hide certain column in a table lscjtw XSLT 2 August 2nd, 2007 01:26 PM
How to retrieve values from gridview rojiin ASP.NET 2.0 Basics 1 June 26th, 2007 07:32 AM
how to hide Field values in Gridview KamalRaturi ASP.NET 2.0 Professional 1 August 26th, 2006 11:39 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.