473,503 Members | 10,245 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Repeater Question

Im using ASP.NET 2.0 and I have a repeater question.

I am trying to make a change to the ItemTemplate in the itemdatabound event.

Basically, this is a follow on from my previous question anyhow. I have rows
being display like so
Category Data Data Data
Green 1 2 3
Green 2 2 2
Blue 4 2 1
Blue 5 5 4
What I want out of my repeater "WHEN" the category changes

<tr>
<td colspan=4>'TheCategory"</td>
</td>
<tr>
<td>Category</td>
<td>Data1</td>
<td>Data2</td>
<td>Data3</td>
</tr>

And when "NOT CHANGED"
<tr>
<td>Category</td>
<td>Data1</td>
<td>Data2</td>
<td>Data3</td>
</tr>

So this would result in

Green
1 2 3
2 2 2

Blue
4 2 1
5 5 4
This means I have to manipulate the ItemTemplate, but im not sure how to go
about doing this in the Databound event. I need to hide / not display the
category row. Im sure there is an easy way to do this, but im struggling.
Cheers

Sep 18 '07 #1
1 2539
Put both rows in the ItemTemplate:

<itemtemplate>
<tr runat="server" id="headerRow">
<td colspan=4>'TheCategory"</td>
</td>
<tr>
<td>Category</td>
<td>Data1</td>
<td>Data2</td>
<td>Data3</td>
</tr>

<itemtemplate>

and hide is in either ItemDataBound or PreRender event as

item.FindControl("headerRow").Visible = false;

--
Eliyahu Goldin,
Software Developer
Microsoft MVP [ASP.NET]
http://msmvps.com/blogs/egoldin
http://usableasp.net
"Just Me" <news.microsoft.comwrote in message
news:u6****************@TK2MSFTNGP02.phx.gbl...
Im using ASP.NET 2.0 and I have a repeater question.

I am trying to make a change to the ItemTemplate in the itemdatabound
event.

Basically, this is a follow on from my previous question anyhow. I have
rows being display like so
Category Data Data Data
Green 1 2 3
Green 2 2 2
Blue 4 2 1
Blue 5 5 4
What I want out of my repeater "WHEN" the category changes

<tr>
<td colspan=4>'TheCategory"</td>
</td>
<tr>
<td>Category</td>
<td>Data1</td>
<td>Data2</td>
<td>Data3</td>
</tr>

And when "NOT CHANGED"
<tr>
<td>Category</td>
<td>Data1</td>
<td>Data2</td>
<td>Data3</td>
</tr>

So this would result in

Green
1 2 3
2 2 2

Blue
4 2 1
5 5 4
This means I have to manipulate the ItemTemplate, but im not sure how to
go about doing this in the Databound event. I need to hide / not display
the category row. Im sure there is an easy way to do this, but im
struggling.
Cheers



Sep 18 '07 #2

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

Similar topics

0
5381
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...
0
1655
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...
1
2299
by: Fraggle | last post by:
I have a repeater with controls added at run time. the <template> also contains a <asp:textbox that is made visible on some repeater elements. when I come to read the text info out it has...
8
4263
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...
1
5400
by: olduncleamos | last post by:
Hello all, I am experimenting with the repeater control and ran into something that I wasn't expecting. I would appreciate if the experts can confirm or correct my understanding. Here is a...
7
5466
by: charliewest | last post by:
Hello - I'm using a Repeater control to render information in a very customized grid-like table. The Repeater control is binded to a DataSet with several records of information. Within the...
3
2099
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> <%#...
3
437
by: GD | last post by:
I need to bind my repeater to a DataSet for which the number of columns is always different (cross-tab report). However, I need to exlude an Id column from displaying on the Repeater. As shown...
3
9153
by: Brian | last post by:
Using external XML, I'm trying to build a quiz, but I can't seem to specify the DataSource for the RadioButtonList within a Repeater ItemTemplate. I've tried a number of approaches, but I haven't...
12
2144
by: =?Utf-8?B?Qi4gQ2hlcm5pY2s=?= | last post by:
I'm doing a web app in VB/Dot Net 2.0. I'm probably a bit rusty and I have no experience using the repeater control. I have a user control I've created with multiple properties. I've created a...
0
7193
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
7067
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...
0
7316
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...
1
6975
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
5562
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,...
1
4992
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new...
0
3148
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
728
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
371
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

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.