This is a migrated thread and some comments may be shown as answers.

how to load rad grid using jquery ajax?

1 Answer 243 Views
Grid
This is a migrated thread and some comments may be shown as answers.
khaled jendi
Top achievements
Rank 1
khaled jendi asked on 07 Mar 2012, 12:56 PM
hi,

I have jquery ajax function (json) to get datatable from database, now I want to assign this datatable to rad grid data source,
so any help how to do that?

1 Answer, 1 is accepted

Sort by
0
Accepted
Richard
Top achievements
Rank 1
answered on 09 Mar 2012, 04:19 PM
Khaled:

If you have not already done so, I'd suggest taking a look at this blog post to assist you with implementing converters that can create DataSet/DataTable and DataRow JSON with JSON.NET:

DataTable JSON Serialization in JSON.NET and JavaScriptSerializer

Once you've got a valid datatable, you can use JavaScript to bind and refresh the grid:
function updateGrid(result)
{
    var tableView = $find("<%= RadGrid1.ClientID %>").get_masterTableView();
    tableView.set_dataSource(result);
    tableView.dataBind();
}

See the Grid/Client Binding online demo for help.
Tags
Grid
Asked by
khaled jendi
Top achievements
Rank 1
Answers by
Richard
Top achievements
Rank 1
Share this question
or