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
223 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
Master Your Team's Linux and Cloud Stack

Come see why top tech companies like Mailchimp and Media Temple use Linux Academy to build their employee training programs.

 
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 33

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

DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Modal Popup Extender control 1 20
Query still returning duplicates 5 30
If condition on Html with Asp 11 17
JSON  parse help 7 26
Foolproof security solutions has become one of the key necessities of every e-commerce or Internet banking website. If you too own an online shopping site then its vital for you to equip your web portal with customer security features that can allow…
A publishing tool, a Version Control System, or a Collaboration Platform! These can be some of the defining words for the two very famous web-hosting Git repositories: Bitbucket and Github. Git is widely used amongst the programmers and developers f…
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…
Use Wufoo, an online form creation tool, to make powerful forms. Learn how to choose which pages of your form are visible to your users based on their inputs. The page rules feature provides you with an opportunity to create if:then statements for y…

777 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