Wrox Programmer Forums
| Search | Today's Posts | Mark Forums Read
ASP.NET 1.0 and 1.1 Professional For advanced ASP.NET 1.x coders. Beginning-level questions will be redirected to other forums. NOT for "classic" ASP 3 or the newer ASP.NET 2.0 and 3.5
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 1.0 and 1.1 Professional section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
  #1 (permalink)  
Old January 21st, 2006, 03:56 AM
Registered User
 
Join Date: Dec 2005
Location: , , .
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
Default Bind a grid from multi tables?

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
  #2 (permalink)  
Old January 21st, 2006, 05:47 PM
Friend of Wrox
Points: 4,332, Level: 27
Points: 4,332, Level: 27 Points: 4,332, Level: 27 Points: 4,332, Level: 27
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Nov 2003
Location: , NJ, USA.
Posts: 1,348
Thanks: 0
Thanked 5 Times in 5 Posts
Default

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).Tex t)
End Sub

Jim

  #3 (permalink)  
Old January 22nd, 2006, 11:26 AM
planoie's Avatar
Friend of Wrox
Points: 16,481, Level: 55
Points: 16,481, Level: 55 Points: 16,481, Level: 55 Points: 16,481, Level: 55
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Aug 2003
Location: Clifton Park, New York, USA.
Posts: 5,407
Thanks: 0
Thanked 16 Times in 16 Posts
Default

Bind data from multiple tables by building a select query that gets data from multiple tables.

-Peter


Similar Threads
Thread Thread Starter Forum Replies Last Post
Grid Bind msbsam ASP.NET 2.0 Basics 1 December 19th, 2006 07:03 AM
Help to bind grid view msbsam ASP.NET 2.0 Professional 1 December 19th, 2006 06:55 AM
Grid bind using Button msbsam ASP.NET 2.0 Basics 0 December 15th, 2006 05:20 AM
Bind grid using AJAX chandan_tandon Crystal Reports 0 July 6th, 2006 08:44 AM
bind 2 tables in a datalist life_s Ng ASP.NET 1.0 and 1.1 Basics 4 December 19th, 2003 04:37 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.