Hi Brad,
Thanks for using Syncfusion products.
We glad to inform you that we have achieved your
requirement(‘Checked items’). We have prepared a simple sample to demonstrate
this and please refer the below code snippets.
[Template.aspx]
var gridId = "Grid1";
$("#Save").click(function (e) {
var
tempCheckedRecords = new Array();
var
gridobj = $find('Grid1');
var
checkboxes = $('#' + gridId + ' .check');
$.each(checkboxes, function (index, element) {
if
(element.checked == true) {
gridobj.selectRow($(element).parents("tr:first")[0].rowIndex);
gridobj.setJSONRecord();
tempCheckedRecords.push(gridobj.jsonrecord[0]); //Here
you get the selected checkbox items
}
});
And the same can be downloaded from the below link.
Sample: Sample.zip
Please try this, and if it does not meets your requirement,
could you please provide more information on this so that we can provide a
better solution quickly?.
Please let us know if you have any concerns.
Regards,
Hariharan J.V.
Hi Greg,
Thanks for using Syncfusion Products.
We glad to inform you that your requirement can be achieved using the below code snippet.
[Cshtml]
column.Add("Check").Format("<input type='checkbox' name='check_{ItemId}' class='chkClass' />");
[Script]
$("#SelectedRecordsPKey").click(function (e) {
var params = {};
var gridobj = $find('Grid1');
var checkboxes = $('.chkClass');
//Getting selected check box records
$.each(checkboxes, function (index, element) {
if (element.checked == true)
{
var recordId = $(this).attr('name').replace('check_', '')
params["keys[" + index + "]"] = recordId;
}
});
$.ajax({
type: 'post',
url: "Home/SelectedRowsAction",
datatype: 'json',
data: params,
success: function (data) {
return data;
}
});
});
[Controller]
[AcceptVerbs(HttpVerbs.Post)]
public JsonResult SelectedRowsAction(List<int> keys)
{
return Json(keys);
}
For your convenience we have attached a sample. Could you use that sample and get back to us if you have any queries.
Let us know if you have any concerns.
Regards,
Satheeskumar S