Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / ASP.NET / General / February 2008

Tip: Looking for answers? Try searching our database.

format repeater row

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Scott - 11 Feb 2008 15:04 GMT
Is there a way to format a row within a repeater based on the data? If I
have my row (cell 0) text is "Used" I want that entire row to have a blue
background color. Is it possible to do that in the repeater?
Eliyahu Goldin - 11 Feb 2008 15:13 GMT
Sure. Handle the ItemDataBound event to set visual properties or, better,
the css class for the html control representing the row. To locate that
control in the repeater item, set the control id and runat="server" and call
e.Item.FindControl(myRowId).

It comes to something like this:
<ItemTemplate>
   <div runat="server" id="myRowId">
...
   </div>
</ItemTemplate>

Signature

Eliyahu Goldin,
Software Developer
Microsoft MVP [ASP.NET]
http://msmvps.com/blogs/egoldin
http://usableasp.net

> Is there a way to format a row within a repeater based on the data? If I
> have my row (cell 0) text is "Used" I want that entire row to have a blue
> background color. Is it possible to do that in the repeater?
Scott - 11 Feb 2008 15:24 GMT
I've tried that and its not picking up the formatting that I need.
example:
if my lable in the repeater equals, 'Used' the background for that row or
cell isn't changing colors or the font for that label is changing to a bold.

> Sure. Handle the ItemDataBound event to set visual properties or, better,
> the css class for the html control representing the row. To locate that
[quoted text clipped - 11 lines]
>> have my row (cell 0) text is "Used" I want that entire row to have a blue
>> background color. Is it possible to do that in the repeater?
Eliyahu Goldin - 11 Feb 2008 15:31 GMT
This simply means that your code doesn't do what you need. Debug it.

Signature

Eliyahu Goldin,
Software Developer
Microsoft MVP [ASP.NET]
http://msmvps.com/blogs/egoldin
http://usableasp.net

> I've tried that and its not picking up the formatting that I need.
> example:
[quoted text clipped - 17 lines]
>>> have my row (cell 0) text is "Used" I want that entire row to have a
>>> blue background color. Is it possible to do that in the repeater?

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.