Rebind certain child RadListView in client side

2 posts, 0 answers
  1. Shannnon
    Shannnon avatar
    31 posts
    Member since:
    Oct 2010

    Posted 17 Jun 2012 Link to this post

    I have a hierarchical RadListView:
    <telerik:RadListView ID="RadListView1" runat="server" DataSourceID="SqlDataSource0"...>
    ......
     <ItemTemplate>

    <%

     

    # Session["CatalogID"] = Eval("SerialsID").ToString()%>

     

     

     

    <telerik:RadListView ID="RadListView2" runat="server" DataSourceID="SqlDataSource1"...>
    .....
    <ItemTemplate>
    <%# Session["ProductID"] = Eval("ProductID").ToString()%>

     

     

    <asp:Button runat="server" ID="btnRebind_Production" Text="" OnClientClick="somefunction"/>

     

     

     

     

    <telerik:RadListView ID="RadListView3" runat="server" DataSourceID="SqlDataSource2"...>
    ....
    <ItemTemplate>
    <div>

    <asp:Button runat="server" ID="btnRebind_Detail" Text="" OnClientClick="somefunction()/>

     

     

     

     

     

    <asp:ImageButton runat="server" ID="img1" AlternateText="" CausesValidation="false" ImageUrl='<%# Eval("ImageURL") %>' Width="180px" Height="180px" />
    <div>
    </
    ItemTemplate>

     

     

     

    </telerik:RadListView>
    </ItemTemplate>
    </telerik:RadListView>
    </ItemTemplate>
    </telerik:RadListView>
    When I click btnRebind_Detail, I only want to rebind RadListView 3. The problem was that when I call

    $find(

     

    "<%= RadListView1.ClientID %>").rebind(), the data sets for RadListView2 and 3 are wrong.  I tried to wrap the RadListView3 with UpdatePanel and call _doPostBack("UpdatePanel1", ' '), but the dataset for RadListView 3 is wrong, it populated the ListView3 with another Catalog's details.  Is there a way to only rebind certain child RadListView in Client-Side?

  2. Tsvetina
    Admin
    Tsvetina avatar
    1876 posts

    Posted 21 Jun 2012 Link to this post

    Hi Shannnon,

    It seems like the SqlDataSource is not correctly picking the data in this scenario. It might be a better idea to try with advanced data-binding. Instead of the declarative datasources use the NeedDataSource event, where you can manually check the ProductID value of the parent data item and query the DB using it.

    Kind regards,
    Tsvetina
    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.
  3. UI for ASP.NET Ajax is Ready for VS 2017
Back to Top