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

TreeList validation on Dropping

1 Answer 46 Views
TreeList
This is a migrated thread and some comments may be shown as answers.
Abilash
Top achievements
Rank 1
Abilash asked on 06 Mar 2012, 04:01 PM
I am having a RadTreeList control in my page. I need to validate that every first hierarchy items(0th Nested Level items) can have only 5 levels of children( not 5 children) i.e., each 0th Nested Level items can have 5 hierarchical levels. I am using both item creation method and drag-drop method. While dragging from some item to an item, I need to validate that the destination item has only 5 hierarchical levels after dropping. If the sum of hierarchical levels is equal or greater than 5, then the dragged item should not be allowed to drop to the destination item.
Can anyone help for this.

Thanks in Advance,
Abilash

1 Answer, 1 is accepted

Sort by
0
Daniel
Telerik team
answered on 09 Mar 2012, 12:43 PM
Hi Abilash,

You can get the child items of a given row on RowDropping and decide whether to cancel the dropping action or not. Client-side TreeListDataItem object has a get_childItems() property that will return a collection of the child items.
It is possible to use get_childItems().length to count them. Note that the client-side item objects do not exist initially. They will be created automatically when you call the get_dataItems() property.

Regards,
Daniel
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
TreeList
Asked by
Abilash
Top achievements
Rank 1
Answers by
Daniel
Telerik team
Share this question
or