473,320 Members | 1,887 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,320 software developers and data experts.

asp.net repeater

I need to do 2 things with the repeater control

1- in the html output give a unique template(color, font size) to the first
item (not alternate) and only the first.
The datasource of the repeater is an objectdatasource from a business object
that returns a generic list
<myItem> results

2. Set a property of the first item as the html page.title.
//psudo code
Page.Title = objDataSource1.firstItem.Name;

Thanks for your help

Howard
Mar 23 '06 #1
3 1291
How about hooking into the ObjectDataSource.ObjectCreated event?
in it you could write sth like this:

BusinessObjectCollection o = e.ObjectInstanceCollection as
BusinessObjectCollection;
if ((o != null) && (o.Count > 0))
{
Page.Title = o[0].PropertyName;
}
"Howard" wrote:
I need to do 2 things with the repeater control

1- in the html output give a unique template(color, font size) to the first
item (not alternate) and only the first.
The datasource of the repeater is an objectdatasource from a business object
that returns a generic list
<myItem> results

2. Set a property of the first item as the html page.title.
//psudo code
Page.Title = objDataSource1.firstItem.Name;

Thanks for your help

Howard

Mar 23 '06 #2
Sorry, forgot about issue no.1
You can hook into the Repeater.ItemDataBound event and check whether the
item being bound is a) a ListItem and b) the first one. If yes, assign the
control in your repeateritem that encapsulates the content a cssclass that
specifies both the color and font size.

"Howard" wrote:
I need to do 2 things with the repeater control

1- in the html output give a unique template(color, font size) to the first
item (not alternate) and only the first.
The datasource of the repeater is an objectdatasource from a business object
that returns a generic list
<myItem> results

2. Set a property of the first item as the html page.title.
//psudo code
Page.Title = objDataSource1.firstItem.Name;

Thanks for your help

Howard

Mar 23 '06 #3
it's working

thank you

"pali" <pa**@discussions.microsoft.com> wrote in message
news:5D**********************************@microsof t.com...
Sorry, forgot about issue no.1
You can hook into the Repeater.ItemDataBound event and check whether the
item being bound is a) a ListItem and b) the first one. If yes, assign the
control in your repeateritem that encapsulates the content a cssclass that
specifies both the color and font size.

"Howard" wrote:
I need to do 2 things with the repeater control

1- in the html output give a unique template(color, font size) to the
first
item (not alternate) and only the first.
The datasource of the repeater is an objectdatasource from a business
object
that returns a generic list
<myItem> results

2. Set a property of the first item as the html page.title.
//psudo code
Page.Title = objDataSource1.firstItem.Name;

Thanks for your help

Howard

Mar 25 '06 #4

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

Similar topics

0
by: Ed Allan | last post by:
http://ejaconsulting.com/nestedrepeater/NestedRepeater.txt >-----Original Message----- >Doh! The HTML has all been rendered . . . > >Right click on this link and select 'Save target as ..' >to...
8
by: Invalidlastname | last post by:
Hi, We are developing an asp.net application, and we dynamically created certain literal controls to represent some read-only text for certain editable controls. However, recently we found an issue...
8
by: I am Sam | last post by:
Hi everyone, This problem is making me old. I don't want to get any older. I have a multi-nested repeater control as follows: <asp:Repeater ID="clubRep1" Runat="server">...
2
by: mark | last post by:
(not sure if this is the correct group) My problem is I need to have a "nested" repeater. I have an array which I load into a hashtable - that part works great. I can setup the second repeater...
2
by: GD | last post by:
I'd like to use a Repeater to display data coming back from a cross-tab report. Because it's a cross-tab, I generally don't know how many columns are coming back. They do follow a certain format: ...
8
by: fernandezr | last post by:
I would like to use a user control as a template inside a repeater. Some of the fields in the control should be hidden depending on whether or not there is data. I'm still a ASP .Net newbie so the...
4
by: Brad Baker | last post by:
I'm going a little crazy :) I'm trying to bind a repeater control to a dataset on page load using the following code: if (Request.QueryString != null) { string customerid = Request.QueryString;...
0
by: uncensored | last post by:
Hello everyone, I'm fairly new at .Net and I have a repeater inside a repeater problem. I will attach my code to this message but basically what I am able to tell when I run my page it tells me...
7
by: | last post by:
I have what's probably a simple page lifecycle question related to dynamically evaluating values that are placed by a repeater and dynmically placing user controls that use those values. I'm...
3
by: Emma Middlebrook | last post by:
Hi there, I've been trying to implement a repeater control in an ASP.NET 2 page but I can't seem to get the layout exactly how I want and I'm not sure if it's something that I am doing wrong or...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...

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.