title: Item Order in Repeater Control
body: <p>Is it possible to re-order the rows in repeater control at run time. for example: if I I have repeater control as shown bellow. What if I have to change the sequence of rows of table in item template at run time. Like I need to show the special requests in first row then benefits in second row and then preferences in third row according to the sequence defined. I know I can do it by making it dynamic repeater. But Is there any other way?</p>
  
  <pre><code> &lt;asp:Repeater ID="repGuestInformation" ClientIDMode="AutoID" runat="server" OnItemDataBound="repGuestInformation_ItemDataBound"&gt;
              &lt;HeaderTemplate&gt;
                  &lt;table&gt;
              &lt;/HeaderTemplate&gt;
              &lt;ItemTemplate&gt;
                  &lt;asp:Repeater ID="repGuestEventInformation" runat="server" OnItemDataBound="repGuestEventInformation_ItemDataBound"&gt;
                     &lt;%-- &lt;HeaderTemplate&gt;
  
  
                      &lt;/HeaderTemplate&gt;--%&gt;
                      &lt;ItemTemplate&gt;
                      &lt;tr&gt;
                              &lt;td&gt;Registrants&lt;/td&gt;
                              &lt;td&gt;&lt;/td&gt;
                              &lt;td&gt;&lt;asp:Label ID="lblCost" runat="server" Text="Cost" /&gt;&lt;/td&gt;
                              &lt;td&gt;&lt;/td&gt;
                       &lt;/tr&gt;
                       &lt;tr&gt;
                              &lt;td valign="top"&gt;
                                  &lt;asp:Literal ID="ltlRegistrant" runat="server" /&gt;
                                  &lt;asp:DropDownList ID="ddlGuest" runat="server" OnSelectedIndexChanged="ddlGuest_SelectedIndexChanged" AutoPostBack="true" /&gt;
                                  &lt;asp:HiddenField ID="hfRegistrantName" runat="server" /&gt;
                              &lt;/td&gt;
                              &lt;td&gt;
                                  &lt;table&gt;
                                      &lt;tr&gt;&lt;td&gt;&lt;/td&gt;&lt;td&gt;&lt;/td&gt;&lt;td&gt;&lt;/td&gt;&lt;/tr&gt;
                                      &lt;tr&gt;&lt;td&gt;&lt;/td&gt;&lt;td&gt;&lt;/td&gt;&lt;td&gt;&lt;/td&gt;&lt;/tr&gt;
                                      &lt;tr&gt;&lt;td&gt;&lt;/td&gt;&lt;td&gt;&lt;/td&gt;&lt;td&gt;&lt;/td&gt;&lt;/tr&gt;
                                      &lt;tr&gt;&lt;td&gt;&lt;/td&gt;&lt;td&gt;&lt;/td&gt;&lt;td&gt;&lt;/td&gt;&lt;/tr&gt;
                                      &lt;tr&gt;&lt;td&gt;&lt;/td&gt;&lt;td&gt;&lt;/td&gt;&lt;td&gt;&lt;/td&gt;&lt;/tr&gt;
                                     &lt;tr&gt;&lt;td&gt;&lt;/td&gt;&lt;td&gt;&lt;/td&gt;&lt;td&gt;&lt;/td&gt;&lt;/tr&gt;
                                      &lt;tr&gt;
                                          &lt;td&gt;
                                          &lt;%--    Benefits --%&gt;
                                           &lt;asp:Label ID="lblConstituentBenefits" runat="server" Text="Benefits"  &gt;&lt;/asp:Label&gt;
                                          &lt;/td&gt;
                                          &lt;td&gt;&lt;/td&gt;
                                          &lt;td&gt;&lt;/td&gt;
                                      &lt;/tr&gt;
                                      &lt;tr&gt;
                                          &lt;td&gt;&lt;/td&gt;
                                          &lt;td&gt;
                                              &lt;asp:CheckBoxList ID="chkBoxListRegistrantBenefits" runat="server" AutoPostBack="true"
                                                  OnSelectedIndexChanged="chkBoxListRegistrantBenefits_SelectedIndexChanged" &gt;
                                              &lt;/asp:CheckBoxList&gt;
                                          &lt;/td&gt;
                                          &lt;td&gt;&lt;/td&gt;
                                      &lt;/tr&gt;
                                      &lt;tr&gt;
                                          &lt;td&gt;
                                            &lt;%--  Preference--%&gt;
                                              &lt;asp:Label ID="lblConstituentPreference" runat="server" Text="Preference"  &gt;&lt;/asp:Label&gt;
                                          &lt;/td&gt;
                                          &lt;td&gt;&lt;/td&gt;
                                          &lt;td&gt;&lt;/td&gt;
                                       &lt;/tr&gt;
                                       &lt;asp:Repeater ID="repEventPreference" runat="server" OnItemDataBound="repEventPreference_ItemDataBound"&gt;
                                          &lt;ItemTemplate&gt;
                                                  &lt;tr&gt;
                                                  &lt;td&gt;&lt;/td&gt;
                                                      &lt;td&gt;
                                                              &lt;asp:Literal ID="ltlEventPreference" runat="server" /&gt;
                                                              &lt;asp:HiddenField ID="hfID" runat="server" /&gt;
                                                      &lt;/td&gt;
                                                      &lt;td&gt;
                                                          &lt;asp:DropDownList ID="ddlEventPreference" runat="server" AppendDataBoundItems="true"
                                                              AutoPostBack="true" OnSelectedIndexChanged="ddlEventPreference_SelectedIndexChanged"&gt;
                                                          &lt;/asp:DropDownList&gt;
                                                      &lt;/td&gt;
                                                  &lt;/tr&gt;
                                          &lt;/ItemTemplate&gt;
                                       &lt;/asp:Repeater&gt;
                                      &lt;tr&gt;
                                          &lt;td&gt;
                                             &lt;%-- Special Requests--%&gt;
                                              &lt;asp:Label ID="lblConstituentSpecialRequest" runat="server" Text="Special Requests"  &gt;&lt;/asp:Label&gt;
                                          &lt;/td&gt;
                                          &lt;td&gt;&lt;/td&gt;
                                          &lt;td&gt;&lt;/td&gt;
                                       &lt;/tr&gt;
                                      &lt;tr&gt;
                                          &lt;td&gt;&lt;/td&gt;
                                          &lt;td&gt;
                                              &lt;asp:CheckBoxList ID="chkBoxListSR" runat="server" AutoPostBack="true" OnSelectedIndexChanged="chkBoxListSR_SelectedIndexChanged"&gt;
                                              &lt;/asp:CheckBoxList&gt;
                                          &lt;/td&gt;
                                          &lt;td&gt;&lt;/td&gt;
                                       &lt;/tr&gt;
                                      &lt;tr&gt;
                                          &lt;td&gt;
                                              &lt;asp:Panel ID="registrantAttPanel" runat="server" /&gt;
                                          &lt;/td&gt;
                                          &lt;td&gt;&lt;/td&gt;
                                          &lt;td&gt;&lt;/td&gt;
                                       &lt;/tr&gt;
                                   &lt;/table&gt;
                              &lt;/td&gt;
                              &lt;td valign="top" style="padding-top:7px;"&gt;
                              &lt;asp:Literal ID="ltlCost" runat="server" /&gt;&lt;asp:HiddenField ID="hfID" runat="server" /&gt;
                              &lt;/td&gt;
  
                              &lt;td valign="top"&gt;
                              &lt;asp:Button ID="btnClearRow2" CausesValidation="false" runat="server" Text="CLEAR" OnClick="btnClearRow2_Click" /&gt;
                              &lt;/td&gt;
                        &lt;/tr&gt;
                      &lt;/ItemTemplate&gt;
                  &lt;/asp:Repeater&gt;
              &lt;/ItemTemplate&gt;
              &lt;FooterTemplate&gt;
                  &lt;/table&gt;
              &lt;/FooterTemplate&gt;
          &lt;/asp:Repeater&gt;
  </code></pre>