Solved

I am attempting to use a repeater to obtain multiple columns of data by year within an existing repeater by topic

Posted on 2014-09-30
7
217 Views
Last Modified: 2014-11-04
I am attempting to use a repeater to obtain multiple columns of data by year within an existing repeater by topic.

The number of years is variable so cannot be done as a static row.

This is a sample of the existing report and I would like to add a repeater to duplicate the Average column for each year in the list of years available.

•  This Preceptorship enabled me to
      Average
Obtain and record a thorough and reliable history.      
Obtain and record a thorough and reliable physical exam.      
Develop a problem list.      
Develop a list of possible etiologies (differential diagnosis.)      
Order appropriate studies.      
Recommend rational therapy.      
Communicate with health team.      
Increase proficiency in technical procedures.      
Increase knowledge of patient problems in primary care.      
Average of Above Ratings      

I’ve been experimenting and just can’t get the syntax right to generate the multiple columns.

This is the first few rows of code before adding a repeater.

                  <div class="indent" ">
                  <li class="label" style="margin-top:20px;">This Preceptorship enabled me to:</li>

<asp:Table ID="Table2" GridLines="Both" runat="server" >
         <asp:TableHeaderRow ID="TableHeaderRow1"  runat="server" >
                  <asp:TableHeaderCell ID="TableHeaderCell1" ColumnSpan="30"   HorizontalAlign="Left"  runat="server" TabIndex="0"
                 Text="" Wrap="True" />
                  <asp:TableHeaderCell ID="TableHeaderCell2" ColumnSpan="10"   HorizontalAlign="Right"  runat="server" TabIndex="1"
                 Text="Average" Wrap="True" />
                         
         </asp:TableHeaderRow >

         <asp:TableRow ID="TableRow41"  runat="server" >
                 <asp:TableCell ID="TableCell3" colspan="30"   HorizontalAlign="Left"  runat="server"  
                 Text="Obtain and record a thorough and reliable physical history." Wrap="False" />
                  <asp:TableCell ID="TableCell4"  width="4"    HorizontalAlign="Right"  runat="server"  aria-readonly="true" >
                 <input type = "text" value='<%#DataBinder.Eval(Container.DataItem, "objHistory")%>'" Wrap="False" >
                          </asp:TableCell>
         </asp:TableRow >

         <asp:TableRow ID="TableRow42"  runat="server" >
                 <asp:TableCell ID="TableCell5" colspan="30"   HorizontalAlign="Left"  runat="server"  
                 Text="Obtain and record a thorough and reliable physical exam." Wrap="False" />
                  <asp:TableCell ID="TableCell6"  width="4"    HorizontalAlign="Right"  runat="server"  aria-readonly="true" >
                 <input type = "text" value='<%#DataBinder.Eval(Container.DataItem, "objExam")%>'" Wrap="False" >
                          </asp:TableCell>
         </asp:TableRow >

         <asp:TableRow ID="TableRow3"  runat="server" >
                 <asp:TableCell ID="TableCell15" colspan="30"   HorizontalAlign="Left"  runat="server"  
                  Text="Develop a problem list." Wrap="False" />
                  <asp:TableCell ID="TableCell16"  width="4"    HorizontalAlign="Right"  runat="server"  aria-readonly="true" >
                 <input type = "text" value='<%#DataBinder.Eval(Container.DataItem, "objList")%>'" Wrap="False" >
                          </asp:TableCell>
         </asp:TableRow >

 
         <asp:TableRow ID="TableRow4"  runat="server" >
                 <asp:TableCell ID="TableCell22" colspan="30"   HorizontalAlign="Left"  runat="server"  
                 Text="Develop a list of possible etiologies (differential diagnosis.)" Wrap="False" />
                  <asp:TableCell ID="TableCell23"  width="4"    HorizontalAlign="Right"  runat="server"  aria-readonly="true" >
                 <input type = "text" value='<%#DataBinder.Eval(Container.DataItem, "objEtiologies")%>'" Wrap="False" >
                          </asp:TableCell>
         </asp:TableRow >
0
Comment
Question by:jrwalker1048
  • 3
  • 2
7 Comments
 
LVL 96

Expert Comment

by:Bob Learned
ID: 40363598
I don't see a Repeater, I see a <table> element.  If you have a table layout, did you try binding to a GridView?
0
 

Author Comment

by:jrwalker1048
ID: 40364233
I don’t have a repeater in the example because none of my attempts worked so I just included the base code for information on how to add the repeater for multiple columns.

If there is another way to add a variable number of columns that would be fine but every page may have a different number of columns so I thought a repeater would work.

thanks
0
 

Author Comment

by:jrwalker1048
ID: 40364252
Do you have sample code I can try?

Thank you for your expertise. Truly appreciated!
0
What Security Threats Are You Missing?

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

 
LVL 96

Accepted Solution

by:
Bob Learned earned 500 total points
ID: 40364788
With ASP.NET and the GridView, the binding depends on the type of data.

Here are some examples:

ASP.NET Quickstart Tutorials
http://quickstarts.asp.net/QuickStartv20/aspnet/doc/ctrlref/data/gridview.aspx

GridView + SqlDataSource Example:

  <asp:GridView ID="GridView1" DataSourceID="SqlDataSource1" AutoGenerateColumns="False"
      runat="server">
      <Columns>
        <asp:BoundField HeaderText="ID" DataField="au_id" ReadOnly="true" />
        <asp:BoundField HeaderText="Last Name" DataField="au_lname" />
        <asp:BoundField HeaderText="First Name" DataField="au_fname" />
        <asp:BoundField HeaderText="Phone" DataField="phone" />
        <asp:BoundField HeaderText="Address" DataField="address" />
        <asp:BoundField HeaderText="City" DataField="city" />
        <asp:BoundField HeaderText="State" DataField="state" />
        <asp:BoundField HeaderText="Zip Code" DataField="zip" />
        <asp:CheckBoxField HeaderText="Contract" DataField="contract" />
      </Columns>
    </asp:GridView>
    <asp:SqlDataSource ID="SqlDataSource1" runat="server" 
      SelectCommand="SELECT [au_id], [au_lname], [au_fname], [phone], [address], [city], [state], [zip], [contract] FROM [authors]"
      ConnectionString="<%$ ConnectionStrings:Pubs %>" />

Open in new window

0
 
LVL 32

Expert Comment

by:Big Monty
ID: 40422391
I've requested that this question be closed as follows:

Accepted answer: 500 points for Bob Learned (TheLearnedOne)'s comment #a40364788

for the following reason:

This question has been classified as abandoned and is closed as part of the Cleanup Program. See the recommendation for more details.
0
 

Author Closing Comment

by:jrwalker1048
ID: 40422392
Thank you for your assistance
0

Featured Post

Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

Join & Write a Comment

Thoughout my experience working on eCommerce web applications I have seen applications succumbing to increased user demand and throughput. With increased loads the response times started to spike, which leads to user frustration and lost sales. I ha…
Introduction A frequently used term in Object-Oriented design is "SOLID" which is a mnemonic acronym that covers five principles of OO design.  These principles do not stand alone; there is interplay among them.  And they are not laws, merely princ…
This video teaches viewers how to create their own website using cPanel and Wordpress. Tutorial walks users through how to set up their own domain name from tools like Domain Registrar, Hosting Account, and Wordpress. More specifically, the order in…
Learn how to set-up custom confirmation messages to users who complete your Wufoo form. Include inputs from fields in your form, webpage redirects, and more with Wufoo’s confirmation options.

708 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

14 Experts available now in Live!

Get 1:1 Help Now