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

Command Events

1 Answer 123 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Doug
Top achievements
Rank 1
Doug asked on 19 Dec 2010, 10:05 PM
Why is there an ItemInsert event and an ItemCommand event? Why not case out all the CRUD events in the ItemCommand event? Does it have something to do with having AllowAutomaticInserts turned on?

Are these events where I should get the values from my EditFormTemplate controls and assign them to the Update/Delete/Insert parameters of my ObjectDataSource?

I'm a newbie, obviously. Sorry for all the questions at once.

1 Answer, 1 is accepted

Sort by
0
Princy
Top achievements
Rank 2
answered on 21 Dec 2010, 11:50 AM
Hello Doug,

ItemCommand mainly used for technique called "event bubbling" that allows a child control to propagate events up its containment hierarchy. As an example: When "Update" command bubbles, RadGrid will fire first ItemCommand event, and if the event is not canceled (e.Canceled set to false) then RadGrid will fire UpdateCommand event and then it will refresh automatically.  For more information on this please refer the following documentation.
Command reference (Event bubbling in Telerik RadGrid)

In order to get the values from inserted/updated item, you can use ExtractValuesFromItem() method either in InsertCommand/UpdateCommand or inside ItemCommand event with appropriate CommandName.
Inserting values in-place and EditForms
Inserting values using UserControl/FormTemplate
Updating values in-place and with edit forms
Updating values using UserControl/FormTemplate

Hope this information helps,
Princy.
Tags
Grid
Asked by
Doug
Top achievements
Rank 1
Answers by
Princy
Top achievements
Rank 2
Share this question
or