Frozen Columns

Hi,

On checkbox click, I use the following code

scrolling = { frozenRows: 0, frozenColumns: 2, height: 500,width: 1700 };                                                
$('#<%= Grid1.ClientID %>').ejGrid("model.scrollSettings", scrolling);

This will freeze the first two columns which as expected and correct.

How can I unfreeze the columns

Since this code doesn't work

scrolling = { frozenRows: 0, frozenColumns: 0, height: 500,width: 1700 };                                                
$('#<%= Grid1.ClientID %>').ejGrid("model.scrollSettings", scrolling);

5 Replies

VN Vignesh Natarajan Syncfusion Team April 27, 2018 11:24 AM UTC

Hi David, 

Thanks for contacting Syncfusion support. 

We have analyzed your query and we have prepared a sample as per your suggestion. we are not able to reproduce the reported issue. while unchecking the checkbox frozen columns get removed.  

Refer the below code snippet 

<ej:CheckBox ClientSideOnChange="change" runat="server"></ej:CheckBox> 
       <ej:Grid ID="OrdersGrid" runat="server" AllowResizing="true" AllowScrolling="true" AllowPaging="True"> 
    .         .        .  
    <script type="text/javascript"> 
        function change(args) { 
            if (args.isChecked) { 
               var scrolling = { frozenRows: 0, frozenColumns: 2, height: 300,width: 700 };                                                 
                $('#<%= OrdersGrid.ClientID %>').ejGrid("model.scrollSettings", scrolling); 
            } 
            else { 
                 var scrolling = { frozenRows: 0, frozenColumns: 0, height: 300,width: 700 };                                                 
                $('#<%= OrdersGrid.ClientID %>').ejGrid("model.scrollSettings", scrolling); 
            } 
        } 
    </script> 
</asp:Content> 
   
For your convenience we have prepared a sample which can be downloaded from below link 


Kindly share the following details to reproduce the reported issue.  

  1. Share the full grid rendering code.
  2. Share the screenshot for the script error in console window if any.
  3. If possible try to reproduce the reported issue in provided sample.


Regards, 
Vignesh Natarajan 
 



DP David Price April 27, 2018 01:54 PM UTC

Hello,

I have updated your example code below, please have a look at the left to right scroll bar once you have clicked and then unclicked the checkbox. The top row is still frozen?


<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
  <div>   
      <ej:CheckBox ClientSideOnChange="change" runat="server"></ej:CheckBox>
       <ej:Grid ID="OrdersGrid" runat="server" AllowResizing="true" AllowScrolling="true" MinWidth="400" Width="1000" Height="500" AllowPaging="True">
            <Columns>
                <ej:Column Field="OrderID" HeaderText="Order ID" IsPrimaryKey="True" TextAlign="Right" Width="75" />
                <ej:Column Field="CustomerID" HeaderText="Customer ID" Width="90" />
                <ej:Column Field="ShipCity"  HeaderText="Ship City" Width="90" />
                <ej:Column Field="OrderDate" HeaderText="Order Date" TextAlign="Right" Width="100" Format="{0:MM/dd/yyyy}" />
                <ej:Column Field="ShipCountry" HeaderText="Ship Country" Width="110" />
                <ej:Column Field="ShipCountry" HeaderText="Ship Country" Width="110" />
                <ej:Column Field="ShipCountry" HeaderText="Ship Country" Width="110" />
                <ej:Column Field="ShipCountry" HeaderText="Ship Country" Width="210" />
                <ej:Column Field="ShipCountry" HeaderText="Ship Country" Width="310" />
                <ej:Column Field="ShipCountry" HeaderText="Ship Country" Width="110" />
                <ej:Column Field="EmployeeID" HeaderText="Emp ID" HeaderTemplateID="#employeeTemplate" TextAlign="Right" Width="90" />
            </Columns>
           <ClientSideEvents ActionComplete="complete" />
        </ej:Grid>
    </div>   
    <script type="text/javascript">
        function change(args) {
            if (args.isChecked) {
                var scrolling = { frozenRows: 0, frozenColumns: 2, height: 500, width: 1000 };
                $('#<%= OrdersGrid.ClientID %>').ejGrid("model.scrollSettings", scrolling);
            }
            else {
                var scrolling = { frozenRows: 0, frozenColumns: 0, height: 500, width: 1000 };
                $('#<%= OrdersGrid.ClientID %>').ejGrid("model.scrollSettings", scrolling);
            }
        }
    </script>
</asp:Content>



VN Vignesh Natarajan Syncfusion Team May 2, 2018 02:04 PM UTC

Hi David, 

Thanks for the patience. 

We have validated the reported issue and it is defect. We have logged a defect report “Grid Header is not scroller when removing the frozencolumn through setmodel”. The reported issue will be fixed and it will be included in our upcoming Release 2018 Volume 2 Which expected to be rolled out by the month of May 2018. 

Regards, 
Vignesh Natarajan   



DP David Price June 6, 2018 06:32 AM UTC

Hello,

Was this bug fixed yet ?


PK Prasanna Kumar Viswanathan Syncfusion Team June 7, 2018 09:27 AM UTC

Hi David, 

The issue has been fixed and included in the 2018 Volume 2 release which expected to be rolled out by the mid of June 2018.  

Regards, 
Prasanna Kumar N.S.V 


Loader.
Up arrow icon