This is a migrated thread and some comments may be shown as answers.

ItemCommand does not fire

1 Answer 144 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Jean-Marc Windholz
Top achievements
Rank 1
Jean-Marc Windholz asked on 22 Jul 2011, 01:58 PM
I'm going crazy and I'm not sure what the problem is.

Here is my situation:
My main page (aspx) contains two usercontrol (ascx)
first one is basically a tree. second one is a radgrid and some textbox I fill on row selection itemcommand.

The second one is dinamically loaded depending on tree's node value has a radgrid. I mean, I load different ascx by the node's value but they all are a radgrid and textboxes.

main Page
<td>
<qsf:RTV runat="server" ID="CatTree1" ></qsf:RTV>
</td>
                                     
<td style="width:80%;vertical-align:top">
 <asp:UpdatePanel ID="UpdatePanel1" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<asp:PlaceHolder ID="PlaceHolder_UC" runat="server"></asp:PlaceHolder>
</ContentTemplate>
                                             
<Triggers>
<asp:AsyncPostBackTrigger ControlID="CatTree1" />
</Triggers>
</asp:UpdatePanel>                                      
</td>

PlaceHolder_UC is dinamically loaded this way


function AAAAAAA()....
Dim UControl As Control
If ....
  controlPath = "Arrangements2.ascx"
End If
 
UControl = CType(LoadControl(controlPath), UserControl)
 
If controlPath <> "" Then
  If Not (UControl Is Nothing) Then
 'ascx dinamically attached
  PlaceHolder_UC.Controls.Clear()
  PlaceHolder_UC.Controls.Add(UControl)
  .....
  Dim myUC As ASP.Arrangements2 = DirectCast(tempControl, ASP.Arrangements2)
 
  'here I Call function on second ascx, fill radgrid whit data
  myUC.InitControl(value)
  ....
 
  End If
End If



I call AAAAAAA on the nodeclick event catch on the aspx raised by my first ascx
Ascx2 radgrid is filled, i click on the rows, itemcommand fires, I fill the textboxes. everything is ok

here come my problem
I click on a different tree's node, AAAAAAA is called, ascx2 radgrid is filled with a new set of data, i click on the rows and itemcommand never fires

here's my ascx2 (summaring)
<asp:UpdatePanel ID="UpdatePanelAscx" runat="server" UpdateMode="Conditional">
<ContentTemplate>
 
<telerik:RadGrid    ID="RadGridArrangement"
 runat="server"
OnItemCommand="RadGridArrangement_ItemCommand"
>
 
.....
<ClientSettings enablePostBackOnRowClick="True">                      
    <Selecting AllowRowSelect="True" />
</ClientSettings>
 
 
 
.........
<Triggers>
 <asp:AsyncPostBackTrigger ControlID="RadGridArrangement" EventName="OnItemCommand" />
</Triggers>
</asp:UpdatePanel>

Thank you

1 Answer, 1 is accepted

Sort by
0
Vasil
Telerik team
answered on 26 Jul 2011, 10:10 AM
Hi,

Do you load the control on Page_Init or Page_Load as written in the documentation?
http://www.telerik.com/help/aspnet-ajax/grid-usercontrol-runtime-load.html

Regards,
Vasil
the Telerik team

Register for the Q2 2011 What's New Webinar Week. Mark your calendar for the week starting July 18th and book your seat for a walk through of all the exciting stuff we will ship with the new release!

Tags
Grid
Asked by
Jean-Marc Windholz
Top achievements
Rank 1
Answers by
Vasil
Telerik team
Share this question
or