473,607 Members | 2,703 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Nested Gridviews

I am creating a nested gridview as per the tutorial here
(http://msdn2.microsoft.com/en-us/lib...8(vs.80).aspx). My
gridviews work fine. I have a master gridview containing the customerid.
This value is used by a a detail gridview nested within the master. This
works well but when I hide the customerid the filter stops working. I
suspect that this code can't find the ID to do the filtering. How do get
around this as I want to hide the CustomerID. Also how efficient is this?
Does it involve a separate call to the database for each row in the parent.
Is it possible grab all the child detail data in one go and filter via a
dataview. I quite like using typed datasets and the objectdatasourc e but I
don't want ineffiicient code. Regards, Chris.

Protected Sub GridView1_RowDa taBound(ByVal sender As Object, ByVal e As
System.Web.UI.W ebControls.Grid ViewRowEventArg s) Handles
GridView1.RowDa taBound

If e.Row.RowType = DataControlRowT ype.DataRow Then

Dim o As ObjectDataSourc e = CType(e.Row.Fin dControl("objds getorders"),
ObjectDataSourc e)

o.SelectParamet ers(0).DefaultV alue = e.Row.Cells(0). Text

End If

End Sub


Apr 1 '07 #1
1 4220
I found another way but if anyone has any opinions on the other questions
they would be welcome.

o.SelectParamet ers(0).DefaultV alue =
GridView1.DataK eys(e.Row.DataI temIndex).Value

"Chris" <no****@nospam. comwrote in message
news:e3******** ******@TK2MSFTN GP04.phx.gbl...
>I am creating a nested gridview as per the tutorial here
(http://msdn2.microsoft.com/en-us/lib...8(vs.80).aspx). My
gridviews work fine. I have a master gridview containing the customerid.
This value is used by a a detail gridview nested within the master. This
works well but when I hide the customerid the filter stops working. I
suspect that this code can't find the ID to do the filtering. How do get
around this as I want to hide the CustomerID. Also how efficient is this?
Does it involve a separate call to the database for each row in the parent.
Is it possible grab all the child detail data in one go and filter via a
dataview. I quite like using typed datasets and the objectdatasourc e but I
don't want ineffiicient code. Regards, Chris.

Protected Sub GridView1_RowDa taBound(ByVal sender As Object, ByVal e As
System.Web.UI.W ebControls.Grid ViewRowEventArg s) Handles
GridView1.RowDa taBound

If e.Row.RowType = DataControlRowT ype.DataRow Then

Dim o As ObjectDataSourc e = CType(e.Row.Fin dControl("objds getorders"),
ObjectDataSourc e)

o.SelectParamet ers(0).DefaultV alue = e.Row.Cells(0). Text

End If

End Sub


Apr 1 '07 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
19333
by: Martin | last post by:
Hi, I have a very frustrating problem that I have researched for countless hours to no avail. There are many posts asking very similar things, however none usefull in my situation. I am using VS 2005 (ASP 2.0) and VB .NET. I have a page with a datalist, a gridview and then other data controls, nested in that order. This all works great, and produces a nice looking page, but I cannot for the life of me figure out how to reference
0
2792
by: manuel.ricca | last post by:
Hello, I'm trying to create a table with 2 nested gridviews and then a DetailsView on the right. The DetailsView should show the details of the item selected in the 2nd (nested) GridView: My "master" table is like this: A1
1
1953
by: Roy | last post by:
Hey all. Below is the nested syntax on how to make a "codeless" nested gridview embedded within another gridviews templatefield column. Only problem is that it loads slow. REAL SLOW. There has to be a better way. Suggestions anyone? By the way, I'm not opposed to coding, it just seems like this should be easily doable on the aspx side of things. Summary: I'm stuffing the 3 three key fields from each row in the master gridview into...
2
2060
by: jobs | last post by:
I have two Nested repeating Datalists with different data sources. Currently the second Datalist is set to visible=false I have an oncommand button on the first, that when selected I would like to make it's sub datalist visible. I'm a bit confused about how to refrence the instance of the second datalist.
0
1110
by: titia111 | last post by:
I am new to 2.0 and am using nested gridviews. The first one contains category information, the second is based on a query from a product table. The data is pulling correctly, but the problem is formatting. I need to display the data on separate lines and columns. I had it in tables and aligned correctly, but now that I am nesting the gridviews it is not allowing me to do this. I would like to go to a new line after the category, and...
3
18780
by: ThatsIT.net.au | last post by:
I'm looking for a very simple nested grid view example. Also I have been creating tables instead of using gridview for complex tasks or just spitting out html from code. Do you recommend using nested gridviews?
0
955
by: Fabrizio | last post by:
Hi. I have two nested gridviews. The detail GV in the EditTemplate has one dropdownlist. On rowupdating of the detail GV i have to assign to my dataset fields the key and the value selected in the DDL. I'm not able to cast in the rowupdate the dropdownlist (return always null) How can i do? Thanks Fabrizio
2
2814
by: GISmatters | last post by:
I have unbound checkboxes in a nested gridview to allow multi-selection of "child" rows. For context, the parent gridview rows are for large "reports", the child rows are for various specific files comprising each report. I want the user to be able to select an arbitrary collection of report files and have them emailed by clicking an "Email selected files" button. Everything displays properly, including the checkboxes for each child row (each...
0
1550
by: omgdork | last post by:
Hi! I'm having trouble on how to proceed with inserting data that are in parent and child gridviews. I have a gridview with nested gridviews that looks like this: http://img17.imageshack.us/img17/7442/nestedgridview1.jpg I could already display the gridview but the problem is storing the data. All the gridviews (parent and children) have pagers and sorting. The child gridviews are in UpdatePanels. All the checkboxes are checked by...
0
7985
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8469
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
8128
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8322
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
6803
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5471
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
3953
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4013
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
1574
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.