473,654 Members | 3,062 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

trouble with Master-Details list

I'm trying to link a gridview to another gridview in a Master-Details
architecture. But the Details list isn't filtering like it is
suppossed to. It will show all items on page load and it won't remove
any items when an item in the Masters list is selected. It shouldn't
show anything until an item in the Master's list is selected and then
only show the details which are associated with the selected item in
the Masters list.
I'm new to ASP.NET (one of the last straglers moving from VBScript)
and, so, I'm probably doing something pretty stupid, but some help
would be really appreciated.
Here's the code

<asp:AccessData Source ID="AccessDataS ource1" runat="server"
DataFile=""

SelectCommand=" SELECT DISTINCT org FROM Orgs"
OnSelecting="Ac cessDataSource1 _Selecting1"></asp:AccessDataS ource>

<asp:GridView ID="GridView1" runat="server"
AutoGenerateCol umns="False"

DataSourceID="A ccessDataSource 1" Style="z-index: 100; left:
6px; position: absolute;

top: 7px" DataKeyNames="o rg"
OnSelectedIndex Changed="GridVi ew1_SelectedInd exChanged"
BorderStyle="No ne" PageSize="20">

<Columns>

<asp:HyperLinkF ield DataNavigateUrl Fields="org"
DataNavigateUrl FormatString="D etails.aspx?fie ld={0}"

DataTextField=" org" />

</Columns>

</asp:GridView>

<asp:AccessData Source ID="AccessDataS ource2" runat="server"
DataFile=""

OnSelecting="Ac cessDataSource2 _Selecting1"
SelectCommand=" SELECT Orgs.org, ThreeLetter.[position],
ThreeLetter.loc ation, [user].Name, rights.Type FROM (((Orgs INNER JOIN
ThreeLetter ON Orgs.ID = ThreeLetter.Org s_ID) INNER JOIN rights ON
ThreeLetter.off iceKey = rights.officeKe y) INNER JOIN [user] ON
rights.userKey = [user].userKey) ORDER BY Orgs.org"
FilterExpressio n="Org='@Org' ">

<FilterParamete rs><asp:Control Parameter Name="Org"
ControlID="Grid View1" PropertyName="S electedValue"
/></FilterParameter s>

</asp:AccessDataS ource>

<asp:GridView ID="GridView2" runat="server"
AutoGenerateCol umns="False" DataKeyNames="o rg,Name"

DataSourceID="A ccessDataSource 2" Style="z-index: 103; left:
115px; position: absolute;

top: 9px">

<Columns>

<asp:CommandFie ld HeaderText="Edi t Rights"
ShowEditButton= "True" ShowHeader="Tru e" />

<asp:BoundFie ld DataField="posi tion"
HeaderText="pos ition" SortExpression= "position" />

<asp:BoundFie ld DataField="loca tion"
HeaderText="loc ation" SortExpression= "location" />

<asp:BoundFie ld DataField="Type " HeaderText="Typ e"
SortExpression= "Type" />

</Columns>

</asp:GridView>

Jul 29 '06 #1
1 1674
Hi Brian,

The OleDb provider (used by AccessDataSourc e) uses ordered parameters, not named parameters. Also, because you have @Org quoted in
FilterExpressio n it's being used as a string literal. Try naming your parameter OrgParam and using it as is, without a prefix or
quotes directly in a WHERE clause of your query:

SELECT Orgs.Org
[...]
WHERE Org = OrgParam

The details grid should be hidden, by default, until the page is posted back when the user selects a master grid row and if there is
at least one child record to be displayed.

--
Dave Sexton

<br**********@w pafb.af.milwrot e in message news:11******** *************@p 79g2000cwp.goog legroups.com...
I'm trying to link a gridview to another gridview in a Master-Details
architecture. But the Details list isn't filtering like it is
suppossed to. It will show all items on page load and it won't remove
any items when an item in the Masters list is selected. It shouldn't
show anything until an item in the Master's list is selected and then
only show the details which are associated with the selected item in
the Masters list.
I'm new to ASP.NET (one of the last straglers moving from VBScript)
and, so, I'm probably doing something pretty stupid, but some help
would be really appreciated.
Here's the code

<asp:AccessData Source ID="AccessDataS ource1" runat="server"
DataFile=""

SelectCommand=" SELECT DISTINCT org FROM Orgs"
OnSelecting="Ac cessDataSource1 _Selecting1"></asp:AccessDataS ource>

<asp:GridView ID="GridView1" runat="server"
AutoGenerateCol umns="False"

DataSourceID="A ccessDataSource 1" Style="z-index: 100; left:
6px; position: absolute;

top: 7px" DataKeyNames="o rg"
OnSelectedIndex Changed="GridVi ew1_SelectedInd exChanged"
BorderStyle="No ne" PageSize="20">

<Columns>

<asp:HyperLinkF ield DataNavigateUrl Fields="org"
DataNavigateUrl FormatString="D etails.aspx?fie ld={0}"

DataTextField=" org" />

</Columns>

</asp:GridView>

<asp:AccessData Source ID="AccessDataS ource2" runat="server"
DataFile=""

OnSelecting="Ac cessDataSource2 _Selecting1"
SelectCommand=" SELECT Orgs.org, ThreeLetter.[position],
ThreeLetter.loc ation, [user].Name, rights.Type FROM (((Orgs INNER JOIN
ThreeLetter ON Orgs.ID = ThreeLetter.Org s_ID) INNER JOIN rights ON
ThreeLetter.off iceKey = rights.officeKe y) INNER JOIN [user] ON
rights.userKey = [user].userKey) ORDER BY Orgs.org"
FilterExpressio n="Org='@Org' ">

<FilterParamete rs><asp:Control Parameter Name="Org"
ControlID="Grid View1" PropertyName="S electedValue"
/></FilterParameter s>

</asp:AccessDataS ource>

<asp:GridView ID="GridView2" runat="server"
AutoGenerateCol umns="False" DataKeyNames="o rg,Name"

DataSourceID="A ccessDataSource 2" Style="z-index: 103; left:
115px; position: absolute;

top: 9px">

<Columns>

<asp:CommandFie ld HeaderText="Edi t Rights"
ShowEditButton= "True" ShowHeader="Tru e" />

<asp:BoundFie ld DataField="posi tion"
HeaderText="pos ition" SortExpression= "position" />

<asp:BoundFie ld DataField="loca tion"
HeaderText="loc ation" SortExpression= "location" />

<asp:BoundFie ld DataField="Type " HeaderText="Typ e"
SortExpression= "Type" />

</Columns>

</asp:GridView>

Jul 30 '06 #2

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

Similar topics

0
1273
by: Cold Filtered | last post by:
Hi, I have a .master file page with the following in <head> <script src="javascript/common.js" type="text/javascript" /> This works fine for any .aspx files in the same directory as the ..master file. When I navigate to a subdirectory in the application to a .aspx file
1
1288
by: Friso Wiskerke | last post by:
Hi All, We've got an VS.2003 ASPNET (VB) webproject which we would like to convert to VS.2005 so that we can make use of the Master Page feature. Converting the initial pages to 2005 is not such a problem (some minor errors) but we run into trouble when we're trying to insert a converted page into a master page content-placeholder. The original page has some Javascript in it which ofcourse references to controls in a form in the page....
4
1868
by: EagleRed | last post by:
I am writing an ASP.NET 2.0 application that uses more than one master page. Currently, there are two pages, Freedom1.master and Freedom2.master. I have no problems with Freedom1.master. However, I am having problems with Freedom2.master. The first problem is I sometimes get the following error when I build the site. The type 'Freedom2' exists in both 'c:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET
3
1865
by: fstenoughsnoopy | last post by:
Ok the complete story. I have a Contact Table, Query and Form, that are used to input and store the contact info for customers. They have FirstName, LastName and Address as the primary key fields to keep out duplicates. I am trying to put a full name box on the query, that uses the FirstName, LastName and Middle Initial and puts them together to form a full name. That I have so far. On my order database(consisting of a master table with...
0
1391
by: Michel Laurent | last post by:
Hi, I can't catch the menuitemclick event on a master page. Working with VS2005.net, having a Menu1_MenuItemClick method that handles menuitemclick event and having declared in the aspx code the onmenuitemclick="Menu1_MenuItemClick"; the event is not catch. Why ? missing something ? Laurent
2
9434
by: sj | last post by:
I am just learning to use Tkinter and am having problems displaying image files. I am able to display an image using tutorials (such as http://www.daniweb.com/code/snippet296.html) But when I try my own code all I get is an empty widget. What is wrong with the following program? from Tkinter import *
3
1625
by: Jeff | last post by:
Hey! ASP.NET 2.0 I have a webpage which is based on a nested master page. The problem is that I've applied a theme to the webpage but the CSS settings isn't applied to the panes.... As you will see in the link, a label market "rightpane" is placed to the left. It should have been on the right, and have a different color.
8
3155
sonic
by: sonic | last post by:
I am having trouble passing two variable types into my printPattern function. I need to pass rows and characterSelect from my getInput function into my printPattern function. I keep getting a "printPattern function does not take 0 arguments" error. I'm pretty sure this means nothing is being passed to my printPattern function, but I can't figure out why. Does anyone have any suggestions? Here's my code: // 11/26/06 // Program allows...
2
1434
by: Dave | last post by:
It seems that if I put just html inside a master page, everything works fine. But if I put other controls (such as WebControls and/or my own custom controls), I can't seem to access the content area in the designer (on the master page or the content page that uses the master page). The designer is just greyed out completely. It does seem to work at runttime, but this is a problem for usability. I must be doing something wrong. Here's a...
3
6950
by: Bobby Edward | last post by:
I had a simple admin form for "Categories"... Details View: To INSERT new Category Grid View: To View, Edit and Delete all Categories I decided to put the INSERT Details View inside of a ModalPopupExtender. PROBLEM 1: Dragging a ModalPopupExtender control to my webform gives me a gray box in Design View:
0
8376
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8290
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
8815
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...
0
8708
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8489
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
7307
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
5622
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
4149
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
4294
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?

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.