I'm facing problem with rebinding RADListView from code behind by changing the databasourceid in the event of RADTreeNode selection.
I'm desiging a page with Radtreeview and Radlistview and while clicking the node on the RADTreeView I'm getting the directory path from the treenode and assigning the selected directory to the RADListview in the code behind to list all images.
Intermittently the RADListView is not getting the correct path and binding to a previously assigned values. This is happening more frequently.
I'm displaying the same treenode selected path on a Gridview and that is showing the correct values for that selected treenode consistently. It seems to be an issue with the RADListview binding using AJAX.
Is there an alternate approach I can try to fix this dynamic biding issue? Thanks for your help.
protected void RadTreeView1_Selected(object sender, RadTreeNodeEventArgs e)
{
if (e.Node.ToolTip == "Album")
{
string albpath = "";
if (RadTreeView1.SelectedNode.GetFullPath("/") == "Sample Folder/Sample Album")
{
albpath = "~/" + "Registered_Users_Uploaded_Images" + "/" + RadTreeView1.SelectedNode.GetFullPath("/");
}
else {
albpath =
"~/" + "Registered_Users_Uploaded_Images" + "/" + uname + "/" + RadTreeView1.SelectedNode.GetFullPath("/");
}
ObjectDataSource1.SelectParameters[
"path"].DefaultValue = albpath;
// ObjectDataSource1.SelectMethod = "GetData()";
RadAjaxManager1.AjaxSettings.AddAjaxSetting(RadTreeView1, ObjectDataSource1);
RadListView1.DataSourceID =
"ObjectDataSource1";
RadListView1.Rebind();
RadAjaxManager1.AjaxSettings.AddAjaxSetting(RadTreeView1, RadListView1);
}
}
============== ObjectDataSource=============
<asp:ObjectDataSource runat="server" ID="ObjectDataSource1" SelectMethod="GetData"
TypeName="uploadWebApp.DataProvider">
<SelectParameters>
<asp:Parameter Name="path" DefaultValue="~/Registered_Users_Uploaded_Images\dsnap1\My Albums\2010-10-16"/>
</SelectParameters>
</asp:ObjectDataSource>
=============================================
============ AJAX settings ==================
<telerik:AjaxSetting AjaxControlID="RadTreeView1">
<UpdatedControls>
<telerik:AjaxUpdatedControl ControlID="GridView1" />
<telerik:AjaxUpdatedControl ControlID="ObjectDataSource1" />
<telerik:AjaxUpdatedControl ControlID="RadListView1" LoadingPanelID="ListViewPanel1" />
<UpdatedControls>
</telerik:AjaxSetting>