473,395 Members | 1,578 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,395 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 1591
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: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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
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
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
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...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
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...

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.