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 / September 2007

Tip: Looking for answers? Try searching our database.

Question On A Web Control

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Just Me - 18 Sep 2007 15:11 GMT
If this is already posted, please excuse me, I sent it to the server but it
never appeared

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
bruce barker - 18 Sep 2007 16:36 GMT
just write a function that return the category name or "&nbsp;", and use
it in the binding expression.

hint: pass the Databinder instance to the function.

you can also catcg the databind event and do it there.

-- bruce (sqlwork.com)

> If this is already posted, please excuse me, I sent it to the server but it
> never appeared
[quoted text clipped - 47 lines]
>
> Cheers
Just Me - 18 Sep 2007 23:00 GMT
Ive sorted it now thanks.

It was quite easy in the end and I got exactly the result I wanted

> just write a function that return the category name or "&nbsp;", and use
> it in the binding expression.
[quoted text clipped - 61 lines]
>>
>> Cheers

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.