tips on how to produce a 'partitioned' datalist/datagrid

S

Stimp

I would like to produce something like:

http://redwoodestates.co.uk/forrent.aspx

It's either a datalist/repeater/datagrid, but it is broken up into
sections ("1 bedroom", "2 bedroom", etc...)

My experience with datalists is that you can have a <SeparatorTemplate>
between each row, but how do they manage to separate rows at random
intervals?

Are they using a <repeater> within each datalist <itemtemplate>
or something similar?

Thanks.
 
B

Bruce Barker

they probably did not not use a repeater, but just generated the table
directly, its faily trival.

-- bruce (sqlwork.com)
 
I

intrader

they probably did not not use a repeater, but just generated the table
directly, its faily trival.

-- bruce (sqlwork.com)
I use nested repeaters in master/detail configuration. The inner repeater
(detail) is data bound in the master repeater's onItemDataBound event.
(i.e.: a MasterRowAvailableHandler))
Mine is:
protected void MasterRowAvailableHandler(Object sender,
RepeaterItemEventArgs e){
try{
if(e.Item.ItemType == ListeItemType.Item || e.Item.ItempType ==
ListItemType.AlternatingItem){
((Repeater)e.Item.FindControl("DetailRepeater")).DataSource =
((DataRowViw)e.Item.DataItem).CreateChildView("MasterDetailRelation");
((Repeater)e.Item.FindControl("DetailRepeater")).DataBind();
}
etc. (exception handling)
The "MasterDetailRelation" is a DataRelation between the master and detail
tables as for example:
DataRelation rel = new DataRelation("MasterDetailRelation",
ds.Tables("Master").Columns["CommonColumn"],ds.Tables("Detail").Columns["CommonColumn"]);
ds.Relations.Add(rel).

//ds is the DataSet containing the two tables.
I hope this helps
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,774
Messages
2,569,596
Members
45,142
Latest member
arinsharma
Top