Avatar of ggaarryy
ggaarryy

asked on 

how to get values from repeater cells

I need to get some cell values from a repeater in a clicked button event by looping thru the repeater. I want to get the "teamnumber" and the "totalwins" values.
 
          foreach (RepeaterItem item in Repeater1.Items)
           {
               // This doesn't work and i dont know how to code this
               teamnumber = ((DataBoundLiteralControl)item.Controls[0]).Text;

           }

        <table id="ScheduleTable" style="display: none">
            <asp:Repeater ID="Repeater1" runat="server" DataSourceID="SqlDataSourceScheduleRepeater">
                <ItemTemplate>
                    <tr>
                        <td>
                            <%# Eval("TeamNumber") %>
                        </td>
                        <td>
                            <%# Eval("TotalWins") %>
                        </td>
                    </tr>
                </ItemTemplate>
            </asp:Repeater>
        </table>

        <asp:SqlDataSource ID="SqlDataSourceScheduleRepeater" runat="server" ConnectionString="<%$ ConnectionStrings:CISoftballConnectionString %>"
            SelectCommand="SELECT Teams.TeamNumber, COUNT(Teams.TeamNumber) AS TotalWins FROM Leagues INNER JOIN Teams ON Leagues.Year = Teams.Year AND Leagues.LeagueId = Teams.LeagueId INNER JOIN ScheduleTeams ON Teams.TeamNumber = ScheduleTeams.TeamIdWon WHERE (Leagues.Year = '2011') AND (Leagues.LeagueId = @lid) GROUP BY Teams.TeamNumber">
            <SelectParameters>
                <asp:ControlParameter ControlID="DropDownListLeagues" Name="lid" PropertyName="SelectedValue" />
            </SelectParameters>
        </asp:SqlDataSource>
ASP.NET

Avatar of undefined
Last Comment
ggaarryy
Avatar of Rahul Agarwal
Rahul Agarwal
Flag of India image

Avatar of ggaarryy
ggaarryy

ASKER

. I don't have a asp:label in my html nor do  i have a checkbox so i still dont know how to do it.

 
ASKER CERTIFIED SOLUTION
Avatar of edemcs
edemcs
Flag of United States of America image

Blurred text
THIS SOLUTION IS ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
Avatar of ggaarryy
ggaarryy

ASKER

I've requested that this question be deleted for the following reason:

not answered to my satisfaction
Avatar of edemcs
edemcs
Flag of United States of America image

These solutions should work.  Can you clarify why it was not met to your satisfaction?  Code examples and explanations were given.
Avatar of ggaarryy
ggaarryy

ASKER

I don't have time for this but if you understand my original question you will see that my question was not answered.
Avatar of edemcs
edemcs
Flag of United States of America image

Sorry to inconvenience you but we give you our time to help you out with your issues.
Avatar of ggaarryy
ggaarryy

ASKER

was my question answered?
Avatar of ggaarryy
ggaarryy

ASKER

question:I need to get some cell values from a repeater in a clicked button event by looping thru the repeater. I want to get the "teamnumber" and the "totalwins" values.
answer :you don't need the foreach, just do below.
-------------------------------------------------------------------------
expert comment :Please check these Links:
http://www.tek-tips.com/viewthread.cfm?qid=1209235&page=1
http://stackoverflow.com/questions/681057/retrieve-the-value-of-td-in-repeater 

my comment:  I don't have a asp:label in my html nor do  i have a checkbox so i still dont know how to do it.
--------------------------------------------------------------------------
my comment::  was my question answered?

expert comment: EE policy requires you to respond to all Expert comments before deleting your question (and it's just common courtesy). Also, EE is a highly collaborative environment, and as such the Experts expect you to respond to their suggestions so that they may continue assisting you. Failing to respond to Expert comments, as you did in this question, would lead the Expert to assume that you are no longer interested in pursuing a solution. Also, other experts who vie question would see that you've not responded, and would assume you've either lost interest or no longer require a solution.

I'd also caution you against the tone of your responses. There's little to be gained by being combative, and you are expected to remain professional in all dealings with other EE members.
-------------------------------------------------------------------------------------------
I did respond to the experts comments and I then i found a solution to my problem on my own.
Then i got emails that i should close the question. so i tried to close the question and then i have to have a reason for closing the question. So i gave a reason and the reason wasn't good enough.
What is the tone of this comment from EE?  (These solutions should work.  Can you clarify why it was not met to your satisfaction?  Code examples and explanations were given. )  This is when I said i didn't have time for this. I am on to something else now and this should be behind me. I guess if i am not a good customer i should probably cancel. I have had previous questions answered and awarded the points to the expert. sorry about all this.
ASP.NET
ASP.NET

The successor to Active Server Pages, ASP.NET websites utilize the .NET framework to produce dynamic, data and content-driven web applications and services. ASP.NET code can be written using any .NET supported language. As of 2009, ASP.NET can also apply the Model-View-Controller (MVC) pattern to web applications

128K
Questions
--
Followers
--
Top Experts
Get a personalized solution from industry experts
Ask the experts
Read over 600 more reviews

TRUSTED BY

IBM logoIntel logoMicrosoft logoUbisoft logoSAP logo
Qualcomm logoCitrix Systems logoWorkday logoErnst & Young logo
High performer badgeUsers love us badge
LinkedIn logoFacebook logoX logoInstagram logoTikTok logoYouTube logo