Hi all,
I have a commanditemtemplate with a button that I would like to use to edit one row from the radgrid using a popup usercontrol.
The situation:
I cannot edit the row with the GridEditCommandColumn because there is only one row in the entire grid that is allowed to be edited, and I don't want to work with hiding buttons because I think it's an ugly solution. Therefore I would like to edit the row by pressing a button at the commanditemtemplate.
Unfortunately, the popup doesn't show. I probably forgot some setting somewhere, could someone please help me?
aspx code snippet
code behind c#:
Thank you!
Marlies
I have a commanditemtemplate with a button that I would like to use to edit one row from the radgrid using a popup usercontrol.
The situation:
I cannot edit the row with the GridEditCommandColumn because there is only one row in the entire grid that is allowed to be edited, and I don't want to work with hiding buttons because I think it's an ugly solution. Therefore I would like to edit the row by pressing a button at the commanditemtemplate.
Unfortunately, the popup doesn't show. I probably forgot some setting somewhere, could someone please help me?
aspx code snippet
<
MasterTableView
DataKeyNames
=
"keyName"
AllowMultiColumnSorting
=
"True"
EditMode
=
"PopUp"
CommandItemDisplay
=
"Top"
>
<
EditFormSettings
EditFormType
=
"WebUserControl"
/>
<
CommandItemSettings
ShowAddNewRecordButton
=
"false"
AddNewRecordText
=
""
ShowRefreshButton
=
"false"
RefreshText
=
""
/>
<
CommandItemTemplate
>
<
telerik:RadButton
ID
=
"RadButtonDone"
runat
=
"server"
Text
=
"Done"
CommandArgument
=
"Done"
CommandName
=
"Edit"
ToolTip
=
"Mark the item as done"
>
<
Icon
PrimaryIconUrl
=
"Images/done.gif"
PrimaryIconLeft
=
"8"
PrimaryIconTop
=
"5"
/>
</
telerik:RadButton
>
</
CommandItemTemplate
>
code behind c#:
protected
void
RadGridMyGrid_ItemCommand(
object
source, GridCommandEventArgs e)
{
if
(e.CommandName == RadGrid.EditCommandName)
{
// Change status to 'Done'
if
(e.CommandArgument ==
"Done"
)
{
SessionState.Current.intKey =
GetKeyValueFromRowThatIsAllowedToBeEdited(ValueFromSessionState);
e.Item.OwnerTableView.IsItemInserted =
false
;
e.Item.OwnerTableView.EditFormSettings.PopUpSettings.Width = 700;
e.Item.OwnerTableView.EditFormSettings.PopUpSettings.Modal =
true
;
e.Item.OwnerTableView.EditFormSettings.UserControlName =
"ChangeStatusToDone.ascx"
;
}
}
}
Thank you!
Marlies