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

How to insert record using grid

5 Answers 136 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Sumanth
Top achievements
Rank 1
Sumanth asked on 29 Nov 2010, 09:35 AM
Hi,

Sorry for my basic question.

I am replacing Asp.net ListView with telerik grid. In my list view, i am using InsertItem template to insert records into database. To achieve same thing in rad grid, am using EditFormSettings, FormTemplate and CommandItem properties of gird. But nothing is displaying when am clicking add new record button. (am expecting controls to display which are defined in FormTemplate.

Could you please help on this regard.

Any sample would be highly appreciated.

Thanks,
Sumanth

5 Answers, 1 is accepted

Sort by
0
Pavlina
Telerik team
answered on 29 Nov 2010, 10:41 AM
Hi Sumanth,

To handle the actual insert operation when the user hits the Insert button, you can hook the InsertCommand event of Telerik RadGrid or the ItemCommand event (checking whether e.CommandName is RadGrid.PerformInsertCommandName) as explained in this article.

Additionally, you can review this online demo to see the approach in real-life example.

Greetings,
Pavlina
the Telerik team
Browse the vast support resources we have to jumpstart your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.
0
Shinu
Top achievements
Rank 2
answered on 29 Nov 2010, 10:43 AM
Hello Sumanth,


Have you set the EditFormSettings - EditFormType as "Template" to show the customized edit/insert form?
demo
documentation



-Shinu.
0
Sumanth
Top achievements
Rank 1
answered on 29 Nov 2010, 10:50 AM
Hi Shinu,

Yes. I already assigned values to EditFormType property

Thanks,
Sumanth
0
Sumanth
Top achievements
Rank 1
answered on 29 Nov 2010, 10:54 AM
Hi Pavlina,

I guess, that link (http://www.telerik.com/help/aspnet-ajax/grdinsertingvaluesusercontrolformtemplate.html) describing to store data in data base which is entered by user. But here my problem is, once i click on "Add new record" button, nothing is displaying on my screen including grid.

Thanks,
Sumanth
0
Sumanth
Top achievements
Rank 1
answered on 29 Nov 2010, 11:31 AM
Hi,

I forgot to call bind method in ItemCommand event. That is the problem. Thanks for all for your help.

Thanks,
Sumanth
Tags
Grid
Asked by
Sumanth
Top achievements
Rank 1
Answers by
Pavlina
Telerik team
Shinu
Top achievements
Rank 2
Sumanth
Top achievements
Rank 1
Share this question
or