title: Telerik RadGrid selects multiple rows even with AllowMultiRowSelection set to false
body: <p>I have a RadGrid that has it's rows and columns being created programatically, and there is a RadAjaxManager that is set to update another Panel on SelectedIndexChange. The RadGrid also has scrolling enabled and multirowselect disabled. The RadGrid operates as supposed to, but as soon as you scroll it starts collecting selected items. I have set break points and verified through watches that SelectedItems.Count grows greater that 1. This also prevents from selecting previous selected rows after you've scrolled. I have tried clearing the selected items in the page unload event, but when it renders it sometimes shows more than one item selected. I say sometimes because it is not consistent with this issue. Only pattern I have noticed is that scrolling starts the problem.</p>
  
  <p>The second issue is that each time the page posts back the column headers disappear. This one totally baffles me, not sure what's the cause for it.</p>
  
  <p>I would appreciate any advice on this. I'll include my code as well. Thanks, and I appologize for the poor formatting. I'm still trying to figure it out.</p>
  
  <p>P.S.  The code I've included is set up to create text for the columns and rows, so no actual data is needed. You can easily copy and paste the same code to see what I'm seeing.</p>
  
  <blockquote>
    <p><code>&lt;rad:RadScriptManager ID="scm" runat="server"&gt;
    &lt;/rad:RadScriptManager&gt;</code></p>
    
    <p><code>&lt;rad:RadAjaxManager ID="AjaxManager" runat="server"&gt;</code><br>
        <code>&lt;AjaxSettings&gt;</code><br>
        <code>&lt;rad:AjaxSetting AjaxControlID="grdCustomerAssignments"&gt;</code><br>
        <code>&lt;UpdatedControls&gt;</code><br>
            <code>&lt;rad:AjaxUpdatedControl ControlID="grdCustomerAssignments" LoadingPanelID="pnlLoading1" /&gt;</code><br>
        <code>&lt;/UpdatedControls&gt;</code><br>
        <code>&lt;/rad:AjaxSetting&gt;</code><br>
        <code>&lt;rad:AjaxSetting AjaxControlID="grdCustomerAssignments"&gt;</code><br>
         <code>&lt;UpdatedControls&gt;</code><br>
          <code>&lt;rad:AjaxUpdatedControl ControlID="pnlDetails"  /&gt;</code><br>
         <code>&lt;/UpdatedControls&gt;</code><br>
        <code>&lt;/rad:AjaxSetting&gt;</code><br>
        <code>&lt;/AjaxSettings&gt;</code><br>
    <code>&lt;/rad:RadAjaxManager&gt;</code>  </p>
    
    <p><code>&lt;rad:RadGrid ID="grdCustomerAssignments" runat="server" Skin="WebBlue" AutoGenerateColumns="false" AllowMultiRowSelection="false"
    OnNeedDataSource="grdCustomerAssignments_NeedDataSource"
    OnSelectedIndexChanged="grdCustomerAssignments_SelectedIndexChanged"
    OnSortCommand="grdCustomerAssignments_SortCommand"&gt;</code>  </p>
  </blockquote>
  
  <p><code>&lt;ClientSettings EnablePostBackOnRowClick="true" &gt;</code><br>
  <code>&lt;ClientEvents/&gt;</code><br>
  <code>&lt;Scrolling AllowScroll="true" ScrollHeight="350" UseStaticHeaders="true" SaveScrollPosition="true" /&gt;</code><br>
  <code>&lt;Selecting AllowRowSelect="true" /&gt;</code><br>
  <code>&lt;Resizing AllowColumnResize="true" /&gt;</code><br>
  <code>&lt;/ClientSettings&gt;</code>  </p>
  
  <p><code>&lt;MasterTableView DataKeyNames="ID" &gt;</code>  </p>
  
  <p><code>&lt;HeaderStyle Wrap="false" HorizontalAlign="Center" VerticalAlign="Middle" Font-Bold="true" /&gt;</code><br>
  <code>&lt;ItemStyle HorizontalAlign="Center" VerticalAlign="Middle" Wrap="false" /&gt;</code><br>
  <code>&lt;AlternatingItemStyle HorizontalAlign="Center" VerticalAlign="Middle" Wrap="false" /&gt;</code>  </p>
  
  <p><code>&lt;NoRecordsTemplate&gt;</code><br>
  <code>&lt;div style="font-size:80%; color:Maroon;"&gt;No Items Were Found&lt;/div&gt;</code><br>
  <code>&lt;/NoRecordsTemplate&gt;</code>  </p>
  
  <p><code>&lt;/MasterTableView&gt;</code>  </p>
  
  <p><code>&lt;/rad:RadGrid&gt;</code>  </p>
  
  <p><code>&lt;asp:Panel ID="pnlDetails" runat="server"&gt;</code><br>
  <code>&lt;rad:RadTabStrip ID="tabStrip" runat="server" Align="Justify" AppendDataBoundItems="false" SelectedIndex="0" MultiPageID="multiPage" Skin="WebBlue"&gt;</code><br>
  <code>&lt;Tabs&gt;&lt;/Tabs&gt;</code><br>
  <code>&lt;/rad:RadTabStrip&gt;</code><br>
  <code>&lt;rad:RadMultiPage ID="multiPage" runat="server"&gt;&lt;/rad:RadMultiPage&gt;</code><br>
  <code>&lt;/asp:Panel&gt;</code>  </p>
  
  <pre><code>protected DataTable Assignments { get; set; }  
  protected Dictionary&lt;string, IList&lt;int&gt;&gt; TabTitles { get; set; }  
  
  
  protected void Page_Init(object sender, EventArgs e)  
  {  
    GetAssignments();  
    if (!IsPostBack)  
      AddColumnsToGrid();  
  }  
  
  protected void Page_Load(object sender, EventArgs e)  
  {  
    tabStrip.Tabs.Clear();  
    multiPage.Controls.Clear();  
  }  
  
  protected void Page_UnLoad(object sender, EventArgs e)  
  {  
    grdCustomerAssignments.MasterTableView.ClearSelectedItems();  
  }  
  
  protected void grdCustomerAssignments_NeedDataSource(object source, Telerik.Web.UI.GridNeedDataSourceEventArgs e)  
  {  
    grdCustomerAssignments.DataSource = Assignments;  
  }  
  
  protected void grdCustomerAssignments_SelectedIndexChanged(object sender, EventArgs e)  
  {  
    try  
    {  
       string id = ((RadGrid)sender).SelectedValue.ToString();  
       DataRow dataRow = null;  
       foreach (DataRow row in Assignments.Rows)  
       {  
         if (row["ID"].ToString() == id)  
           dataRow = row;  
       }  
  
       PopulateAssignmentDetail(dataRow);  
  
    }  
    catch (Exception ex)  
    {  
  
    }  
  }  
  
  protected void PopulateAssignmentDetail(DataRow datarow)  
  {  
    // just some code to populate the tabs.  
  }  
  
  protected void AddColumnsToGrid()  
  {  
     grdCustomerAssignments.MasterTableView.Columns.Clear();  
  
    for (int i = 1; i &lt; 7; i++)  
    {  
       DataColumn column = Assignments.Columns[i];  
       GridBoundColumn boundColumn = new GridBoundColumn();  
       boundColumn.HeaderText = column.Caption;  
       boundColumn.DataField = column.ColumnName;  
       grdCustomerAssignments.MasterTableView.Columns.Add(boundColumn);  
    }  
  }  
  
  private void GetAssignments()  
  {  
  if (Assignments == null)  
  Assignments = new DataTable();  
  if (TabTitles == null)  
  TabTitles = new Dictionary&lt;string, IList&lt;int&gt;&gt;();  
  try  
  {  
  Assignments.Columns.Add(new DataColumn("ID"));  
  for (int i = 0; i &lt; 50; i++)  
  {  
  Assignments.Columns.Add(new DataColumn("Column" + i.ToString()));  
  }  
  int columnIndex = 0;  
  int tabIndex = 0;  
  foreach (DataColumn column in Assignments.Columns)  
  {  
  if (columnIndex &gt; 5)  
  {  
  string fieldCategory = "tab" + tabIndex.ToString();  
  if (tabIndex == 4)  
  tabIndex = 0;  
  else  
  tabIndex++;  
  if (!TabTitles.ContainsKey(fieldCategory))  
  {  
  IList&lt;int&gt; tmp = new List&lt;int&gt;();  
  tmp.Add(columnIndex);  
  TabTitles.Add(fieldCategory, tmp);  
  }  
  else  
  TabTitles[fieldCategory].Add(columnIndex);  
  }  
  columnIndex++;  
  }  
  for (int j = 0; j &lt; 50; j++)  
  {  
  DataRow row = Assignments.NewRow();  
  foreach (DataColumn column in Assignments.Columns)  
  {  
  row[column.ColumnName] = column.ColumnName + "Row" + j.ToString();  
  }  
  Assignments.Rows.Add(row);  
  }  
  Assignments.AcceptChanges();  
  Session["Assignments"] = Assignments;  
  }  
  catch (Exception ex)  
  {  
  
  }  
  }    
  </code></pre>