title: DevExpress ASPxComboBox not filtering
body: <p>I have an ASPxComboBox from the DevExpress suite and am trying to get it filtered. If I click on the dropdown button of the combo box it will show the first few of the query as if the filter is empty.</p>
  
  <p>If I try to populate the filter, or scroll down to see more, it will just provide a perpetual "Loading" state. The stored procedure returns the correct results when ran with appropriate parameters. What could be the problem?</p>
  
  <p>EDIT: I have been following this tutorial on the DevExpress site: <a href="http://demos.devexpress.com/ASPxEditorsDemos/ASPxComboBox/LargeDataSource.aspx" rel="nofollow">http://demos.devexpress.com/ASPxEditorsDemos/ASPxComboBox/LargeDataSource.aspx</a></p>
  
  <p>EDIT (again): OK if I remove the line: </p>
  
  <pre><code>&lt;ClientSideEvents BeginCallback="function(s, e) { OnBeginCallback(); }" EndCallback="function(s, e) { OnEndCallback(); } " /&gt;
  </code></pre>
  
  <p>from the combo box it will hit a break point in <code>cboInstructor_OnItemsRequestedByFilterCondition_SQL</code>, but on going to the <code>DataBind()</code> it will thorw the error:</p>
  
  <blockquote>
    <p>Index (zero based) must be greater
    than or equal to zero and less than
    the size of the argument list.</p>
  </blockquote>
  
  <p>ASP file</p>
  
  <pre><code>&lt;form id="form1" runat="server"&gt;
  &lt;div&gt;
      &lt;dxe:ASPxComboBox ID="cboInstructor" runat="server" Width="100%"
          EnableCallbackMode="True" CallbackPageSize="10"
          IncrementalFilteringMode="Contains" ValueType="System.Int32" ValueField="employee_id"
          OnItemsRequestedByFilterCondition="cboInstructor_OnItemsRequestedByFilterCondition_SQL"
          OnItemRequestedByValue="cboInstructor_OnItemRequestedByValue_SQL" TextFormatString="{1} {2}"
          DropDownStyle="DropDown" DataSourceID="SqlDataSourceInstruct"
      &gt;
          &lt;Columns&gt;
              &lt;dxe:ListBoxColumn FieldName="display_forename" /&gt;
              &lt;dxe:ListBoxColumn FieldName="display_surname" /&gt;
          &lt;/Columns&gt;
          &lt;ClientSideEvents BeginCallback="function(s, e) { OnBeginCallback(); }" EndCallback="function(s, e) { OnEndCallback(); } " /&gt;
      &lt;/dxe:ASPxComboBox&gt;
      &lt;asp:SqlDataSource ID="SqlDataSourceInstruct" runat="server" ConnectionString="Server=160.10.1.25;User ID=root;Password=password;Persist Security Info=True;Database=central" ProviderName="MySql.Data.MySqlClient" SelectCommand="GetUser" SelectCommandType="StoredProcedure"&gt;
          &lt;SelectParameters&gt;
              &lt;asp:Parameter Name="filter" Type="String" /&gt;
              &lt;asp:Parameter Name="startIndex" Type="Int32" /&gt;
              &lt;asp:Parameter Name="endIndex" Type="Int32" /&gt;
          &lt;/SelectParameters&gt;
      &lt;/asp:SqlDataSource&gt;
  &lt;/div&gt;
  &lt;/form&gt;
  </code></pre>
  
  <p>CS file</p>
  
  <pre><code>public partial class TestComboBox : System.Web.UI.Page
  {
      protected void Page_Load(object sender, EventArgs e)
      {
  
      }
  
      protected void cboInstructor_OnItemsRequestedByFilterCondition_SQL(object source, ListEditItemsRequestedByFilterConditionEventArgs e)
      {
          ASPxComboBox comboBox = (ASPxComboBox)source;
          //SqlDataSourceInstruct.SelectCommand =
          //       @"SELECT CONCAT(display_Forename, ' ', display_Surname) FROM (SELECT employee_id, display_forename , display_surname, @rownum:=@rownum+1 AS rn FROM central.user_record, (SELECT @rownum:=0) AS r WHERE CONCAT(display_forename, ' ', display_surname) LIKE @filter ORDER BY display_surname ASC) AS st where st.rn between @startIndex and @endIndex";
  
          SqlDataSourceInstruct.SelectParameters.Clear();
          SqlDataSourceInstruct.SelectParameters.Add("filter", TypeCode.String, string.Format("%{0}%", e.Filter));
          SqlDataSourceInstruct.SelectParameters.Add("startIndex", TypeCode.Int64, (e.BeginIndex + 1).ToString());
          SqlDataSourceInstruct.SelectParameters.Add("endIndex", TypeCode.Int64, (e.EndIndex + 1).ToString());
          //comboBox.DataSource = SqlDataSourceInstruct;
          comboBox.DataBind();
      }
  
      protected void cboInstructor_OnItemRequestedByValue_SQL(object source, ListEditItemRequestedByValueEventArgs e)
      {
          long value = 0;
          if (e.Value == null)
              return;
          if (!Int64.TryParse(e.Value.ToString(), out value))
              return;
          ASPxComboBox comboBox = (ASPxComboBox)source;
          SqlDataSourceInstruct.SelectCommand = @"SELECT employee_id, display_surname, display_forename FROM central.user_record WHERE (employee_id = @ID) ORDER BY display_forename";
  
          SqlDataSourceInstruct.SelectParameters.Clear();
          SqlDataSourceInstruct.SelectParameters.Add("ID", TypeCode.Int64, e.Value.ToString());
          comboBox.DataSource = SqlDataSourceInstruct;
          comboBox.DataBind();
  
      }
  }
  </code></pre>
  
  <p>MySQL stored procedure</p>
  
  <pre><code>DELIMITER $$
  
  USE `central`$$
  
  DROP PROCEDURE IF EXISTS `GetUser`$$
  
  CREATE DEFINER=`root`@`%` PROCEDURE `GetUser`(filter VARCHAR(50), startIndex INT, endIndex INT)
  BEGIN
      SELECT employee_id, display_Forename, display_Surname
      FROM 
          (SELECT 
              employee_id
              , display_forename
              , display_surname
              , @rownum:=@rownum+1 AS rn  
          FROM central.user_record, 
              (SELECT @rownum:=0) AS r 
          WHERE CONCAT(display_forename, ' ', display_surname) LIKE filter
          ORDER BY display_surname ASC) AS st 
      WHERE st.rn BETWEEN startIndex AND endIndex;
      END$$
  
  DELIMITER ;
  </code></pre>