Limit datagrid field width and show contents of field

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.
kdeutschAsked:
Who is Participating?
 
ajollyConnect With a Mentor Commented:
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
 
kdeutschAuthor Commented:
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
 
kdeutschAuthor Commented:
Hi,
I figured it out, you limit witht he second variable.  got it.  Thanks for knowledge
0
 
kdeutschAuthor Commented:
Great solution
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.