PC Review


Reply
Thread Tools Rate Thread

ToolTips for cells in a grid?

 
 
Woody Splawn
Guest
Posts: n/a
 
      16th Sep 2004
Is it possible to get a tooltip for a cell in a datagrid? If so How? Is
there a white paper somewhere?



 
Reply With Quote
 
 
 
 
Ken Tucker [MVP]
Guest
Posts: n/a
 
      16th Sep 2004
Hi,

http://www.syncfusion.com/FAQ/WinFor...c44c.asp#q843q

Ken
-------------------
"Woody Splawn" <(E-Mail Removed)> wrote in message
news:%(E-Mail Removed)...
Is it possible to get a tooltip for a cell in a datagrid? If so How? Is
there a white paper somewhere?




 
Reply With Quote
 
 
 
 
Cor Ligthert
Guest
Posts: n/a
 
      17th Sep 2004
Hi Woody,

Here the standard sample I made to add a textbox to a column in that I use
in my opinion what you ask.

\\\
Private WithEvents dtbCol1 As DataGridTextBox
Private ToolTip1 As New ToolTip
Private Sub Form1_Load(ByVal sender As Object, _
ByVal e As System.EventArgs) Handles MyBase.Load
Datagrid1.ReadOnly = True
Dim ts As New DataGridTableStyle
ts.MappingName = ds.Tables(0).TableName
Dim column As New DataGridTextBoxColumn
ts.GridColumnStyles.Add(column)
DataGrid1.TableStyles.Add(ts)
column = DirectCast(ts.GridColumnStyles(0), DataGridTextBoxColumn)
dtbCol1 = DirectCast(column.TextBox, DataGridTextBox)
column.MappingName = ds.Tables(0).Columns(0).ColumnName
column.HeaderText = "Woody"
column.Width = 30
dv = New DataView(ds.Tables(0))
dv.AllowNew = False
DataGrid1.DataSource = dv
End Sub
Private Sub dtbCol1_ToolTip(ByVal sender As Object, _
ByVal e As System.EventArgs) Handles dtbCol1.MouseEnter
ToolTip1.SetToolTip(DirectCast(sender, DataGridTextBox), _
"Row: " & DataGrid1.CurrentRowIndex + 1)
End Sub

It was not for the tooltip so you have a little bit to make it complete,

I hope it helps?

Cor


 
Reply With Quote
 
Cor Ligthert
Guest
Posts: n/a
 
      17th Sep 2004
Woody,

I saw the one in the previous message was not easy to test so here a one
with what that can be done, (the textbox has to be selected to see the
tooltip)

Cor

\\\needs a datagrid on a form
Private WithEvents dtbCol1 As DataGridTextBox
Private ToolTip1 As New ToolTip
Private Sub Form1_Load(ByVal sender As Object, _
ByVal e As System.EventArgs) Handles MyBase.Load
'making test table
Dim ds As New DataSet
Dim dt As New DataTable("test")
ds.Tables.Add(dt)
dt.Columns.Add("1")
For i As Integer = 0 To 10
Dim dr As DataRow = dt.NewRow
dr(0) = i
dt.Rows.Add(dr)
Next
'table made
DataGrid1.ReadOnly = True
Dim ts As New DataGridTableStyle
ts.MappingName = ds.Tables(0).TableName
Dim column As New DataGridTextBoxColumn
ts.GridColumnStyles.Add(column)
DataGrid1.TableStyles.Add(ts)
column = DirectCast(ts.GridColumnStyles(0), DataGridTextBoxColumn)
dtbCol1 = DirectCast(column.TextBox, DataGridTextBox)
column.MappingName = ds.Tables(0).Columns(0).ColumnName
column.HeaderText = "Woody"
column.Width = 30
Dim dv As New DataView(ds.Tables(0))
dv.AllowNew = False
DataGrid1.DataSource = dv
End Sub
///
I hope this helps a little bit?

Cor


 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
No delay for tooltips =?Utf-8?B?QW5kcmUgUGVyZWlyYQ==?= Windows XP Help 3 20th Apr 2005 04:23 PM
Taskbar tooltips partially hidden or not displaying =?Utf-8?B?dGV0MTk1Mw==?= Windows XP Help 3 6th Jan 2005 01:00 AM
Odd problem with ToolTips on the desktop since installing SP2. RaceFace Windows XP Help 0 21st Sep 2004 05:11 AM
Tooltips showing up behind tool bar items Ed Windows XP Help 4 11th Jun 2004 02:24 PM
Tooltips showing behind system tray Ed Windows XP Help 1 10th Jun 2004 10:19 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 12:09 PM.