Manual CRUD operations with the Telerik RadGrid control
I have been working on a project lately that was already using the Telerik ASP.NET Rad Controls suite. One of the new features was a fully editable web-grid, so I chose to use the existing ajax-enabled RadGrid control to speed my development. I chose to use a 3rd party control, mostly due to time constraints since the project required a grid with inline-editing, full CRUD operations, plus custom column templates, all with heavy Ajax support to avoid postbacks and excessive page size.
I soon discovered, the Telerik controls are nice tool for simple uses where you can use asp.net DataSource controls and automatic databinding, but not so much if you need to get "fancy" with your implementation. In my case I needed to do 2 things that cross over into the grey area where these controls excel.
First, I'm using an early 2.0 version of NetTiers for the DAL (with Service Layer implementation) with custom mods to the entities as the datasource, and second, I'm doing some aggregate custom ItemTemplates that require custom data-binding.
This lead to extreme complexity in the implementation because, A) this version of NetTiers' had problems with properly generating CRUD operations for its EntityDataSource controls (NetTiers entities mapped onto a custom ObjectDataSource style control) which prevented me from using the declarative model, and B) the RadGrid control simply sucks if you cannot use automatic databinding and if you require custom databinding logic.
It would be great if I could upgrade NetTiers and/or Teleriki RadControls to the latest versions, but it wasnt possible in this situation, nor is it likely that this would have solved my problems.
Anyhow, all this discussion is basically just to share you this one link to a user-contributed example I found incredibly useful after 3 days of searching their forums, demos, and 3rd party blogs. This example shows how to manually implement Insert/Update/Delete functionality within the RadGrid control by handling the events OnNeedDataSource, OnItemCommand, OnInsertCommand, OnUpdateCommand, and OnDeleteCommand:
http://www.telerik.com/community/code-library/subm...
The reason this link is important is because the Telerik website, with all of its dozens of examples, consistently shows very basic scenarios, even in samples labeled "advanced". Also, not all of the API features are fully or well documented to help you figure this out on your own.
Hopefully this simple link (which should be promoted to Telerik's demos/samples page) will help someone else as much as it did me.