|
-
Oct 22nd, 2003, 06:31 PM
#1
Thread Starter
New Member
Datagrid click
I have a datagrid that is bound to a dataset. I what my users to be able to
(1) filter the dataset using their selection from a combobox.(the category is selected from the combobox)
(2) once filtered and displayed in the grid be able to click on the row and that rows data is displayed in textboxs below the grid.
The filtering is working fine, the grid is bound to the dataset prior to being filtered so I see all of the data. When I click on a row the data is displayed in the text boxes below the grid. Which is exactly what I want.
PROBLEM: I select a category (which applys a filter to the dataset) I click a row on the grid..... NO DATA?????????
Any Direction and or help would be appreicated.
chuck
-
Oct 22nd, 2003, 09:48 PM
#2
Hyperactive Member
what do you have in the click procedure?
you might have a glitch there, I could help you with your code.
"Who Dares Wins" - "Quien se Arriesga Gana"
Mail me at: 
-
Oct 23rd, 2003, 11:21 AM
#3
Hyperactive Member
Try this:
VB Code:
Private Sub DataGrid1_MouseUp(Button As Integer, Shift As Integer, X As Single, Y As Single)
On Error GoTo ErrHand
DataGrid1.Row = DataGrid1.RowContaining(Y)
'Personally, If working in the same form I wouldn´t use Me.????? (but that´s me :))
Me.TextBox1.Text = DataGrid1.Columns(0).Text
Me.TextBox2.Text = DataGrid1.Columns(1).Text
Me.TextBox3.Text = DataGrid1.Columns(2).Text
Me.TextBox4.Text = DataGrid1.Columns(3).Text
Me.TextBox5.Text = DataGrid1.Columns(4).Text
Exit Sub
ErrHand:
Select Case Err.Number
Case Is = -2147467259
MsgBox "Database Error", vbInformation + vbOKOnly, "Warning"
End Select
End Sub
"Who Dares Wins" - "Quien se Arriesga Gana"
Mail me at: 
-
Dec 22nd, 2003, 01:38 AM
#4
New Member
Thanks D12Bit ,
Been searching for solutions to solve this same problem as well!!!
-
Dec 22nd, 2003, 02:07 AM
#5
New Member
If I use the solution proposed above, I get the whole row highlighted as an indication that it is pointing at that particular
row, which is good.
Before I used your solution, I;ve been using the solution as below.
I use also the move.first,move.last, move.next, move.previous commands because I have 4 buttons that guide the user to point at the particular records, but if I use the buttons to navigate the records displayed in the datagrid, the arrow at the left-most column (known as record selector) of the datagrid will move but it won't highlight the whole selected row.
I want to standardized everything, which I want the whole selected row to be highlighted but I do not know how to do it. Please help. Thanks in advance
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|