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.

How to access the values in a grid from the template columns

Thread ID:

Created:

Updated:

Platform:

Replies:

132441 Sep 1,2017 05:52 PM Sep 5,2017 09:22 AM ASP.NET Core 1
loading
Tags: Grid
dsapo
Asked On September 1, 2017 05:52 PM

Hi Support:

I have a view with a grid.  The grid datasource is populated with a ViewBag.

The grid will display data that can only be edited.

Two columns are template columns.  The first is a checkbox and the other is an input box.  We decided to use templates because the checkbox should be clickable with a single click and the other template (input) is because is displayed only in certain rows.

Outside the grid there is a Save button.  The goal is that when the save button is clicked, the new data must be transferred to the server via ajax.

The problem is that I dont know how to read the values from the grid, because the dataSource property does not have the modifications.

Please help.

Thanks in advanced

David

Vignesh Natarajan [Syncfusion]
Replied On September 5, 2017 09:22 AM

Hi David, 

Thanks for using Syncfusion products. 

We have analyzed your query. From your requirement ”checkbox should be clickable with a single click” so we suggest you to use batch editing with checkbox column to achieve your requirement. Please refer the below image for same 

 



We have prepared the sample based your requirement. 
Query2: “ I dont know how to read the values from the grid” 

              On the ej-Button’s click event we have taken the Grid Instance and called the batchsave() method, which will  call batch-url and update the modified data into database. Please refer below code snippet. 

<ej-button id="button_button" text="Save" show-rounded-corner="true" size="Mini" type="Button"> 
                        . 
                        . 
<script type="text/javascript"> 
 
        $("#button_button").click(function () { 
            var gud = $("#FlatGrid").ejGrid("instance"); //Grid instance 
            gud.batchSave(); // calling the batcsave method 
        }); 
    </script> 
     
Please refer our online documentation for your reference 


Regards, 
Vignesh Natarajan 


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.

;