How do I keep edit mode when click another row in grid during editing

Hello,

I'm using OnServerEditRow event for grid.
When I'm editing the row, if I click another row, OnServerEditRow event fires and editing mode was over.

What I want to do is when editing the row, if I click another row by accident, I want to keep edit mode and also don't want to fire OnServerEditRow.
Is it possible to do that?

I attach detail.

Best Regards,
Yukiko

Attachment: serveredit_24cc30f5.7z

3 Replies

PK Prasanna Kumar Viswanathan Syncfusion Team August 14, 2018 09:33 AM UTC

Hi Yukiko, 

Thanks for using Syncfusion products. 

Based on your query we found that you need to maintain the record in editable state when we select on other rows in Grid. To achieve your requirement, we suggest you to use rowSelecting event of ejGrid. The rowSelecting event will be triggered before the row is going to be selected. In this event we check the condition with grid edit form length and avoid the selection by defining args.cancel as true.  

Refer the below code example: 

  <ej:Grid ID="OrdersGrid" runat="server" AllowPaging="True"  AllowTextWrap="true" OnServerEditRow="EditEvents_ServerEditRow" 
                    OnServerAddRow="EditEvents_ServerAddRow" OnServerDeleteRow="EditEvents_ServerDeleteRow"> 
                    <ClientSideEvents RowSelecting="rowselect" ActionComplete="complete" EndAdd="endAdd" EndDelete="endDelete" EndEdit="endEdit" /> 
.                           .                   .              .           .  
                </ej:Grid> 
            </ContentTemplate> 
        </asp:UpdatePanel> 
        </div> 
        
    </div> 
    <script type="text/javascript"> 
        function rowselect(args) { 
             var Obj = $('#<%= OrdersGrid.ClientID %>').ejGrid("instance"); 
       if(Obj.element.find(".gridform").length > 0) 
           args.cancel = true 
        } 
    </script> 
    
Refer our help documentation for your reference 


Please get back to us if you have further queries. 

Regards, 
Prasanna Kumar N.S.V 
 



YI Yukiko Imazu August 14, 2018 06:10 PM UTC

Hi Prasanna Kumar,

Thank you for your help.
I could resolve my issue.

Best Regards,
Yukiko


FS Farveen Sulthana Thameeztheen Basha Syncfusion Team August 15, 2018 04:30 AM UTC

Hi Yukiko, 

Thanks for your update. Please get back to us if you need any further assistance. 

Regards, 

Farveen sulthana T 


Loader.
Up arrow icon