Top DevX Stories
Creating Custom Export Filters for StarOffice with XSLT
WPF Wonders: Using DataTemplates
Crystal Reports Family Offers Options for Developers
Avaya Aura Session Manager video
Avaya Aura Overview video
Search the forums:

Go Back   DevX.com Forums > DevX Developer Forums > ASP.NET

Reply
 
Thread Tools Search this Thread Rate Thread Display Modes
  #1  
Old 11-03-2006, 02:25 PM
bmonchka bmonchka is offline
Registered User
 
Join Date: Nov 2006
Posts: 2
Using templates with custom repeater control

Hi. I want to create my own repeater control. I am not sure how to use templates with it (header, body, footer). How do I find the html and databinding expressions that are between the opening (<itemTemplate>) and closing (</itemTemplate>) xml tags and only repeat that portion of html and print the header and footer templates only once. If anyone has any sample VB code on how to do this or is able to explain this I would really appreciate it.

thanks so much,
Barret
Reply With Quote
  #2  
Old 11-03-2006, 02:40 PM
Phil Weber Phil Weber is offline
Super Moderator
 
Join Date: Nov 2003
Location: Portland, OR
Posts: 8,171
See if these help:
http://samples.gotdotnet.com/quickst...aspx#templated
http://msdn.microsoft.com/msdnmag/is...6/CuttingEdge/
__________________
Phil Weber
http://www.philweber.com

Please post questions to the forums, where others may benefit.
I do not offer free assistance by e-mail. Thank you!
Reply With Quote
  #3  
Old 11-03-2006, 03:35 PM
bmonchka bmonchka is offline
Registered User
 
Join Date: Nov 2006
Posts: 2
not quite

Thank you for your reply but that is not exactly what I am looking for.

I want to create a custom databound control to display search results of
products from an online store's database. I want to display a ceratain
amount of products per page and allow the user to be able to skip to
different pages, next page, prev page, display number of results etc.
So I want to use a for loop to print out the resulting products and stop the
loop when the incrementer hits a certain number and start the incrementer at
different numbers depending on what page the user is on.
That's easy enought to do, I could do that. However, I don't want any
of my html in my custom databound control. I want the custom databound
control's for loop to print out the values for the databinding expressions
<% Eval("whatever object property") %> within the template.

for ex:

<emptyResultSet>

Your search did not produce any results.....

</emptyResultSet>

<searchResult>

<table>
<tr>
<td>
<span style="whatever"><% Eval("ProductName") %></span>
<div style="whatever">< Eval("ProductPrice") %></span>
</td>
</tr>
</table>

</searchResult>

<resultSetInfo>

<table><tr><td>Next, Prev, First, Last (How many results)</td></tr></table>

</resultSetInfo>

I above html does not make any sense it is just an example. So, I don't
know how (from within the control) to get the html from the
<searchResult> opening and closing xml template tags and print that in
the for loop while evaluating the databinding expressions.


I hope you could help, thank you so much,

Barret
Reply With Quote
Reply

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Custom Control Properties Jugg .NET 2 03-07-2006 07:40 AM
Loading Custom Control onto the form Sync VB Classic 4 12-07-2005 02:21 AM
Set focus on a element inside a repeater control mannabaron ASP.NET 1 08-23-2005 08:42 AM
Failed to load control 'DataEditGrid' from custom ocx. szoli VB Classic 6 02-22-2005 03:12 AM
ListView Control and Custom Sorting Birhanu VB Classic 0 11-09-2001 04:26 PM


All times are GMT -4. The time now is 12:49 AM.


Sponsored Links



Acceptable Use Policy

internet.comMediabistrojusttechjobs.comGraphics.com

WebMediaBrands Corporate Info


Advertise | Newsletters | Feedback | Submit News

Legal Notices | Licensing | Permissions | Privacy Policy


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.