Solved

Can't I have my repeater inside a table?

Posted on 2011-03-18
1
1,068 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Re-position sub-options beneath the TAB 7 74
Problem to page 4 69
Achieve json result 2 64
Display mvc partial view with errors on parent page 1 26
Lots of people ask this question on how to extend the “MembershipProvider” to make use of custom authentication like using existing database or make use of some other way of authentication. Many blogs show you how to extend the membership provider c…
IntroductionWhile developing web applications, a single page might contain many regions and each region might contain many number of controls with the capability to perform  postback. Many times you might need to perform some action on an ASP.NET po…
This video demonstrates how to create an example email signature rule for a department in a company using CodeTwo Exchange Rules. The signature will be inserted beneath users' latest emails in conversations and will be displayed in users' Sent Items…
A company’s greatest vulnerability is their email. CEO fraud, ransomware and spear phishing attacks are the no1 threat to a company’s security. Cybercrime is responsible for the largest loss of money to companies today with losses projected to r…

929 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

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now