How to access columns, all properties and data of Telerik’s MVC Grid on client

If you want to access all data in your Grid that you have in DOM in your browser on client, you maybe found this helpful link to Telerik’s help page :

http://www.telerik.com/help/aspnet-mvc/telerik-ui-components-grid-client-api-and-events.html

But looking at all those events that are out of box, you maybe eventually need to access all columns or data that you have in grid or tweak some things on client. Then direct access to grid in DOM would be much appreciated.

Answer is in fact on page above, it’s just not that obvious, until you inspect all the elements in DOM you have once page loads.

$('#id-of-our-grid').data('tGrid');

This will give you element with properties like :

ajax – and all URLs that will grid use, columns, data, currentPage, dataSource, modelBinder, etc…..

Just try it and you will see 🙂

Hope this helps.

Leave a Reply

Your email address will not be published. Required fields are marked *