title: Programmatically change table in Radgrid - NeedDataSource doesn't fire on Rebind()
body: <p>I need to point a radgrid to the table selected in a dropdownlist. So I have the selectedIndexChanged event of the dropdownList calling the Rebind() which should fire the radgrid NeedDataSource event where I set the datasource commands. But it does not fire!</p>
  
  <pre><code>protected void DropDownList1_SelectedIndexChanged1(object sender, EventArgs e)
  {
      if (DropDownList1.SelectedIndex &gt; -1)
      {
          RadGrid1.DataSource=null;
          Label1.Text = DropDownList1.SelectedItem.Text; //just for debugging
          RadGrid1.Rebind();
  
      }
  }
  
  protected void RadGrid1_NeedDataSource(object sender, GridNeedDataSourceEventArgs e)
  {
      string tableInUse = DropDownList1.SelectedItem.Text;
      Label2.Text = "NeedDataSource has been fired"; //just for debugging
      RadGrid1.DataSource = SqlDataSource1;
      SqlDataSource1.DeleteCommand = "DELETE FROM [" + tableInUse + "] .....";
      SqlDataSource1.SelectCommand = "SELECT * FROM [" + tableInUse + "] ORDER BY [Code]";
      SqlDataSource1.UpdateCommand = "UPDATE [" + tableInUse + "] SET ....";
  
  }
  </code></pre>
  
  <p>and the markup:</p>
  
  <pre><code>&lt;telerik:RadGrid ID="RadGrid1" runat="server" Culture="it-IT" DataSourceID="SqlDataSource1" OnNeedDataSource="RadGrid1_NeedDataSource"&gt;
              &lt;MasterTableView DataSourceID="SqlDataSource1"&gt;
              &lt;/MasterTableView&gt;
          &lt;/telerik:RadGrid&gt;
  </code></pre>
  
  <p>Not sure if this is the correct way to change the database table associated to a radgrid but at least the NeedDatasource event should get fired. What am I doing wrong? </p>