Grid View Scroll/Refresh Problem

  1. #1

    Grid View Scroll/Refresh Problem

    I have been searching a lot to fix this problem I am encountering.
    Data shows in a scrollable grid view. There is a edit button to on the grid view. Once edit is clicked, it opens up a new control/page. User makes changes to the data and click save. Once the save is clicked, it goes back to the original page and saves the changes. But it refreshes the grid and the grid is scrolled to the top. I have tried to use
    <ext:GridPanelMaintainScrollPositionOnRefresh ID="GridPanelMaintainScrollPositionOnRefresh1" runat="server" ></ext:GridPanelMaintainScrollPositionOnRefresh>
    but this doesn't work.
    Last edited by Daniil; Dec 02, 2013 at 4:01 AM. Reason: Please use [CODE] tags
  2. #2
    Hi @bhuter24,

    Welcome to the Ext.NET forums!

    Please provide a test case to reproduce the problem.
  3. #3
    Quote Originally Posted by Daniil View Post
    Hi @bhuter24,

    Welcome to the Ext.NET forums!

    Please provide a test case to reproduce the problem.
    Well here is the entire thing:

    <%@ Control Language="C#" AutoEventWireup="true" CodeBehind="LayInList.ascx.cs" Inherits="Mdoc.Mts.Controls.LayInList" %>
    <%@ Register src="LayInDetail.ascx" tagname="Editor" tagprefix="uc1" %>
    <link href="../css/StyleSheet.css" rel="stylesheet" type="text/css" />
    <script type="text/javascript">
        function refreshGrid() {
        var exportData = function() {
            var store =;
                var detailsRender = function() {
                    return '<img class="imgEdit" ext:qtip="Click to view/edit additional details" style="cursor:pointer;" src="images/vcard_edit.png" />';
                var cellClick = function(grid, rowIndex, columnIndex, e) {
                    var t = e.getTarget(),
                    record = grid.getStore().getAt(rowIndex),  // Get the Record
                    columnId = grid.getColumnModel().getColumnId(columnIndex); // Get column id
                    //if (columnId == "Lock" | columnId == "MdocNo" | columnId == "OffenderName" | columnId == "Race" | columnId == "Unit" | columnId == "Wing" |  columnId == "LayIn" | columnId == "MealType" | columnId == "ExpireDate" | columnId == "Details") {
                    if (columnId == "Details") {
                        //the ajax call is allowed
                        return true;
                    return false;
                    <ext:Hidden ID="GridData" runat="server" />
                                                <ext:JsonReader IDProperty="OffenderNumber" >
                                                        <ext:RecordField Name="OffenderId" Type="Int"/>
                                                        <ext:RecordField Name="OffenderNumber" Type="Int"/>
                                                        <ext:RecordField Name="LayInMstrId" Type="Int"/>
                                                        <ext:RecordField Name="LayInSplId" Type="Int"/>
                                                        <ext:RecordField Name="OffenderName" Type="String" />
                                                        <ext:RecordField Name="Race" Type="String" />
                                                        <ext:RecordField Name="Cell" Type="String" />
                                                        <ext:RecordField Name="Unit" Type="String" />
                                                        <ext:RecordField Name="Wing" Type="String" />
                                                        <ext:RecordField Name="ExpDate" Type="Date" />
                                                        <ext:RecordField Name="UnitLockId" Type="Int" />
                                                        <ext:RecordField Name="SpecialityMealId" Type="Int" />
                                                        <ext:RecordField Name="SpecialityMeal" Type="String" />
                                                        <ext:RecordField Name="LayInFlag" Type="Boolean" />
                        <LoadException Handler="Ext.MessageBox.alert('Load failed', response.statusText);" />                            
                        StoreID="Store1"  EnableColumnHide="False" EnableHdMenu="False" TitleCollapse="True">
                            <ColumnModel ID="ColumnModel20" runat="server">
                                                <ext:Column ColumnID="Lock" Header="Lock" DataIndex="Cell" Width="40"></ext:Column>
                                                <ext:Column ColumnID="MdocNo" Header="MDOC#" DataIndex="OffenderNumber" Width="60"></ext:Column>
                                                <ext:Column ColumnID="OffenderName" Header="Offender Name" DataIndex="OffenderName" ></ext:Column>
                                                <ext:Column ColumnID="Race" Header="Race" DataIndex="Race" Width="100"></ext:Column>  
                                                <ext:Column ColumnID="Unit" Header="Unit" DataIndex="Unit" Width="50"></ext:Column>
                                                 <ext:Column ColumnID="UnitLockId" Header="UnitLock" Hidden="true" DataIndex="UnitLockId" Width="50"></ext:Column>
                                                <ext:Column ColumnID="Wing" Header="Wing" DataIndex="Wing" Width="40" ></ext:Column>
                                                <ext:CheckColumn ColumnID="LayIn" Header="LayIn" DataIndex="LayInFlag" Width="30"></ext:CheckColumn>
                                                <ext:Column ColumnID="MealType" Header="Specialty Meal" DataIndex="SpecialityMeal" Width="70" ></ext:Column>
                                               <ext:DateColumn ColumnID="ExpireDate" Header="Expiration Date" DataIndex="ExpDate" Width="50" Format="MM/dd/yyyy"></ext:DateColumn>
                              <ext:CommandColumn runat="server" Width="30" Header="Edit" >
                                         <ext:GridCommand Icon="ApplicationFormEdit" CommandName="Edit" >
                                                             <ToolTip Text="Edit Offender details" />
                                <Command OnEvent="Command">                              
                                                    <EventMask ShowMask="true"> </EventMask>
                                                             <ext:Parameter Name="OffenderId" Value="" Mode="Raw"></ext:Parameter>     
                                                             <ext:Parameter Name="OffenderNumber" Value="" Mode="Raw"></ext:Parameter>     
                                                             <ext:Parameter Name="LayInMstrId" Value="" Mode="Raw"></ext:Parameter>     
                                                             <ext:Parameter Name="LayInSplId" Value="" Mode="Raw"></ext:Parameter>     
                                                             <ext:Parameter Name="OffenderName" Value="" Mode="Raw"></ext:Parameter>     
                                                             <ext:Parameter Name="Race" Value="" Mode="Raw"></ext:Parameter>     
                                                             <ext:Parameter Name="Wing" Value="" Mode="Raw"></ext:Parameter>     
                                                             <ext:Parameter Name="Unit" Value="" Mode="Raw"></ext:Parameter>     
                                                             <ext:Parameter Name="UnitLockId" Value="" Mode="Raw"></ext:Parameter>     
                                                             <ext:Parameter Name="SpecialtyMeal" Value="" Mode="Raw"></ext:Parameter>     
                                                             <ext:Parameter Name="SpecialtyMealId" Value="" Mode="Raw"></ext:Parameter>     
                                                             <ext:Parameter Name="ExpDate" Value="" Mode="Raw"></ext:Parameter>     
                                                             <ext:Parameter Name="LayInFlag" Value="" Mode="Raw"></ext:Parameter>     
                                                             <ext:Parameter Name="command" Value="command" Mode="Raw" ></ext:Parameter>                                 
                            <ext:RowSelectionModel ID="RowSelectionModel1" runat="server" SingleSelect="True" />
                            <LoadMask ShowMask="false" />
                                <CellClick Fn="cellClick" />
                       <ext:GridPanelMaintainScrollPositionOnRefresh ID="GridPanelMaintainScrollPositionOnRefresh1" runat="server" ></ext:GridPanelMaintainScrollPositionOnRefresh>
                     <ext:PagingToolbar ID="PagingToolbar1" HideRefresh="true" runat="server" PageSize="100" AutoWidth="True" DisplayMsg="Displaying {0} - {1} of {2}">
                            <ext:Label runat="server" Text="Page size:" ID="ctl17" />
                            <ext:ToolbarSpacer runat="server" Width="10" ID="ctl19" />
                            <ext:ComboBox runat="server" Width="80" Editable="false" ID="ctl21" 
                                <Template runat="server" Visible="False" ID="ctl23" EnableViewState="False"></Template>
                                    <ext:ListItem Text="10" />
                                    <ext:ListItem Text="50" />
                                    <ext:ListItem Text="100" />
                                    <ext:ListItem Text="500" />
                                <SelectedItem Value="100" />
                                    <Select Handler="#{PagingToolbar1}.pageSize = parseInt(this.getValue()); #{PagingToolbar1}.doLoad();" />
                    <ext:GridView ForceFit="true" ID="ctl183" >
                        Failure="Ext.MessageBox.alert('Load failed', 'Error during ajax event!');">
                        <EventMask ShowMask="true" Target="CustomTarget" CustomTarget="={#{gpData}.body}" />
                            <ext:Parameter Name="id" Value="params[0].getStore().getAt(rowIndex).data['offenderNumber']" Mode="Raw" />
                    <uc1:Editor ID="Editor1" runat="server" />
    Last edited by Daniil; Dec 02, 2013 at 1:40 PM. Reason: Please use [CODE] tags
  4. #4
    I am afraid I cannot run it.
  5. #5
    Quote Originally Posted by Daniil View Post
    I am afraid I cannot run it.
    do you mean it is not possible or you can't run my code?
  6. #6
    Yes, I cannot run it.

    Is the user control really required to reproduce the issue?

    If no, please provide just a page.
  7. #7
    I am not sure what do you mean by "Is the user control really required to reproduce the issue?"

    Everything is in working order, customer is requesting to make a change to the gridview scroll bar.
    Here is what I am trying to accomplish:

    data is displayed in a gridview panel with the option to edit the data. Once the edit is clicked it opens up another window where the dates and check box can be selected. After the selection is made there is a save button and once the save is clicked it goes back to the original page but it also scrolls to top of the page. I need to maintain the scroll bar position.
  8. #8
    Well, I just need something to copy, paste, run and get it reproducible locally.

Similar Threads

  1. [CLOSED] GridPanel Refresh grid problem
    By John_Writers in forum 2.x Legacy Premium Help
    Replies: 4
    Last Post: May 23, 2013, 1:09 PM
  2. Replies: 7
    Last Post: Mar 27, 2013, 7:07 AM
  3. Replies: 2
    Last Post: Mar 27, 2013, 7:04 AM
  4. [CLOSED] Grid View Header Row Problem
    By mohan.bizbites in forum 1.x Legacy Premium Help
    Replies: 3
    Last Post: Aug 19, 2011, 8:17 AM
  5. Problem in Refresh button Of Grid Panel
    By Rakeshkumar.a in forum 1.x Help
    Replies: 1
    Last Post: Dec 14, 2010, 7:13 AM

Posting Permissions