Solved

Limit datagrid field width and show contents of field

Posted on 2009-05-15
4
193 Views
Last Modified: 2012-05-07
I have a notes field in my datagrid control that gets quite big, what I would liek to do is limit teh width  of it so it does not go crazy adn tehn show the contents via a tool tip.  I believe taht I ccan access the tooltip via the e.item command, but how can i limit what is shown of the notes.
0
Comment
Question by:kdeutsch
[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
  • 3
4 Comments
 
LVL 7

Accepted Solution

by:
ajolly earned 350 total points
ID: 24397842
Use 'ItemDataBound' event.
Write something like this:

   

If e.Item.ItemType = ListItemType.Item OrElse e.Item.ItemType = ListItemType.AlternatingItem Then
    Dim cellType As TableCell = e.Item.Cells(0)
    cellType.ToolTip=cellType.Text
    If cellType.Text.Length>30 then cellType.Text=cellType.Text.Substring(27)&"..."
End If
    
    

Open in new window

0
 

Author Comment

by:kdeutsch
ID: 24397963
Hi,
that works great, but how can I limit the size of the field in the datagrid itself, it still puts all the information in there and spreads it across the screen.
0
 

Author Comment

by:kdeutsch
ID: 24398095
Hi,
I figured it out, you limit witht he second variable.  got it.  Thanks for knowledge
0
 

Author Closing Comment

by:kdeutsch
ID: 31582012
Great solution
0

Featured Post

Turn Insights into Action

Communication across every corner of your business is essential to increase the velocity of your application delivery and support pipeline. Automate, standardize, and contextualize your communication processes with xMatters.

Question has a verified solution.

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

IntroductionWhile developing web applications, a single page might contain many regions and each region might contain many number of controls with the capability to perform  postback. Many times you might need to perform some action on an ASP.NET po…
The ECB site provides FX rates for major currencies since its inception in 1999 in the form of an XML feed. The files have the following format (reducted for brevity) (CODE) There are three files available HERE (http://www.ecb.europa.eu/stats/exch…
Michael from AdRem Software explains how to view the most utilized and worst performing nodes in your network, by accessing the Top Charts view in NetCrunch network monitor (https://www.adremsoft.com/). Top Charts is a view in which you can set seve…
This is my first video review of Microsoft Bookings, I will be doing a part two with a bit more information, but wanted to get this out to you folks.

691 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