473,806 Members | 2,277 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

master detail datalist

I have a master detail datatable and add a relation
DataRelation relation = new DataRelation("P artNoRelation", Dt_Cart.Columns["PartNo"], Tbl_NearestCent ers.Columns["PartNo"],false);
Ds_CartItem.Rel ations.Add(rela tion);
when I try to add my detail to a radiobutton list in datalist(the master information are show in data list)I use this code
but it shows all the data in detail table not just the related one

private void DataList1_ItemD ataBound(object sender, System.Web.UI.W ebControls.Data ListItemEventAr gs e)
{
DataTable Tbl_Info= ( DataTable ) Session [ "myTable" ];
if (e.Item.ItemTyp e == ListItemType.It em || e.Item.ItemType == ListItemType.Al ternatingItem)
{

((RadioButtonLi st) e.Item.FindCont rol("dProducts" )).DataSource = ((DataRowView) e.Item.DataItem ).CreateChildVi ew("PartNoRelat ion").Table.Def aultView;
((RadioButtonLi st) e.Item.FindCont rol("dProducts" )).DataTextFiel d="WareHouseZip Code";
((RadioButtonLi st) e.Item.FindCont rol("dProducts" )).DataValueFie ld="WareHouseZi pCode";
((RadioButtonLi st) e.Item.FindCont rol("dProducts" )).DataBind();
((RadioButtonLi st) e.Item.FindCont rol("dProducts" )).AutoPostBack = true; }

}
I tried to check if my relation works
foreach(DataRow drPublisher in Tbl_Info.Rows) { Response.Write( drPublisher["PartNo"]);
Response.Write( "============== =======");

foreach(DataRow drTitle in drPublisher.Get ChildRows("Part NoRelation"))
{
Response.Write( drTitle["WareHouseZipCo de"]);
}
Response.Write( "<br>");
it works good and shows just the related information for each master detail
why doesnt' it work in my data list? }

--
Sagdude
Nov 16 '05 #1
0 1218

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

Similar topics

2
2016
by: Demetri | last post by:
Does anyone know of any good master-detail examples? I'm looking for as simple as you can get - with the ability to edit, add, and delete records. My trouble is that the main table i'm working with has a bazillion fields so therefore a datagrid would grow way too wide for the page and would look tacky. Therefore I want the datagrid to have only 4 or 5 basic fields and when a user clicks on one of the rows - below the grid there will be a...
6
1796
by: Beren | last post by:
Hi all I'm almost braindead on this one, but how can I create a master/detail datagrid in this format : CatA subcatA1 subcatA2 subcatA3
1
1428
by: ultraweaver | last post by:
Hi, I have a datalist and a gridview nested in the item template and trying to bind the gridview to the datalist. I am getting teh error... System.NullReferenceException: Object reference not set to an instance of an object. I am uncertain as to why. I have data. I am following this quick start file (but with my own data).
1
4033
by: yoknows | last post by:
Hello .Net Gurus. This is my first post here so I apologize in advance if I have not provided the right information. I hope someone has seen this problem before and can tell me what I am doing wrong. I have simplified the problem with the following example: Using asp.net 2.0, I have a Master page template used on default.aspx. >From within the Content tags on that page I placed a Datalist. It is iterating a User control "Inner" with...
1
2184
by: Sam | last post by:
Attached I am sending 2 URL's from MSFT ASP.net Quick Start Tutorial Web Site. 1) Run it URL: http://www.asp.net/QuickStart/aspnet/samples/data/GridViewMasterDetai... 2) View Source URL: http://www.asp.net/QuickStart/util/srcview.aspx?path=~/aspnet/samples...
0
1730
by: Mike Wilson | last post by:
Dear group, I have an invoice entry form, which is a simple Master fields / Detail grid. The main summary information of the invoice are stored in one table in a dataset, which is bound using a BindingSource (InvoiceBindingSource). The line details of each item in the invoice is held in a child table which is bound to another bindingsource (InvoiceRowsBindingSource). I took the basic design from an MSDN article, and all works well....
2
2289
by: John | last post by:
Hi I am trying to create a master/detail form. I have my master and details tables dragged onto the dataset. I have also dragged the fields from master table on the form which has created the navigation toolbar for me and which works fine with the master table. I also have a dataview on the same form ready for detail table but as yet not assigned to the detail table. How can I now create a master/detail relationship between my master and...
1
25014
by: Salim | last post by:
Hi, I'm trying to get UniqueID of a linkbutton. I have 2 web user controls. And a master page. In fisrst web user control there is a datalist. In datalist ItemCreated event, I try to find a linkbutton control which is in the second web user control and in another datalist.
0
778
by: mvmashraf | last post by:
Hai Every One(Help ME) I have a datalist in that using item template the data is loaded. When i click on the item the corresonding detailed informations is loaded. My doubt is when i clicked on the item on the datalist it will be post back and the details are loaded(the code is written in edit_Item command).When that post back if the selected item is in the bottom of the datalist after refresh the page the datalist is...
0
10366
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...
0
10110
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
9187
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...
1
7649
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6877
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
5678
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4329
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3850
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
3008
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.