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.
Unfortunately, activation email could not send to your email. Please try again.

Submit Selected Grid Rows To Server

Thread ID:

Created:

Updated:

Platform:

Replies:

131352 Jul 6,2017 12:59 AM Jul 7,2017 08:12 AM ASP.NET Core 1
loading
Tags: Grid
Zhen Liu
Asked On July 6, 2017 12:59 AM

I have a grid which allows multi row selection, how can I submit user selections to the server with a button press?

Venkatesh Ayothi Raman [Syncfusion]
Replied On July 7, 2017 08:12 AM

Hi Zhen, 
 
Thanks for contacting Syncfusion support. 
 
In button click , we suggest you to use getSeletedRecords method of ejGrid to get the selected records in Grid and then we need to pass selected records using ajax. Please refer to the below help document and code example.  
Code example: 
@Grid 
 
<ej-Button ID="refresh" Type="Button" Text="selectedReocds" click="Click" /> 
 
<ej-grid id="FlatGrid" allow-sorting="true" allow-paging="true" allow-reordering="true" selectiontype="Multiple"> 
 
. . . 
 
    <e-datamanager  url="/Home/DataSource" update-url="/Home/Edit" insert-url="/Home/Create" remove-url="/Home/Delete" adaptor="UrlAdaptor" /> 
 
    <e-columns> 
        . . . 
 
        
        
    </e-columns> 
 
</ej-grid> 
 
 
 
<script type="text/javascript"> 
 
    function Click() { 
        var obj = $(".e-grid").ejGrid("instance"); 
        var data = obj.getSelectedRecords(); 
          
        $.ajax({ 
            type: "POST", 
            //send the selected records to server side while button click 
            url: "Home/SelectedRecords", 
            datatype: "json", 
            contentType: "application/json; charset=utf-8", 
            data: JSON.stringify({ Grid1Data: JSON.stringify(data) }), 
            success: function (result) { 
            } 
        }); 
    } 
 
</script> 
Please let us know if you have any further assistance on this. 

Regards, 
Venkatesh Ayothiraman. 


CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.

;