Hello,
The Update command does not work when I try to update values inside a RadGrid that resides inside a UserControl.
The UserControl is loaded into a TabStrip tab when the tab is clicked by the user. This is the code that loads the user control:
parent.Controls.Clear();
UserControl ctrl = (UserControl)LoadControl(controlName);
string
userControlID = controlName.Split(
'.'
)[0];
userControlID = userControlID.Replace(
"/"
,
""
).Replace(
"~"
,
""
) +
"_UC"
;
ctrl.ID = userControlID;
parent.Controls.Add(ctrl);
I'm using Advanced Databinding for the Radgrid like so:
protected
void
rgdHousingVersion_NeedDataSource(
object
sender, GridNeedDataSourceEventArgs e)
{
rgdHousingVersion.DataSource = BLL.GetAHUHousingVersions();
}
And here's the HTML for the UserControl:
<%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %>
<
telerik:RadAjaxManagerProxy
ID
=
"rampAdminHousingVersion"
runat
=
"server"
>
<
AjaxSettings
>
<
telerik:AjaxSetting
AjaxControlID
=
"rgdHousingVersion"
>
<
UpdatedControls
>
<
telerik:AjaxUpdatedControl
ControlID
=
"rgdHousingVersion"
/>
</
UpdatedControls
>
</
telerik:AjaxSetting
>
</
AjaxSettings
>
</
telerik:RadAjaxManagerProxy
>
<
telerik:RadGrid
ID
=
"rgdHousingVersion"
runat
=
"server"
OnNeedDataSource
=
"rgdHousingVersion_NeedDataSource"
OnEditCommand
=
"rgdHousingVersion_EditCommand"
OnUpdateCommand
=
"rgdHousingVersion_UpdateCommand"
AutoGenerateColumns
=
"false"
AllowPaging
=
"false"
>
<
MasterTableView
DataKeyNames
=
"HousingID"
CommandItemDisplay
=
"Top"
InsertItemPageIndexAction
=
"ShowItemOnCurrentPage"
EditMode
=
"InPlace"
EnableViewState
=
"true"
>
<
Columns
>
<
telerik:GridEditCommandColumn
ButtonType
=
"ImageButton"
EditImageUrl
=
"~/Images/Graphics/16/Change_16.png"
></
telerik:GridEditCommandColumn
>
<
telerik:GridBoundColumn
DataField
=
"HousingID"
HeaderText
=
"Housing ID"
UniqueName
=
"HousingID"
></
telerik:GridBoundColumn
>
<
telerik:GridBoundColumn
DataField
=
"Description"
HeaderText
=
"Description"
UniqueName
=
"Description"
></
telerik:GridBoundColumn
>
<
telerik:GridBoundColumn
DataField
=
"Reference"
HeaderText
=
"Reference"
UniqueName
=
"Reference"
></
telerik:GridBoundColumn
>
</
Columns
>
<
EditFormSettings
>
<
EditColumn
ButtonType
=
"ImageButton"
/>
</
EditFormSettings
>
</
MasterTableView
>
</
telerik:RadGrid
>
Here's the code-behind for the OnEditCommand and OnUpdateCommand:
protected
void
rgdHousingVersion_EditCommand(
object
sender, GridCommandEventArgs e)
{
//Does fire
}
protected
void
rgdHousingVersion_UpdateCommand(
object
sender, GridCommandEventArgs e)
{
//Does NOT fire
}
I'm really not sure what I'm doing wrong. Why is the UpdateCommand not firing? Any help is appreciated. I have not been able to find an answer to this problem anywhere. Thanks!