Working with DataGrids in jQuery | 4 | WebReference

Working with DataGrids in jQuery | 4


Create the Grid and Bind the Data

Now that you have the necessary styles and scripts in place, you can create the grid you need using some JavaScript code as shown below:

Now, here's how you would bind data to your grid using ASP.NET MVC:

If you wanted to use a WCF service to return data that you would then bind to your grid, that's also simple. You would first need a WCF service that returns the student data in JSON format.

You can now call the GetStudents() method from your Web page through scripts:

That's it! You are done. You now have a head start to working with data grids in jQuery. Happy coding!

Original: January 3, 2011