Thread ID: |
Created: |
Updated: |
Platform: |
Replies: |
110420 | Aug 1,2013 07:53 PM UTC | Aug 6,2013 04:30 AM UTC | ASP.NET MVC (Classic) | 1 |
![]() |
Tags: Grid |
Hi Doug,
Thank you for using Syncfusion products.
Your requirement can be achieved in “OnRecordSelectionEvent”. Please refer to the following steps in the sample:
Step #1: Add client side event for RecordSelection.
[Aspx]
@{
Html.Syncfusion().Grid<Grid_CS_Razor.Models. Student >('GenericListGrid')
. . . .
.ClientSideEvents(eve => {
eve.OnRecordSelectionEvent('recordSelect'); // record selection event
})
}
Step#2:
[JavaScript]
function recordSelect(sender, args)
var record = Sys.Serialization.JavaScriptSerializer.serialize(args.record); // can get selected record values in args.record
$.ajax({
type: 'Post',
url: 'Home/GetRecords',
data: { rec: record }, // send serialized data to controller through ajax post
dataType: 'html',
success: function (data) {
return data;
}
});
}
Step #3:
[Controller]
[AcceptVerbs(HttpVerbs.Post)]
public ActionResult GetRecords(string rec) // retrieve the data here and desterilize it
{
Student ord = new JavaScriptSerializer().Deserialize<Student >((string)rec); // can get selected record values here
return RedirectToAction('Index');
}
For your convenience ,we have prepared the sample and the same can be downloaded from the following link:
Please try this and let us know if you have any queries.
Regards,
Eswari S
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.
or the page will be automatically redirected to sign-in page in 10 seconds.