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

[Solved] Add GridItem to RadGrid

2 Answers 104 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Angrez
Top achievements
Rank 1
Angrez asked on 04 May 2009, 05:21 PM
Hi,

I would like to add GridItem to RadGrid programmatically. Following is the scenario:

I have custom buttons on my web page like "Add", "Edit". On add button click I show a form which contains controls for entering the data for new item in grid. On update I extract the values from these controls and then want to create GridItem & add it to Grid's collection.

As per requirement we don't want to use the Add, Edit buttons of rad grid because they show editable fields either below the record or do inplace editing. Opening a new pop-up to edit the record is not an option.

Is there any work around to update/add grid items in the collections?

Thanks,
Angrez

2 Answers, 1 is accepted

Sort by
0
Shinu
Top achievements
Rank 2
answered on 05 May 2009, 05:50 AM
Hi Angrez,

Go through the following code library submission which explains how to update the Grid using an external edit form.
Update RadGrid with outside editForm

You can also refer the following online demo which perform both insert and Update using a form out side the Grid.
http://demos.telerik.com/aspnet-ajax/grid/examples/client/insertupdatedelete/defaultcs.aspx

Shinu.
0
Angrez
Top achievements
Rank 1
answered on 05 May 2009, 06:54 AM
Hi Shinu,

Thanks for your reply. The only problem with the solutions is either they are using ViewState to store the data source or are updating the datasource & then binding the grid again.

What I want is to let the grid take care of inserted/edited rows & finally save all the inserted/edited rows to the database. So that I don't have to use ViewState or update the datasource.

Thanks,
Angrez
Tags
Grid
Asked by
Angrez
Top achievements
Rank 1
Answers by
Shinu
Top achievements
Rank 2
Angrez
Top achievements
Rank 1
Share this question
or