Visual Basic Programming
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsProgramming Languages - MoreVisual Basic Programming

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old October 14th, 2003, 04:15 AM
ejanakieff ejanakieff is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Sep 2003
Posts: 8 ejanakieff User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 4 m 16 sec
Reputation Power: 0
Datagrid. Assign a different ToolTipText to each row.

I have a Datagrid with a defined width.It has only one column, with a width bigger than the Datagrid width.

I want that the end user can see the content of each row
completely .

1.

I tried to put both scrollbars visibles to get the end user can see all the content of the column, but the horizontal scrollbar only scroll column to column, not into a column. I don't not how can I change this.

2.
I tried too, assign a diferent ToolTipText to each row, using the event MouseMove. I get the current row using:

DG_EsqArt.RowContaining(Y)

But when the user uses the vertical scrollbar, this function doesn't work.
For exemple, in the Datagrid are visible at a time 20 rows, if the end users scroll once vertically, and clicks the row 21, the above functions return the row 1, not the 21.

Can someone help me?

Thanks,
Eva Janakieff

Reply With Quote
  #2  
Old October 14th, 2003, 10:26 AM
cleverpig cleverpig is offline
Contributing User
Dev Shed Beginner (1000 - 1499 posts)
 
Join Date: Jul 2003
Posts: 1,152 cleverpig User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 7
Send a message via MSN to cleverpig
U can judge the Y of the mouse moved,and show the 21 row:
dim NewRow
RowValue = DataGrid1.RowContaining(Y)
If RowValue >DataGrid1.VisibleRows And _
NewRow=DataGrid1.Columns(RowValue)
End If

Reply With Quote
  #3  
Old October 15th, 2003, 02:13 AM
ejanakieff ejanakieff is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Sep 2003
Posts: 8 ejanakieff User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 4 m 16 sec
Reputation Power: 0
I think that this not resolve my problem, or I didn't understand the solution.

The problem is:

The Datagrid have 20 visibles rows at the same time.
To go to the row 21 is necessari to do a down scroll.

By the other hand the function RowContaining(Y), doesn't return the row number, instead returns a number between 1 to 20, like this:

* For the first line visible returns 1.
* For the second line visible returns 2.
...
* For the 20th line visible returns 20.

If the user has done a down scroll, and move mouse over the first line visible at this moment, this function returns 1, and I need to know that is the 21th row, to show the correct ToolTip.

Thanks,
EVA

Reply With Quote
  #4  
Old October 15th, 2003, 03:39 AM
cleverpig cleverpig is offline
Contributing User
Dev Shed Beginner (1000 - 1499 posts)
 
Join Date: Jul 2003
Posts: 1,152 cleverpig User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 7
Send a message via MSN to cleverpig
I see!But It's impossible?..When u click the 21th row,it return the 1th row??It's possible that 21th row is not visible to u,when u click the scroll bar!U can find the VisibleRows property on msdn http://msdn.microsoft.com/library/d...visiblerows.asp

I think it is a way to resolve your problem that let the scroll bar to move.But it maybe is a difficult way..

Reply With Quote
  #5  
Old October 15th, 2003, 03:49 AM
ejanakieff ejanakieff is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Sep 2003
Posts: 8 ejanakieff User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 4 m 16 sec
Reputation Power: 0
I thinks I didn't explain right.

When I move the mouse over the 21th row (this is only visible if I make a down scroll before), the Datagrig doesn't move at all, but the function RowContaining(Y) returns the position where the row is visible (the position is 1, but the number of row is 21). I need to know what is the number row.

Reply With Quote
  #6  
Old October 15th, 2003, 04:40 AM
ejanakieff ejanakieff is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Sep 2003
Posts: 8 ejanakieff User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 4 m 16 sec
Reputation Power: 0
Smile SOLUTION

I have find the solution to show a different ToolTipText for each row of a DataGrid. I the next code I show the content of the first column when the user moves the mouse over a row:

Private Sub DG_EsqArt_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)

Dim RowValue As Long
Dim intCols As Integer
Dim strToolTip As String

RowValue = DG_EsqArt.RowContaining(Y)

If RowValue <> -1 Then
strToolTip = DG_EsqArt.Columns(1).CellValue(DG_EsqArt.RowBookmark(RowValue))
End If
DG_EsqArt.ToolTipText = strToolTip

End Sub

I hope that this help someone else.

Eva Janakieff

Reply With Quote
  #7  
Old October 15th, 2003, 09:40 AM
cleverpig cleverpig is offline
Contributing User
Dev Shed Beginner (1000 - 1499 posts)
 
Join Date: Jul 2003
Posts: 1,152 cleverpig User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 7
Send a message via MSN to cleverpig
Good way!Clever Solution!

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming Languages - MoreVisual Basic Programming > Datagrid. Assign a different ToolTipText to each row.


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 4 hosted by Hostway
Stay green...Green IT