title: loading dataset data to DropDownList c#
body: <p>i have this dropdownlist in my popup function that does not load the data i want, i have breakpointed and confirmed that i get the data i want, but for some reason, the dropdownlist is still empty.</p>
  
  <p>C#:</p>
  
  <pre><code>protected void Page_PreRender(object sender, EventArgs e)
  {
      var nodes = _administrationSystem.GetNodes(); //The dataset with data
      var translators = _phonesSystem.GetPhoneNumberTranslators(); //The dataset with data
  
      if (rptList.Items.Count &gt; 0)
      {
          for (var count = 0; count &lt; rptList.Items.Count; count++)
          {
              var ddlNodeEdit = (DropDownList)rptList.Items[count].FindControl("ddlNodeEdit");
              var ddlTranslatorEdit = (DropDownList)rptList.Items[count].FindControl("ddlTranslatorEdit");
  
              ddlNodeEdit.DataSource = nodes;
              ddlNodeEdit.DataTextField = "NodeName";
              ddlNodeEdit.DataValueField = "ID";
              ddlNodeEdit.DataBind();
              ddlNodeEdit.Items.Insert(0, new ListItem("TRNSLTChoose node", "0"));
  
              ddlTranslatorEdit.DataSource = translators;
              ddlTranslatorEdit.DataTextField = "Description";
              ddlTranslatorEdit.DataValueField = "ID";
              ddlTranslatorEdit.DataBind();
              ddlTranslatorEdit.Items.Insert(0, new ListItem("TRNSLTChoose numbertranslator", "0"));
          }
      }
  }
  </code></pre>
  
  <p>ASPX:</p>
  
  <pre><code>&lt;asp:Repeater runat="server" OnItemCommand="rptList_OnItemCommand" ID="rptList"&gt;
      &lt;HeaderTemplate&gt;
          &lt;table class="tblRegister"&gt;
              &lt;tr class="tblRowHeader" style="background-color: rgb(200,200,200)"&gt;
                  &lt;th&gt;
                      &lt;asp:Label runat="server" Text="TRNSLTFirstname" /&gt;
                  &lt;/th&gt;
                  &lt;th&gt;
                      &lt;asp:Label runat="server" Text="TRNSLTSurname" /&gt;
                  &lt;/th&gt;
                  &lt;th&gt;
                      &lt;asp:Label runat="server" Text="TRNSLTNode index" /&gt;
                  &lt;/th&gt;
                  &lt;th&gt;
                      &lt;asp:Label runat="server" Text="TRNSLTNumber translation" /&gt;
                  &lt;/th&gt;
                  &lt;th&gt;
                      &lt;asp:Label runat="server" Text="TRNSLTEmail" /&gt;
                  &lt;/th&gt;
                  &lt;th colspan="3"&gt;
                      &lt;asp:Label runat="server" Text="TRNSLTLast login" /&gt;
                  &lt;/th&gt;
              &lt;/tr&gt;
          &lt;/HeaderTemplate&gt;
          &lt;ItemTemplate&gt;
              &lt;%# OperatorId.HasValue &amp;&amp; OperatorId == Convert.ToInt32(Eval("ID"))? "&lt;tr style='background-color: #94C5E1;'&gt;" : "&lt;tr&gt;" %&gt;
                  &lt;td&gt;
                      &lt;%# Eval("FirstName") %&gt;
                  &lt;/td&gt;
                  &lt;td&gt;
                      &lt;%# Eval("SurName") %&gt;
                  &lt;/td&gt;
                  &lt;td&gt;
                      &lt;%# Eval("NodeIndex") %&gt;
                  &lt;/td&gt;
                  &lt;td&gt;
                      &lt;%# Eval("TranslatorName") %&gt;
                  &lt;/td&gt;
                  &lt;td&gt;
                      &lt;%# Eval("EMail") %&gt;
                  &lt;/td&gt;
                  &lt;td&gt;
                      &lt;%# Eval("LastLogin") %&gt;
                  &lt;/td&gt;
                  &lt;td&gt;
                      &lt;asp:LinkButton ToolTip="TRNSLTDelete" ID="btnDelete" CssClass="deleteOperator" runat="server" CommandName="deleteBtn" CommandArgument='&lt;%# Eval("ID") %&gt;' OnClientClick="return OpenPopup(this)"&gt;
                          &lt;asp:Image ImageUrl="Images/Icons/Deleted-16x16.png" ID="DeleteVisitor" runat="server" /&gt;
                      &lt;/asp:LinkButton&gt;
                      &lt;div id="myModal" class="modal"&gt;
                          &lt;div class="modal-content"&gt;
                              &lt;h3 class="modalHdr"&gt;
                                  &lt;asp:Label runat="server" Text="TRNSLTRemove users" /&gt;
                              &lt;/h3&gt;
                              &lt;asp:LinkButton ToolTip="TRNSLTNo" CommandName="noBtn" CommandArgument='&lt;%# Eval("ID") %&gt;' ID="ButtonNo" runat="server" Text="TRNSLTNo" CssClass="popupConfirm" /&gt;
                              &lt;asp:LinkButton ToolTip="TRNSLTYes" CommandName="yesBtn" CommandArgument='&lt;%# Eval("ID") %&gt;' ID="ButtonYes" runat="server" Text="TRNSLTYes" CssClass="popupConfirm" /&gt;
                          &lt;/div&gt;
                      &lt;/div&gt;
                  &lt;/td&gt;
                  &lt;td&gt;
                      &lt;asp:LinkButton CommandName="selectBtn" ToolTip="TRNSLTEdit" ID="btnEdit" CssClass="editOperator" runat="server" CommandArgument='&lt;%# Eval("ID")%&gt;' OnClientClick="return PopupEdit(this)"&gt;
                          &lt;asp:Image ImageUrl="Images/Icons/Edit-16x16.png" ID="EditVisitor" runat="server" /&gt;
                      &lt;/asp:LinkButton&gt;
                      &lt;div id="modalEdit" class="modal"&gt;
                          &lt;div class="modal-content"&gt;
                              &lt;p style="margin-left: 50px;"&gt;
                                  &lt;img src="Images/Icons/Sip.png" alt="" /&gt;
                                  &lt;%# Eval("FirstName") %&gt; &lt;%# Eval("SurName") %&gt;
                              &lt;/p&gt;
                              &lt;br /&gt;
                              &lt;asp:DropDownList CssClass="ddlNodeClass" runat="server" ID="ddlNodeEdit" /&gt;
                              &lt;asp:DropDownList CssClass="ddlTranslatorClass" runat="server" ID="ddlTranslatorEdit" /&gt;
                              &lt;asp:LinkButton ToolTip="TRNSLTCancel" CommandArgument='&lt;%# Eval("ID") %&gt;' ID="btnNo" runat="server" CssClass="btnCancelClass" OnClientClick="return Cancel(this)"&gt;
                                  &lt;asp:Image ImageUrl="Images/Icons/Cancel-22x22.png" ID="SaveContact" runat="server" ClientIDMode="Static" /&gt;
                              &lt;/asp:LinkButton&gt;
                              &lt;asp:LinkButton ToolTip="TRNSLTSave" CommandName="submitBtn" CommandArgument='&lt;%# Eval("ID") %&gt;' ID="btnYes" runat="server" CssClass="btnSaveClass"&gt;
                                  &lt;asp:Image ImageUrl="Images/Icons/Check-22x22.png" ID="SaveOperator" runat="server" ClientIDMode="Static" /&gt;
                              &lt;/asp:LinkButton&gt;
                          &lt;/div&gt;
                      &lt;/div&gt;
                  &lt;/td&gt;
              &lt;/ItemTemplate&gt;
              &lt;FooterTemplate&gt;
          &lt;/table&gt;
              &lt;/FooterTemplate&gt;
  &lt;/asp:Repeater&gt;
  </code></pre>