Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Gridview Display

Posted on 2008-10-13
15
Medium Priority
?
314 Views
Last Modified: 2013-12-17
Hi,

I have a gridview that is displayed, but the problem is some of the fields have too much content in them and would like prefer if it is possible to only show a small description of the data, and when user clicks on the row, it expands the data and displays it in full. As from normal load it is taking up to much of the browser screen.

Any help will be appreciated.

Regards,

introlux
0
Comment
Question by:introlux
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 7
  • 4
15 Comments
 
LVL 12

Expert Comment

by:Pra4444
ID: 22702291
This example is probably what you are looking for...

http://aspnet.4guysfromrolla.com/articles/071107-1.aspx
0
 

Author Comment

by:introlux
ID: 22702415
I am looking more for the following example:

Name Description
Dave  He is a person and has....

When clicking on lets say a + icon will extend the info from ... to the full description in the field.

Does that make sense?

introlux
0
 

Author Comment

by:introlux
ID: 22722250
hi,

I have been told to do the following by other sources but do not understand.

- on the label for short description, just do something like... txtSource.Substring(0,50)+"..."
 - add the Bind("Column Name") to the label
As the data is dynamic (sql statements) the user will pick a redfined SQL statement but before doing this, the following check will need to be done:
- you'll need to check whether the column is there before binding

I hope this makes sense to anyone.

Regards,

introlux
0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 96

Expert Comment

by:Bob Learned
ID: 22758166
There is a way to show text with an ellipsis, but you have to do some trickery to get this done.  I am looking back at some of might old ASP.NET stuff to find that way.
0
 

Author Comment

by:introlux
ID: 22782138
Any luck??
0
 
LVL 96

Accepted Solution

by:
Bob Learned earned 2000 total points
ID: 22782275
I couldn't find it, but I did find something similar:

Show Ellipsis Text in GridView
http://mytechissues.blogspot.com/2008/08/show-ellipsis-text-in-gridview.html
0
 

Author Comment

by:introlux
ID: 22830289
I have looked at this, but I cant seem to make any relevants to what im looking for.
0
 
LVL 96

Expert Comment

by:Bob Learned
ID: 22830535
1) Apply CSS style to the cell:

cell.Style["overflow"] = "hidden";
cell.Style["text-overflow"] = "ellipsis";

2) Set the table layout to fixed:
gv1.Style["TABLE-LAYOUT"] = "fixed";

3) Turn off word-wrap:
cell.Wrap = false;

0
 

Author Comment

by:introlux
ID: 22830570
Hi TheLearnedOne,

You have lost me! I am not sure how I will embed this with a standard gridview that is created on front code. Soz but very confused!

Regards,

introlux
0
 
LVL 96

Expert Comment

by:Bob Learned
ID: 22832357
My friend, the article shows you the code that you need to use, and I was trying to show you the important pieces of that code, so how can I help remove your confusion.

You should be able to copy the code from your, and make it fit pretty easily into your project, or a sample project (so that you can make sure the effect works before adding it to your project).
0
 

Author Comment

by:introlux
ID: 22832557
Yes! Got it working - Just needed to break it down slowly lol - Was rushing for the an end result :-)

The thing is when hovering over the text, it will show all the txt via tooltip text. I would prefer to have + button on the side to expand and display the extra text.

Is this possible?
0
 

Author Comment

by:introlux
ID: 22832785
Also on the tooltip text displays breaks like (20%) which is not clear for a novice user to what this is meant.

Regards,

introlux
0

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

A quick way to get a menu to work on our website, is using the Menu control and assign it to a web.sitemap using SiteMapDataSource. Example of web.sitemap file: (CODE) Sample code to add to the page menu: (CODE) Running the application, we wi…
Introduction This article shows how to use the open source plupload control to upload multiple images. The images are resized on the client side before uploading and the upload is done in chunks. Background I had to provide a way for user…
This course is ideal for IT System Administrators working with VMware vSphere and its associated products in their company infrastructure. This course teaches you how to install and maintain this virtualization technology to store data, prevent vuln…
Have you created a query with information for a calendar? ... and then, abra-cadabra, the calendar is done?! I am going to show you how to make that happen. Visualize your data!  ... really see it To use the code to create a calendar from a q…

722 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question