Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 622557
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T18:59:51+00:00 2026-05-13T18:59:51+00:00

I have a RadGrid that has it’s rows and columns being created programatically, and

  • 0

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.

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.

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.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.

<rad:RadScriptManager ID="scm" runat="server">
</rad:RadScriptManager>

<rad:RadAjaxManager ID="AjaxManager" runat="server">
<AjaxSettings>
<rad:AjaxSetting AjaxControlID="grdCustomerAssignments">
<UpdatedControls>
<rad:AjaxUpdatedControl ControlID="grdCustomerAssignments" LoadingPanelID="pnlLoading1" />
</UpdatedControls>
</rad:AjaxSetting>
<rad:AjaxSetting AjaxControlID="grdCustomerAssignments">
<UpdatedControls>
<rad:AjaxUpdatedControl ControlID="pnlDetails" />
</UpdatedControls>
</rad:AjaxSetting>
</AjaxSettings>
</rad:RadAjaxManager>

<rad:RadGrid ID="grdCustomerAssignments" runat="server" Skin="WebBlue" AutoGenerateColumns="false" AllowMultiRowSelection="false"
OnNeedDataSource="grdCustomerAssignments_NeedDataSource"
OnSelectedIndexChanged="grdCustomerAssignments_SelectedIndexChanged"
OnSortCommand="grdCustomerAssignments_SortCommand">

<ClientSettings EnablePostBackOnRowClick="true" >
<ClientEvents/>
<Scrolling AllowScroll="true" ScrollHeight="350" UseStaticHeaders="true" SaveScrollPosition="true" />
<Selecting AllowRowSelect="true" />
<Resizing AllowColumnResize="true" />
</ClientSettings>

<MasterTableView DataKeyNames="ID" >

<HeaderStyle Wrap="false" HorizontalAlign="Center" VerticalAlign="Middle" Font-Bold="true" />
<ItemStyle HorizontalAlign="Center" VerticalAlign="Middle" Wrap="false" />
<AlternatingItemStyle HorizontalAlign="Center" VerticalAlign="Middle" Wrap="false" />

<NoRecordsTemplate>
<div style="font-size:80%; color:Maroon;">No Items Were Found</div>
</NoRecordsTemplate>

</MasterTableView>

</rad:RadGrid>

<asp:Panel ID="pnlDetails" runat="server">
<rad:RadTabStrip ID="tabStrip" runat="server" Align="Justify" AppendDataBoundItems="false" SelectedIndex="0" MultiPageID="multiPage" Skin="WebBlue">
<Tabs></Tabs>
</rad:RadTabStrip>
<rad:RadMultiPage ID="multiPage" runat="server"></rad:RadMultiPage>
</asp:Panel>

protected DataTable Assignments { get; set; }  
protected Dictionary<string, IList<int>> 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 < 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<string, IList<int>>();  
try  
{  
Assignments.Columns.Add(new DataColumn("ID"));  
for (int i = 0; i < 50; i++)  
{  
Assignments.Columns.Add(new DataColumn("Column" + i.ToString()));  
}  
int columnIndex = 0;  
int tabIndex = 0;  
foreach (DataColumn column in Assignments.Columns)  
{  
if (columnIndex > 5)  
{  
string fieldCategory = "tab" + tabIndex.ToString();  
if (tabIndex == 4)  
tabIndex = 0;  
else  
tabIndex++;  
if (!TabTitles.ContainsKey(fieldCategory))  
{  
IList<int> tmp = new List<int>();  
tmp.Add(columnIndex);  
TabTitles.Add(fieldCategory, tmp);  
}  
else  
TabTitles[fieldCategory].Add(columnIndex);  
}  
columnIndex++;  
}  
for (int j = 0; j < 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)  
{  

}  
}    
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-13T18:59:51+00:00Added an answer on May 13, 2026 at 6:59 pm

    After inspecting your code I noticed that you generate the grid column on init when !Page.IsPostBack. I know from previous support communication with Telerik that when you have the grid statically on the page, you should build the columns on PageLoad when !Page.IsPostBack- they directed me to help topic, search for it in the online help.

    Also if I recall well I read in release notes that there was some issue with virtually scrolling and selected items. It should be fixed in the latest Q3 2009 SP2 release.

    Dick

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 296k
  • Answers 296k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer I'm assuming you're referring to MySQL, the database, and not… May 13, 2026 at 7:00 pm
  • Editorial Team
    Editorial Team added an answer What is posted here does not have the error. Note… May 13, 2026 at 7:00 pm
  • Editorial Team
    Editorial Team added an answer In general, no. Most protocols don't include a method for… May 13, 2026 at 7:00 pm

Related Questions

Has anybody seen a demo or forum post that might help me out with
I need to implement a grid in asp.net that behaves almost exactly like MS
The page has already run its' initialise/load sequences etc but then catches an event.
I have a question: I have two MSSQL tables, items and states, that are
I'm using the Telerik ASP.net control suite (2008 Q3 I believe, can't upgrade yet).

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.