Solved

Can't I have my repeater inside a table?

Posted on 2011-03-18
1
1,079 Views
Last Modified: 2012-06-21
I have the code below which is basically my table with a repeater that will then display each row.

This was working fine until I had to add runat="server" and an id to my table.

I had to do this as I need to export the table to excel but I am now getting:
BC30311: Value of type 'System.Web.UI.WebControls.Repeater' cannot be converted to 'System.Web.UI.HtmlControls.HtmlTableRow'.

Is there any way around this?

Thanks in advance.
<table class="gridviewheader" runat="server" id="tblCostPrice" cellpadding="0" border="1" cellspacing="0">
        <tr>
            <th>
                Invoice Number
            </th>
            <th>
                Query
            </th>
        </tr>    
        <asp:Repeater ID="rptCostPrice" runat="server" >                                       
            <ItemTemplate>
            <tr>

Open in new window

0
Comment
Question by:scm0sml
1 Comment
 
LVL 4

Accepted Solution

by:
coolcurrent4u earned 500 total points
ID: 35164080
if you need to export the table to excel, there are two things you can do,

1. when generating the table, you can also generate a the data to export to excel by having a function that will convert the data if retrieved from database to a cvs format to export to excel
 
2. you can have a JavaScript function that will do the conversion by taking the table in the page and converting accordingly.

An example is found here
http://forums.asp.net/t/1259131.aspx
0

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

A quick way to get a menu to work on our website, is using the Menu control and assign it to a web.sitemap using SiteMapDataSource. Example of web.sitemap file: (CODE) Sample code to add to the page menu: (CODE) Running the application, we wi…
Introduction This article shows how to use the open source plupload control to upload multiple images. The images are resized on the client side before uploading and the upload is done in chunks. Background I had to provide a way for user…
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…

860 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question