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

UpdatePanel in a ListView

2 Answers 178 Views
ListView
This is a migrated thread and some comments may be shown as answers.
Evelyne Schreiner
Top achievements
Rank 1
Evelyne Schreiner asked on 04 Jul 2012, 01:13 PM
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 Answers, 1 is accepted

Sort by
0
Evelyne Schreiner
Top achievements
Rank 1
answered on 09 Jul 2012, 06:36 AM
Anyone ? The question is just "Is it possible to use an updatePanel in a listView" ?
0
Andrey
Telerik team
answered on 09 Jul 2012, 07:43 AM
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.
Tags
ListView
Asked by
Evelyne Schreiner
Top achievements
Rank 1
Answers by
Evelyne Schreiner
Top achievements
Rank 1
Andrey
Telerik team
Share this question
or