16 Comments

Thanks Chris - just added the source. Let me know if you have any questions.

Laurent
19 May 2008

Hello,
The database is not included in your source code. Would it be possible to get it also? I'd like to be able to test it locally.
Another point: I’d like to load data by only using web service. I mean: not to load any data in the grid at first and initiate a WebService request once the page is loaded to get the first rows. But as far as I understood, it is not possible to create new rows from Javascript. Is there as solution?
BR, Laurent

Laurent, the database file is huge - you can generate locally a database with the same structure easily. In the current version the grid does not have any client-side API to create rows completely client-side however we will do our best to provide this as soon as possible. Such logic however will cause some limitations - there will be no more server-side templates/controls and you will get undesired flicker on initial load.

You can use a wide variety of data-sources for grid structure generation (the only requirement is that these custom objects implement the ITypedList/IEnumarable/ICustomTypeDescriptor interfaces). You can check this example:
http://www.telerik.com/DEMOS/ASPNET/Prometheus/Grid/Examples/Programming/Binding/DefaultCS.aspx
and of course you can bind the grid via DataSourceID codeless to ANY DataSourceControl.

Jagadish
20 May 2008

Hi,
Im trying to use RadGrid by adding rows to it at the client-side, ie i cannot bind it to any datasource directly but create rows and add it to the grid using javascript functions provided by Telerik radgrid. Is it possible to do this or should we necessarily bind it to a datasource on the server side ?
Thanks

This is very interesting. I'm curious in seeing how far the radgrid can be taken with this. Such as, what features work, and what don't today. I'm trying to go viewstate and postback free in all new code. Linq and json ajax sound like nice light weight alternatives.

Hi Chris,
I believe that all grid features will work without problems using this approach.

Chris M
01 Oct 2008

Hi, very slick and very fast. Anyway you could provide and example that uses a nested grid.
Thanks

PS
10 Nov 2008

I was looking at your reply to Laurent. Did you add any functionality to the grid to handle adding a new row to the grid from the client side? My requirement is to add a new row to the grid using client side javascript.

shan
18 Dec 2008

i have found a way to add a row in client side.. i have created a json object in client side and bound it grid thru javascript..whenever i need to add a row, 1st i add a record in json object and bound it... see the following example

You can clearly see that, the textbox inside the grid are generated thru the above code and the style will make it looks like excel worksheet.. you can add your own control in DocumentOnRowDataBound method..

tnx,

Shan

Jim Wilson
21 Jan 2009

Thanks for the article!

Shan, thanks to for your code for creating a record client-side! It is very easy to understand and simple to use.

Naeem
28 May 2009

I too use Shan approach but it only works for master table. if you have grid with master -detail table , rebind with Json object which structure is according to master-detail structure, it fails to bind detail table for new master table row.