We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

Frozen column

Hello,

I have a grid with three frozen columns. When I edit a row (Normal EditMode) I found two problems:
  1. I do double click on a cell, but the edition begins on another cell (two or three cells before)
  2. When the edition is ended, the grid scrolls to the begining of the row.

Thanks.



1 Reply

VN Vignesh Natarajan Syncfusion Team August 30, 2017 01:29 PM UTC

Hi Jorge, 

Thanks for contacting Syncfusion support. 
Query1: I do double click on a cell, but the edition begins on another cell (two or three cells before)  
              It is default behavior of the Grid to focus the first visible/editable element. As a workaround we suggest you to achieve your requirement using actionComplete and recordDoubleclick event of ejGrid. In the RecordDoubleClick, we can get the column name using cell index. Based on the  column name, you can focus the element that you have clicked in the ActionComplete event. Here, this.model.columnName is implicit variable and we are adding it manually.   
<ej:Grid ID="FlatGrid" runat="server" AllowPaging="True" AllowScrolling="true" EnableRowHover="False">  
                    <Columns>  
                        ----------------------  
                   
                    </Columns>  
                    <ClientSideEvents RowSelected="rowSelect" ActionComplete="complete"RecordDoubleClick="doubleclick" />  
                    <EditSettings AllowAdding="true" AllowEditing="true" AllowDeleting="true" />  
                    <%--<ScrollSettings Height="100%" />--%>  
                    <ToolbarSettings ShowToolbar="True" ToolbarItems="search,excelExport,pdfExport"></ToolbarSettings>  
                </ej:Grid>  
  
-----------------------------------  
 
<script> 
        function doubleclick(args) { 
            if(args.cell.parents().hasClass("e-frozencontentdiv")) 
                this.model.columnName = this.getColumnByIndex(args.cellIndex).field; 
            else { 
                args.cellIndex = args.cellIndex + this.model.scrollSettings.frozenColumns; 
                this.model.columnName = this.getColumnByIndex(args.cellIndex).field; 
            } 
        } 
 
        function complete(args) { 
            if (args.requestType == "beginedit") {                
                        var grid = $("#MainContent_Grid1").ejGrid("instance"); // taking the grid instace using grid ID 
                        var elem = $("#MainContent_Grid1" + grid.model.columnName); // to get the Grid edit cell  
                        if (elem.hasClass("e-dropdownlist")) // if the selected value is dropdown 
                            elem.closest(".e-ddl").focus(); 
                        else if (elem.hasClass("e-numerictextbox")) // if the selected value is numeric textbox 
                            elem.siblings('input:visible').first().select().focus(); 
                        else 
                            elem.focus().select();     // to foxus the element             
            } 
        }    </script> 
 
 
To differentiate frozen column and movable columns, we have checked the parent element whether it has class “e-frozencontentdiv”, if not that added frozencolumns value to args.cellIndex to get Correct cell index. 
Refer to the following Help Document.  
 
Query2: When the edition is ended, the grid scrolls to the begining of the row. 
We have analyzed your query and we are able to reproduce the issue at our end when the product version is  15.2.0.46 and below. It is a known issue and we have fixed the issue in our latest release (15.3.0.26). So please update to latest version. We have prepared sample based on your requirement. The same can be downloaded from below link. 
Please get back to us if you still face the issue or if you using same 15.3.0.26 version. 
1.       Kindy share which version you are using. 
2.       Share the grid code(aspx and server side). 
3.       Screenshot of script error in console window(if any). 
 
 
Regards, 
Vignesh Natarajan. 



Loader.
Up arrow icon