UpdatePanel in a ListView

3 posts, 0 answers
  1. Evelyne Schreiner
    Evelyne Schreiner avatar
    20 posts
    Member since:
    Sep 2009

    Posted 04 Jul 2012 Link to this post

    Hi,

    Trying to use an updatePanel in a ListView, I've got a problem

    If I'm using this code on a page, it's working fine :
    <asp:linkButton ID="Button1" Text="Time display" OnClick="Button1_Click" runat="server"  />
    <br />
    <asp:UpdatePanel ID="UpdatePanel1" UpdateMode="Conditional" ChildrenAsTrigger="true" runat="server">
        <Triggers>
            <asp:AsyncPostBackTrigger ControlID="Button1" />
        </Triggers>
        <ContentTemplate>
            <asp:PlaceHolder ID="monPh" runat="server"></asp:PlaceHolder>
        </ContentTemplate>
    </asp:UpdatePanel>

    And the code.behind
    Protected Sub Button1_Click(ByVal sender As Object, ByVal e As System.EventArgs)
        Dim myUC As Control = LoadControl("/usercontrols/BrowseMedia/browseDetails.ascx")
        monPh.Controls.Add(myUC)
    End Sub

    The control "BrowseDetails.ascx" just displays the current date/time (eg now()).

    But, trying to include this in a RadListView, it doesn't work at all. Am I doing something wrong or isn't is possible ? 

    Thank you,
  2. Evelyne Schreiner
    Evelyne Schreiner avatar
    20 posts
    Member since:
    Sep 2009

    Posted 09 Jul 2012 Link to this post

    Anyone ? The question is just "Is it possible to use an updatePanel in a listView" ?
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Andrey
    Admin
    Andrey avatar
    836 posts

    Posted 09 Jul 2012 Link to this post

    Hello,

    RadListView is a composite control and as such it should be updated along with the data that contains. So, in your case you should place the ListView inside the ContentTemplate of the UpdatePanel instead of placing the UpdatePanel inside the ListView.

    Give this approach a try and check whether you get the expected behavior.
    Kind regards,
    Andrey
    the Telerik team
    If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
Back to Top