Hi all,
We are implementing a RadGrid with a templated edit form. We've placed a custom user control within the edit form template, like this:
As you can see, we've set it up so that the user control's UserID property is set to 0 when inserting, or to the actual value if editing.
Here's what we want to happen:
We are implementing a RadGrid with a templated edit form. We've placed a custom user control within the edit form template, like this:
<
EditFormSettings
EditFormType
=
"Template"
>
<
FormStyle
CssClass
=
"GridForm"
></
FormStyle
>
<
FormTemplate
>
<
uc:UserRights
ID
=
"urEditForm"
UserID='<%# (Container is GridEditFormInsertItem) ? 0 :
DataBinder.Eval(Container.DataItem,"ID") %>'
runat="server"/>
</
FormTemplate
>
</
EditFormSettings
>
As you can see, we've set it up so that the user control's UserID property is set to 0 when inserting, or to the actual value if editing.
Here's what we want to happen:
- User control's ID is initially set to 0 when first opening the insert form.
- When the insert action is performed, get the DataKey value from the inserted row (int Identity).
- Re-set the control's UserID property to that DataKey value
- Call the Update public method on the control.
My question is: what event can I hook that will provide me both access to the identity column value of the newly inserted item AND still let me trigger the public method on my user control so that it can update what it needs to update?
(There is much more to the form than simply the user control. We are using mostly databound controls on the form template. This user control is somewhat more complex and needs to be reusable, which is why we chose to compartmentalize it into its own control.)
Thanks!