Click here to Skip to main content
15,847,750 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I have a gridview, in which i repeat coursenames and Progressbar using div. I have used the jquery from the link http://jqueryui.com/demos/progressbar/

I want the jquery progressbar to be repeated everytime a Coursename gets repeated in the inside grid but for some reason the jquery Progressbar only get picked up once.Progressbar is displayed only once.

Please help
Thanks,
Jesu

If you wish please refer the code. this div tag is a problem.
XML
<div style="width: 20%; text-align: center">
                                                                        <div id="progressbar">
                                                                        </div>
                                                                    </div>




XML
<asp:GridView ID="gvCourse" runat="server" AutoGenerateColumns="False" AllowPaging="True"
                  SkinID="gv3" PageSize="2" AllowSorting="True" BorderStyle="Dotted" OnPageIndexChanging="gvCourseList_PageIndexChanging">
                  <Columns>
                      <asp:TemplateField HeaderText="Enrolled Course List" HeaderStyle-CssClass="mpeCaption">
                          <ItemTemplate>
                              <div class="content_inner floatLeft">
                                  <div class="box-content floatLeft">
                                      <div class="inside floatLeft">
                                          <div class="list_box_learner_page floatLeft">
                                              <div class="list_box_des_learner_page floatLeft">
                                                  <div>
                                                      <div class="c_itemtxt">
                                                          <p>
                                                              <span class="bold">
                                                                  <asp:Label ID="Label1" runat="server" Text='<%#DataBinder.Eval(Container.DataItem, "CourseName")%>'></asp:Label>
                                                              </span>
                                                          </p>
                                                          &nbsp;
                                                          <p>
                                                              Completion Status
                                                          </p>
                                                          <p>
                                                              <span>
                                                                  <div style="width: 20%; text-align: center">
                                                                      <div id="progressbar">
                                                                      </div>
                                                                  </div>
                                                              </span>
                                                          </p>
                                                          &nbsp;
                                                          <p>
                                                          </p>
                                                          &nbsp;
                                                          <p style="padding: 5px 2px 10px 0px;">
                                                              <asp:Button ID="Button3" CssClass="NormalButton" runat="server" Text="View Course Content" />
                                                          </p>
                                                          &nbsp;
                                                          <p>
                                                              <asp:Button ID="Button4" CssClass="CancelButton" runat="server" Text="Cancel Enrollment" />
                                                          </p>
                                                          &nbsp;
                                                          <p>
                                                              <span class="">Note: Your One-on-One sessions will be closed on</span>
                                                              <asp:Label ID="Label5" runat="server" Text='<%#DataBinder.Eval(Container.DataItem, "SessionEndDate")%>'></asp:Label>
                                                              <asp:Button ID="btnViewSchedule" runat="server" CssClass="NormalButton" Text="View Schedule"
                                                                  OnClick="btnViewSchedule_Click" />
                                                          </p>
                                                      </div>
                                                      <div class="fr_itemimg">
                                                          <p>
                                                              <span class="">Course end date</span>
                                                              <asp:Label ID="Label2" runat="server" Text='<%#DataBinder.Eval(Container.DataItem, "CourseEndDate")%>'></asp:Label></p>
                                                          &nbsp;
                                                          <p>
                                                              <span>One-on-One Sessions</span><span class="sp3"> </span>
                                                          </p>
                                                          &nbsp;
                                                          <p>
                                                              <div style="width: 60%; text-align: center">
                                                                  <div id="progressbar1">
                                                                  </div>
                                                              </div>
                                                          </p>
                                                          &nbsp;
                                                          <p>
                                                              <asp:Label ID="Label4" runat="server" Text='<%#DataBinder.Eval(Container.DataItem, "InteractionHours")%>'></asp:Label><span>/150
                                                                  Hours completed</span><span class="sp3"> </span>
                                                          </p>
                                                          &nbsp;
                                                          <p>
                                                              <asp:Button ID="Button2" CssClass="GlobalOrangeButton" runat="server" Text="Connect to teacher" />
                                                          </p>
                                                          &nbsp;
                                                          <p>
                                                              <asp:Label ID="Label3" runat="server" Text='<%#DataBinder.Eval(Container.DataItem, "NoofTrainers")%>'></asp:Label><span>
                                                                  Trainers Available</span><span class="sp3"> </span>
                                                          </p>
                                                          &nbsp;
                                                          <p>
                                                              <span>This session ends on</span>
                                                              <asp:Label ID="Label6" runat="server" Text='<%#DataBinder.Eval(Container.DataItem, "SessionEndTime")%>'></asp:Label><span
                                                                  class="sp3"></span></p>
                                                          &nbsp;
                                                      </div>
                                                      <div class="dvClear">
                                                      </div>
                                                      <p class="rule">
                                                      </p>
                                                  </div>
                                              </div>
                                          </div>
                                      </div>
                                      <div class="tr">
                                      </div>
                                      <div class="tl">
                                      </div>
                                      <div class="br">
                                      </div>
                                      <div class="bl">
                                      </div>
                                  </div>
                              </div>
                          </ItemTemplate>
                      </asp:TemplateField>
                  </Columns>
                  <PagerStyle HorizontalAlign="Right" />
              </asp:GridView>
Posted

1 solution

the div id is added only once as you can not place more than one element with the same id where this is added according to the ItemTemplate. so, the html renders it only once.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900