How to set a row in edit mode from code-behind

Hi - i have made a grid where a dropdown-editfield triggers other fields on same row to change. 

I update the DataSource, but then the Grid leaves the edit mode. 

How do I keep the grid in edit mode, or how do I set a row in edit mode from a method? 



1 Reply

VN Vignesh Natarajan Syncfusion Team March 4, 2020 06:02 AM UTC

Hi Soren,  
 
Greetings from Syncfusion support.  
 
Query: “How do I keep the grid in edit mode, or how do I set a row in edit mode from a method?  
 
You can achieve your requirement using StartEdit method of Grid. Refer the below code example.  
 
<EjsGrid @ref="Grid" DataSource="@Orders" AllowPaging="true" Height="315">    
    . . . . . . .. . . .  
</EjsGrid> 
  
@code{ 
    public EjsGrid<Order> Grid { getset; } 
    public async void Changed() 
    { 
        await Grid.SelectRow(/*index*/);// select the desired record if it not selected 
        await Grid.StartEdit(); // to make selected record into edited state 
    } 
. . . . . . . .. .  
} 
 
 
StartEdit method will make selected record into edit mode. So kindly ensure that you have required record in selected state before calling the StartEdit method 
 
Refer our API documentation for your reference 
 
 
Kindly get back to us if you have further queries.  
 
Regards, 
Vignesh Natarajan. 


Loader.
Up arrow icon