|
-
Jan 3rd, 2003, 04:32 AM
#1
Thread Starter
Addicted Member
collecting data from datagrid and pull it to other commands
i want to identify selected row in datagrid and populate few textboxes with the appropriate data from the dataview/datagrid which connected to a datagrid how can i do that?
i have the folowing event
rivate Sub grdCompanies_Navigate(ByVal sender As System.Object, ByVal ne As System.EventArgs) Handles grdCompanies.DoubleClick
**which code should i put here so when the user double click on a row i get the appropriate data from the dataview and pull it to textbox
End Sub
thanks for help
-
Jan 3rd, 2003, 04:53 AM
#2
Registered User
DataGrid1.CurrentRowIndex gives you the current row index. Use that with your DataView object. Something like this maybe....
dv.Item(DataGrid1.CurrentRowIndex)("ColumnName")
-
Jan 3rd, 2003, 04:56 AM
#3
Thread Starter
Addicted Member
thanks for the answer
what happen if i filter the grid? the indexes wont be the same no?
-
Jan 3rd, 2003, 06:14 AM
#4
Thread Starter
Addicted Member
i made the datagrid rowselection as the entire row - my problem is when i filter the row i want to go get the appropriate value and input it to some commads - how do i do that?
-
Jan 3rd, 2003, 06:20 AM
#5
Registered User
The index will in most cases probably not be the same, but the row you are doubleclicking is the one with CurrentRowIndex, and as I understand it you want data from the row you doubleclicked to pop into textboxes, ie the one with CurrentRowIndex, right?
-
Jan 4th, 2003, 05:52 PM
#6
Thread Starter
Addicted Member
yup i just need the record data - but i had additional data which exists in the dataview and not in the grid
-
Oct 16th, 2003, 01:27 PM
#7
Lively Member
Did you ever solve this? I'm having a similar problem & can't figure it out.
-
Oct 16th, 2003, 10:19 PM
#8
Lively Member
Binding Context
You should have a BindingContext Command in
Private Sub grdCompanies_Navigate(ByVal sender As System.Object, ByVal ne As System.EventArgs) Handles grdCompanies.DoubleClick
Let me know if you have bindingcontext problem.
-
Oct 17th, 2003, 07:08 AM
#9
Lively Member
How would I use the bindingcontext command? Can you provide an example?
Thanks
-
Oct 17th, 2003, 07:48 PM
#10
Lively Member
VB Code:
Private Sub datListSetting_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles datListSetting.Click
Me.BindingContext(DataSet11, "DatabaseTableName").Position = datListSetting.CurrentRowIndex
End Sub
set the each textbox's properties , databinding.text = dataset's datafield.
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
|