?
Solved

Limit datagrid field width and show contents of field

Posted on 2009-05-15
4
Medium Priority
?
196 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 1400 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

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

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

ASP.Net to Oracle Connectivity Recently I had to develop an ASP.NET application connecting to an Oracle database.As I am doing it first time ,I had to solve several problems. This article will help to such developers  to develop an ASP.NET client…
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
In this video we outline the Physical Segments view of NetCrunch network monitor. By following this brief how-to video, you will be able to learn how NetCrunch visualizes your network, how granular is the information collected, as well as where to f…
This tutorial will teach you the special effect of super speed similar to the fictional character Wally West aka "The Flash" After Shake : http://www.videocopilot.net/presets/after_shake/ All lightning effects with instructions : http://www.mediaf…
Suggested Courses

752 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