Hi,
I am having issue accessing radwindow object. I am trying access it during radgrid_itemcommandobject.
My javascript function - as shown in the code below - "ShowDutyWindowClient" fails when it tries to get the radwindowmanager. Radwindowmanger object returns null.
I would appreciate help with this.
Thanks,
Manisha
Here is my code
I am having issue accessing radwindow object. I am trying access it during radgrid_itemcommandobject.
My javascript function - as shown in the code below - "ShowDutyWindowClient" fails when it tries to get the radwindowmanager. Radwindowmanger object returns null.
I would appreciate help with this.
Thanks,
Manisha
Here is my code
//Usercontrol – codebehind
protected void rgDuty_ItemCommand(object source, GridCommandEventArgs e)
{
switch (e.CommandName)
{
case RadGrid.InitInsertCommandName:
e.Canceled =true;
long positionDescriptionID = CurrentPDID;
script = string.Format("ShowDutyWindowClient('{0}','{1}');", "Insert", positionDescriptionID);
ScriptManager.RegisterStartupScript (this,this.GetType (),"showdutywindowClient" ,script,true );
break;
case RadGrid.EditCommandName :
e.Canceled = true;
gridItem = e.Item as GridDataItem;
int dutyID = int.Parse(gridItem.GetDataKeyValue("DutyID").ToString());
script = string.Format("ShowDutyWindowClient('{0}','{1}');", "Edit", dutyID);
ScriptManager.RegisterStartupScript (this,this.GetType (),"showdutywindowClient" ,script,true );
break;
default:
RGQualEnabled = true;
break;
}
}
}
//UserControl Design
<
telerik:RadWindowManager
ID
=
"radWindowManagerDuties"
runat
=
"server"
Behavior
=
"Default"
InitialBehavior
=
"None"
RegisterWithScriptManager
=
"true"
>
<
Windows
>
<
telerik:RadWindow
ID
=
"rwPDDuties"
runat
=
"server"
RegisterWithScriptManager
=
"true"
Skin
=
"WebBlue"
Height
=
"600"
Width
=
"600"
Behaviors
=
"Close"
VisibleStatusbar
=
"false"
ReloadOnShow
=
"true"
>
</
telerik:RadWindow
>
</
Windows
>
</
telerik:RadWindowManager
>
<
telerik:RadCodeBlock
ID
=
"rcbCodeBlock"
runat
=
"server"
>
<
script
type
=
"text/javascript"
>
function ShowDutyWindowClient(mode, id) {
var navigateurl;
var title;
if (mode == "Insert") {
navigateurl = "~/CreatePD/AddEditDuty.aspx?mode=Insert&PositionDescriptionID=" + id;
title = "Add Duty";
}
else {
navigateurl = "~/CreatePD/AddEditDutyContent.aspx?mode=Update&DutyID=" + id;
title = "Edit Duty";
}
var oWnd = radopen(navigateurl, "rwPDDuties");
}
</
script
>
</
telerik:RadCodeBlock
>