Thanks in advance.
9 Answers, 1 is accepted
Looks like this is going to work for me. Is there by anyway to findout the columns specified for the second datasource?
<asp:SqlDataSource ID="SqlDataSource2" runat="server" ConnectionString="<%$ ConnectionStrings:TelerikConnectionString %>"
SelectCommand="SELECT * FROM Vehicles" />
Thanks again.
You can see the columns from the treeview definition:
<
telerik:RadTreeView
ID
=
"RadTreeView1"
runat
=
"server"
DataSourceID
=
"SqlDataSource2"
DataTextField
=
"VehicleName"
DataValueField
=
"VehicleTypeID"
DataFieldID
=
"ID"
DataFieldParentID
=
"VehicleParentID"
...
>
they're ID, VehicleParentID, VehicleTypeID, VehicleName.
All the best,
Yana
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
SQlDatasource2:
ID - Maps to VehicleId
VehicleParentID - Maps to Make (Id of Ford,Mazda,BMW)
VehicleTypeID- Maps to Vehicle Type Id( Id of Car, Limo)
VehicleName - Name of Vehicle (Explorer, Fiesta, Passat)
Please confirm if the above is correct. Also, how is the Make (Ford, BMW) displayed in the drop-down. The SQLDatasource2 looks like
Select ID, VehicleParentID, VehicleTypeID, VehicleName
From Vehicles
Thanks once again in advance.
The Makes (Ford, BMW) have their VehicleParentID set to null, because they're the parent nodes. You can view the used table Vehicles from Telerik database in your installation folder/Live Demos/App_Data.
Also you can read more about binding the treeview to hierarchical data here.
Greetings,
Yana
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
Works fine. However, for some strange reasons the load time is almost close to 15 seconds for the RadDropDown which contains the TreeView control.
Also, I am unable to invoke the client-side event "requestItems()" for the drop-down containing the treeview which in-turn should call the server-side ItemsRequested event. I am getting an error message which states "Script control RadTreeView1 is not a registerd script control......"
var
combo2 = $find("<%= RadComboBox2.ClientID %>");
combo2.requestItems(item.get_value(), false)
<
telerik:RadComboBox ID="RadComboBox2" Width="240px" Height="300px"
AllowCustomText="true" EmptyMessage="Showing all cars" OnClientDropDownClosing="OnClientDropDownClosingHandler"
runat="server">
<ItemTemplate>
<div onclick="StopPropagation(event)">
<telerik:RadTreeView ID="RadTreeView1" runat="server" DataSourceID="SqlDataSource2"
DataTextField="VehicleName" DataValueField="VehicleTypeID" DataFieldID="ID" DataFieldParentID="VehicleParentID"
OnClientNodeClicking="OnClientNodeClickingHandler">
<DataBindings>
<telerik:RadTreeNodeBinding Depth="0" Category="Make" ImageUrlField="ImagePath" />
</DataBindings>
</telerik:RadTreeView>
</div>
</ItemTemplate>
<Items>
<telerik:RadComboBoxItem />
</Items>
</telerik:RadComboBox>
Please advise.
Thanks a lot in advance!!!!
Greetings,
Simon
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
The server-side Items_Requested events fires. However, I am getting this javascript error and the tree view does not contain the filtered values. Is there a work-around for this?
Do you have an example where a RadTreeview in a combobox displays dynamic data on a previous selection? If I use the cliient-side filtering such as in:
function
updateTreeView(values)
{
var tree = combo2.get_items().getItem(0).findControl("radTreeLocations");
var nodes = tree.get_allNodes();
//debugger;
for (var i = 0; i < nodes.length; i++)
{
var node = nodes[i];
//set all nodes visible initially
node.set_visible(
true);
//hide all leaf nodes which value does not exist in the values string
if(values!=node.get_value() && node.get_value() && values.length > 0)
{
node.set_visible(
false);
}
}
//loop through loop nodes only and hide
//the ones that does not have any visible child node
//expand the others
var rootNodes = tree.get_nodes();
for (var i = 0; i < rootNodes.get_count(); i++)
{
var root = rootNodes.getNode(i);
var showTheRootNode = false;
for (var j = 0; j < root.get_nodes().get_count(); j++)
{
if (root.get_nodes().getNode(j).get_visible())
{
//root.expand();
showTheRootNode =
false;
break;
}
}
root.set_visible(showTheRootNode);
}
}
I get a IE script error stating that it is taking a long time to execute... Is there an alternate route to filter data on the client-side? Please help.
Thanks in advance.
Ramjee
Best wishes,
Simon
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.