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

Rebind certain child RadListView in client side

1 Answer 102 Views
ListView
This is a migrated thread and some comments may be shown as answers.
Shannnon
Top achievements
Rank 1
Shannnon asked on 17 Jun 2012, 05:23 PM
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?

1 Answer, 1 is accepted

Sort by
0
Tsvetina
Telerik team
answered on 21 Jun 2012, 07:00 AM
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.
Tags
ListView
Asked by
Shannnon
Top achievements
Rank 1
Answers by
Tsvetina
Telerik team
Share this question
or