Hello,
I have the following radGrid:
When I expand the row it fills the Usercontrol:
In the Usercontrol I have:
and in the Code behind of the Usercontrol:
The first Click the pages Flickers as it could not bind the Ajax Settings. Then the Click it work normally.
I also tried to user the RadAjaxManagerProxy, but I could not make it work.
Could you please give me some advise on how to get it right...
Thank you very much,
Rod.
I have the following radGrid:
<
telerik:RadGrid
ID
=
"radGrid"
OnItemDataBound
=
"radGrid_ItemDataBound"
OnItemCommand
=
"radGrid_ItemCommand"
>
<
MasterTableView
>
<
Columns
>
...
</
Columns
>
<
NestedViewTemplate
>
<
ParteControl:ParteControl
id
=
"ctl"
visible
=
"false"
runat
=
"server"
/>
</
NestedViewTemplate
>
</
MasterTableView
>
</
telerik:RadGrid
>
When I expand the row it fills the Usercontrol:
protected
void
radGrid_ItemCommand(
object
sender, Telerik.Web.UI.GridCommandEventArgs e)
{
if
(e.CommandName == Telerik.Web.UI.RadGrid.ExpandCollapseCommandName)
{
if
(!e.Item.Expanded)
{
Label lblId = (Label)e.Item.OwnerTableView.Items[e.Item.ItemIndex][
"Info"
].FindControl(
"lblId"
);
controls_partescontrol ctl = (controls_partescontrol)((Telerik.Web.UI.GridDataItem)e.Item).ChildItem.FindControl(
"ctl"
);
String[] arrValues;
String srtValues = lblId.Text.ToString();
arrValues = srtValues.Split(
'#'
);
ctl.Pre();
ctl.Visible =
true
;
ctl.Value = arrValues[0].ToString();
ctl.Coluna = arrValues[1].ToString();
ctl.Load();
}
}
}
In the Usercontrol I have:
<
telerik:RadContextMenu
ID
=
"ctxMenu"
runat
=
"server"
>
<
Targets
>
<
telerik:ContextMenuControlTarget
ControlID
=
"ajaxPanel"
/>
</
Targets
>
<
Items
>
<
telerik:RadMenuItem
>
<
ItemTemplate
>
<
asp:LinkButton
ID
=
"lnk_1"
OnClientClick
=
"javascript: callHoldInfo(this,'Parte');"
OnCommand
=
"Menu_ItemClick"
CommandArgument
=
"0"
runat
=
"server"
style
=
"text-decoration: none !important;"
></
asp:LinkButton
>
</
ItemTemplate
>
</
telerik:RadMenuItem
>
<
telerik:RadMenuItem
>
<
ItemTemplate
>
<
asp:LinkButton
ID
=
"lnk_2"
OnCommand
=
"Menu_ItemClick"
CommandArgument
=
"1"
runat
=
"server"
style
=
"text-decoration: none !important;"
></
asp:LinkButton
>
</
ItemTemplate
>
</
telerik:RadMenuItem
>
</
Items
>
</
telerik:RadContextMenu
>
<
asp:Literal
ID
=
"ltrError"
runat
=
"server"
/>
<
asp:Panel
runat
=
"server"
id
=
"ajaxPanel"
>
</
asp:Panel
>
and in the Code behind of the Usercontrol:
if
(
this
.Page !=
null
)
{
RadAjaxManager ajaxManager = RadAjaxManager.GetCurrent(
this
.Page);
if
(ajaxManager !=
null
)
{
foreach
(RadMenuItem item
in
ctxMenu.Items)
{
foreach
(Control ctrl
in
item.Controls)
{
if
(ctrl
is
LinkButton)
{
AjaxSetting ajaxSetting =
new
AjaxSetting(ajaxManager.ID);
ajaxSetting.AjaxControlID = ctrl.ID.ToString();
ajaxSetting.UpdatedControls.Add(
new
AjaxUpdatedControl(ltrError.ID.ToString(),
"ajaxLoad"
));
ajaxSetting.UpdatedControls.Add(
new
AjaxUpdatedControl(ajaxPanel.ID.ToString(),
"ajaxLoad"
));
ajaxManager.AjaxSettings.Add(ajaxSetting);
}
}
}
}
}
The first Click the pages Flickers as it could not bind the Ajax Settings. Then the Click it work normally.
I also tried to user the RadAjaxManagerProxy, but I could not make it work.
Could you please give me some advise on how to get it right...
Thank you very much,
Rod.