473,402 Members | 2,061 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,402 software developers and data experts.

master detail datalist

I have a master detail datatable and add a relation
DataRelation relation = new DataRelation("PartNoRelation", Dt_Cart.Columns["PartNo"], Tbl_NearestCenters.Columns["PartNo"],false);
Ds_CartItem.Relations.Add(relation);
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_ItemDataBound(object sender, System.Web.UI.WebControls.DataListItemEventArgs e)
{
DataTable Tbl_Info= ( DataTable ) Session [ "myTable" ];
if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem)
{

((RadioButtonList) e.Item.FindControl("dProducts")).DataSource = ((DataRowView) e.Item.DataItem).CreateChildView("PartNoRelation") .Table.DefaultView;
((RadioButtonList) e.Item.FindControl("dProducts")).DataTextField="Wa reHouseZipCode";
((RadioButtonList) e.Item.FindControl("dProducts")).DataValueField="W areHouseZipCode";
((RadioButtonList) e.Item.FindControl("dProducts")).DataBind();
((RadioButtonList) e.Item.FindControl("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.GetChildRows("PartNoRelation"))
{
Response.Write(drTitle["WareHouseZipCode"]);
}
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 1206

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

Similar topics

2
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...
6
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
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...
1
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...
1
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:...
0
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...
2
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...
1
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...
0
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...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
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,...
0
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...
0
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,...
0
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...

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.