The code for the RadTreeView is:
<
telerik:RadTreeView
ID
=
"tvMultiCountries"
runat
=
"server"
Skin
=
"Office2009"
AllowNodeEditing
=
"false"
CheckBoxes
=
"true"
MultipleSelect
=
"false"
CollapseAnimation-Type
=
"OutQuint"
EnableEmbeddedSkins
=
"false"
TriStateCheckBoxes
=
"true"
CheckChildNodes
=
"true"
OnClientNodeChecked
=
"LocatorGridEntityGeographicUnitSelected"
>
</
telerik:RadTreeView
>
On the server side the only manipulation being done (outside of DataBind()), is expanding the first node:
tvMultiCountries.Nodes[0].Expanded = true;
5 Answers, 1 is accepted
I wasn't able to reproduce your probelm, based on the declaration of the treeview alone.
Could you provide the whole page where you use the control, or at least the code for the LocatorGridEntityGeographicUnitSelected function and also the way you are binding the data, so that we can test it locally.
Bozhidar
the Telerik team
DataTable dtGeographicUnit = sql.ExecuteDataTable(SpNames.GetGeographicUnits, CommandType.StoredProcedure, new Dictionary<
String
, String>(){
{SpParameter.Tenant_RecordID, Convert.ToString(UserContext.TenantId)},
{SpParameter.Language_RecordID, Convert.ToString(UserContext.Language_RecordID)},
{SpParameter.Country_RecordID, Convert.ToString(geoRecordId)}});
tvMultiCountries.DataSource = dtGeographicUnit;
tvMultiCountries.DataTextField = "Name";
tvMultiCountries.DataValueField = "RecordID";
tvMultiCountries.DataFieldID = "RecordID";
tvMultiCountries.DataFieldParentID = "ParentRecordID";
tvMultiCountries.DataBind();
The data will look this:
Parent_RecordID RecordID Name
NULL 8AF488EB-F7E1-409A-B18A-3E0EDC8A4643 Spain
8AF488EB-F7E1-409A-B18A-3E0EDC8A4643 F3C41DDE-1EA5-417E-8D6F-4000D205ED70 Barcelona
F3C41DDE-1EA5-417E-8D6F-4000D205ED70 A62037AF-1A8B-4D0E-98AB-6F50FD93B2D1 Town in Barcelona
As you can see Spain is first level, Barcelona would be second level (parent_recordid = spain) and Town in Barcelona is third level.
I still can't seem to see where the problem is. I've attached a sample project with a database similar to yours, and the TreeView set-up exactly as yours, and it is working fine. Could you run it on your end and tell me if the problem still occurs. And if it doesn't, can you specify the differences between your project and the one I sent you. Also, a picture of the problem would be helpful.
All the best,Bozhidar
the Telerik team
The image you sent me shows the treeview working as it should. Please read how the Tri-State CheckBoxes mechanism works here.
In short, when a node has children with different states, only then it's indeterminate. When there is only one child (like the case with GrandChild1 and GrandGrandChild1), when you check this child, the parent will inherit that state, because it doesn't have any other children with different states.
Best wishes, Bozhidar
the Telerik team