Wrox Home  
Search P2P Archive for: Go

  Return to Index  

aspx_professional thread: Nested DataList


Message #1 by dgarner@g... on Sat, 18 May 2002 02:17:03
Reference of WEB Controls with examples you may find in MSDN and many
examples is on www.gotdotnet.com.
I sending to you fragment of my code, which is an example of
DataRepeater control and Datagrid. Work with datalist is very similar
(identical). Event ItemDataBound is fired after databound of every one
item is done. In this event you may work with other controls, which is
declared in <ItemData tag> (each item in datalist/datarepeater has its
unique naming scope).

Ad ASPImage) I know nothing about ASPImage component, sorry

Hope it helps

ReS
		private void Repeater1_ItemDataBound(Object Sender,
RepeaterItemEventArgs e)
		{
			//Reference to actual item after its databound
			RepeaterItem myitem =3D e.Item;
			
		=09
			// Reference to datagrid, which is declared in
<ITEMTEMPLATE> tag.

			DataGrid myl =3D (DataGrid)
myitem.FindControl("dgMaterials");
			if (myl !=3D null)
			{
				//Reference to label, where I store
unique ID of RECIPE - this code is part of Kitchen Book project :)
				Label
reclabel=3D(Label)myitem.FindControl("lblrec_id");
				//save recipes id to variable
				string recid =3D reclabel.Text;
				//DataView will be datasource for
datagrid
				DataView matview
=3DdsRecipes.Tables["Materials"].DefaultView;
				//display only materials of current
recipe
				matview.RowFilter=3D"RECIPES_ID=3D" + recid;
				//SET DATASOURCE OF DATAGRID
				myl.DataSource =3D matview;
				//CALL DATABIND, datagrid displays its
content in webform
				myl.DataBind();
			}
		}


-----Original Message-----
From: Rakesh [mailto:barjatiyarakesh@h...]
Sent: Sunday, May 19, 2002 8:22 PM
To: ASPX_Professional
Subject: [aspx_professional] RE: Nested DataList


dear asp expert
    please tell some thing about DATALIST.if posible with example or
send me the url of live example [if have that url].

There is another query i have please help me if you can.

 I want to set up ASPimage component in my local pc. i have the
evaluation copy of ASPimage component and it's crack code. i know how i
can register it [regsvr32 path/comp.dll] but i don't know how can i
crack it co i can use it after evaluation period. please help me and
hope you will give me prompt reply.

Thanks
Rakesh

----- Original Message -----
From: "Ren=E9 Stein" <stein@t...>
To: "ASPX_Professional" <aspx_professional@p...>
Sent: Saturday, May 18, 2002 10:08 AM
Subject: [aspx_professional] RE: Nested DataList


> Try ITEMDATABOUND event on first datalist. In this event find your
> second datalist and then set its datasource and datamember property,
> then call its databind method.
>
> -----Original Message-----
> From: dgarner@g... [mailto:dgarner@g...]
> Sent: Saturday, May 18, 2002 2:17 AM
> To: ASPX_Professional
> Subject: [aspx_professional] Nested DataList
>
>
> Has anyone succeeded at nesting a DataList within a DataList.  I can't

> seem to get it to work.  Can someone steer me to some sample code or
> something?
>
> I dragged a DataList onto the form.  Switched to the ItemTemplate
> editor
>
> and then added another DataList inside that one.  The DataSource for
> both DataLists is the same, however, the DataTable for each one is
> different.
>
> I used the Databinder.Eval() method to get the data from the dataset
> into the DataLists but it balks saying that code blocks are supported
> in this
>
> manner.
>
> Any clues?
>
> ---
> Change your mail options at http://p2p.wrox.com/manager.asp or to
> unsubscribe send a blank email to 
>
>
> ---
> Change your mail options at http://p2p.wrox.com/manager.asp or to
> unsubscribe send a blank email to
>



  Return to Index