473,660 Members | 2,428 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Repeater/DataBinder Question

Here's my asp:Repeater

<asp:Repeater ID="rptHelpDesk SystemStatus" Runat="server">
<HeaderTemplate >
<table width="100%" border="0" class="datatabl e">
<tr class="item">
</HeaderTemplate>
<ItemTemplate >
<td align="center">
<asp:Label ID="lblService " Runat="server" Text='<%#
DataBinder.Eval (Container, "DataItem.Servi ce").ToString() %>'/>
<br/>
<asp:Image ID="imgStatus" Runat="server"
ImageUrl='<%#st ring.Concat("../img/SystemStatus_",
DataBinder.Eval (Container, "DataItem.Statu s").ToString (), ".gif")%>'/>
</td>
</ItemTemplate>
<FooterTemplate >
</tr>
</table>
</FooterTemplate>
</asp:Repeater>

I'd like to add a header row in my HeaderTemplate, the problem is, I have to
set a ColSpan on it based on the number of rows in my DataSet (the
DataSource of my Repeater)

So I'd like my HeaderTemplate to look like this:
<HeaderTemplate >
<table width="100%" border="0" class="datatabl e">
<tr class="header">
<td colspan='<%# %>'>
</tr>
<tr class="item">
</HeaderTemplate>
<td colspan='<%# %>'> .... How can I get the number of rows in my datasource
into here...

I looked up DataBinder.GetP ropertyValue ... but I can't find an enumeration
of the property names.
Thank You!


Nov 18 '05 #1
2 1275
> I'd like to add a header row in my HeaderTemplate, the problem is, I have
to set a ColSpan on it based on the number of rows in my DataSet (the
DataSource of my Repeater)


Not a direct answer, but instead of using a TD with a 'header' class, you
could consider using a caption tag and style it via CSS:

http://www.w3schools.com/tags/tag_caption.asp

-Darrel
Nov 18 '05 #2
Thank you!!
Why have I never heard of this "caption" tag!!?? hahah

"Darrel" <no*****@nospam .com> wrote in message
news:%2******** ********@TK2MSF TNGP12.phx.gbl. ..
I'd like to add a header row in my HeaderTemplate, the problem is, I have
to set a ColSpan on it based on the number of rows in my DataSet (the
DataSource of my Repeater)


Not a direct answer, but instead of using a TD with a 'header' class, you
could consider using a caption tag and style it via CSS:

http://www.w3schools.com/tags/tag_caption.asp

-Darrel

Nov 18 '05 #3

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

Similar topics

0
1665
by: Fraggle | last post by:
I am using PlaceHolders in a Repeater to generate a multi choice survey. I need a way of testing to see what the placeholder has been turned into at runtime, and reading out the data. The admin can add questions to a survey, then add possible answers to each question. Certain functions are also set, for example multi answer (display with a checkboxlist) single answer (radiolist). Also toggle the presence of an "other" selection which...
1
1697
by: Viktor Popov | last post by:
Hi, I'm trying to do the following: I use a repeater control in ASP.NET/C# because I would like to show the content of one DataSet which is filled from SELECT QUERY. In DataSource I have the detailed information for all advertisements which met the criteria of the QUERY. With the Repeater I show only one part from this information. In other words if I have in DataSet 12 columns, I show 6. What I would like to do is to make the first...
3
2103
by: Andrew | last post by:
Hi, I am working on a questionnaire. I have displayed a questionnaire using a repeater control. The itemtemplate is as below (quite cut down): <ItemTemplate> <tr><td> <%# DataBinder.Eval(Container.DataItem, "question")%> </td></tr> <tr><td>
0
282
by: erin.sebastian | last post by:
Hello All, I have created a web page. At the top of the page there are 4 links; upon clicking on one of the links it brings up the left hand side menu, it's a repeater that loops through items selected from the database based on the id of the link chosen from the link at the top of the page. The page that displays the information is the same page for each menu item as the details are stored in the database and selected based on the id...
0
4090
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 that my second repeater has the following error, System.NullReferenceException: Object reference not set to an instance of an object. When I put a watch on I can see my second repeater is not being created because it is equal to "Nothing". I can...
0
8428
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8341
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
1
8542
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8630
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7362
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5650
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4343
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2760
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
1984
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.