This is a migrated thread and some comments may be shown as answers.

RowSelection Disabled After Page Change or PageSizeChange

3 Answers 73 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Wade
Top achievements
Rank 1
Wade asked on 01 Feb 2013, 07:39 PM
When i initially load my grid everything works properly. After i change the pagesize or change the page index i can NO longer select any rows. 

<telerik:RadGrid ID="UserGrid" runat="server" AllowSorting="true" AllowPaging="true" AllowCustomPaging="true" AllowMultiRowSelection="true"
        OnItemDataBound="Grid_ItemDataBound"  OnSortCommand="Grid_Sorting" OnPageIndexChanged="Grid_Paging" OnDeleteCommand="Grid_Deleting" OnItemCommand="Grid_ItemCommand" Skin="Windows7"
        meta:resourcekey="UserGrid">
        <MasterTableView AutoGenerateColumns="False" EnableNoRecordsTemplate="true" ShowHeadersWhenNoRecords="false" DataKeyNames="UserID,EmailAddress" NoMasterRecordsText="No records match the search criteria.">
            <Columns>
                      <telerik:GridClientSelectColumn UniqueName="ClientSelectColumn" ItemStyle-Width="20px"/>
            </Columns>
        </MasterTableView>
        <ClientSettings EnableRowHoverStyle="false">
            <Selecting AllowRowSelect="True" EnableDragToSelectRows="true"></Selecting>
        </ClientSettings>
        <PagerStyle Mode="NumericPages" />
    </telerik:RadGrid>

BTW i cam callind UserGrid.Rebind() on the pageindexchanged event.

3 Answers, 1 is accepted

Sort by
0
Shinu
Top achievements
Rank 2
answered on 04 Feb 2013, 05:23 AM
Hi,

Try removing AllowCustomPaging property for the Radgrid. In order to implement custom paging, set the table view's VirtualItemCount property to the total number of records that the grid can draw on.

Thanks,
Shinu
0
Wade
Top achievements
Rank 1
answered on 05 Feb 2013, 07:28 PM
This still occurs even after custompaging has been disabled. 

BTW i also have set the virtual item count correctly. The problem is not with paging. The problem is that after paging i can no longer highlight rows. (I.E. Selecting them)

This appears to happen anytime i perform an async postback to the grid. 

Here is the code that does the paging. the UserList gets loaded from an sql database based on the paging parameters.
UserGrid.DataSource = userList;
UserGrid.VirtualItemCount = totalCount;
 
UserGrid.PageSize = this.SessionManager.PageLoadParameters.UsersPageSize;
UserGrid.Rebind();
UserGrid.CurrentPageIndex = this.SessionManager.PageLoadParameters.UsersPageIndex;
0
Wade
Top achievements
Rank 1
answered on 06 Feb 2013, 03:44 PM
Ok i've narrowed it down to the radajaxmanager. Is there any reason this would be causing it? 

Here is the offending block of code

<telerik:radajaxmanager id="RadAjaxManager1" runat="server" onajaxrequest="RadAjaxManager_AjaxRequest"
        enableviewstate="false">
    <AjaxSettings>
        <telerik:AjaxSetting AjaxControlID="RadAjaxManager1">
            <UpdatedControls>
                <telerik:AjaxUpdatedControl ControlID="UserGrid" />
            </UpdatedControls>
        </telerik:AjaxSetting>     
        <telerik:AjaxSetting AjaxControlID="UserGrid">
            <UpdatedControls>
                <telerik:AjaxUpdatedControl ControlID="UserGrid" />
            </UpdatedControls>
        </telerik:AjaxSetting>
        <telerik:AjaxSetting AjaxControlID="ucSearch">
            <UpdatedControls>
                <telerik:AjaxUpdatedControl ControlID="ucSearch" />
                <telerik:AjaxUpdatedControl ControlID="UserGrid" />
            </UpdatedControls>
        </telerik:AjaxSetting>
        <telerik:AjaxSetting AjaxControlID="RowsPerPage">
            <UpdatedControls>
                <telerik:AjaxUpdatedControl ControlID="RowsPerPage" />
                <telerik:AjaxUpdatedControl ControlID="UserGrid" />
            </UpdatedControls>
        </telerik:AjaxSetting>

EDIT: I got the code partially working by removing the ajaxmanager completely and just putting a RadAjaxPanel around the grid alone. Why does this work but the ajax manager does not?
Tags
Grid
Asked by
Wade
Top achievements
Rank 1
Answers by
Shinu
Top achievements
Rank 2
Wade
Top achievements
Rank 1
Share this question
or