|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
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 |
|
#2
|
|||
|
|||
|
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 |
|
#3
|
|||
|
|||
|
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 |
|
#4
|
|||
|
|||
|
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.. |
|
#5
|
|||
|
|||
|
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. |
|
#6
|
|||
|
|||
|
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 |
|
#7
|
|||
|
|||
|
Good way!Clever Solution!
|
![]() |
| Viewing: Dev Shed Forums > Programming Languages - More > Visual Basic Programming > Datagrid. Assign a different ToolTipText to each row. |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|