Subject: Bind a grid from multi tables?
Posted By: hany Post Date: 1/21/2006 2:56:04 AM
Hi,
I have complex problem here, any help on this I appreciate it.
My problem is:
I want to bind datagrid from multi tables selection,until here it's ok because I can use data table to solve it, but I want to add select button for each row so i can know wich row selected and do other things depends on the selection.
So, any Ideas?

Regards
Hani
Reply By: jbenson001 Reply Date: 1/21/2006 4:47:21 PM
You have to have some sort of ID column in the grid to determine which row it is, then use the SelectedIndexChanged event of the grid.
EX:
Private Sub DataGrid1_SelectedIndexChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles DataGrid1.SelectedIndexChanged
'This is assuming your ID column is the 2nd column in the grid.
   Response.Write(DataGrid1.SelectedItem.Cells(1).Text)
End Sub

Jim

Reply By: planoie Reply Date: 1/22/2006 10:26:21 AM
Bind data from multiple tables by building a select query that gets data from multiple tables.

-Peter

Go to topic 38110

Return to index page 389
Return to index page 388
Return to index page 387
Return to index page 386
Return to index page 385
Return to index page 384
Return to index page 383
Return to index page 382
Return to index page 381
Return to index page 380