Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8278121
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T08:54:05+00:00 2026-06-08T08:54:05+00:00

I recently encountered an issue dealing with the Telerik Treeview component and handling recursive

  • 0

I recently encountered an issue dealing with the Telerik Treeview component and handling recursive selection with checkboxes when handling larger data sets (500-1000+ nodes).

With smaller data sets (100-300 nodes) the Treeview and its selection methods work as follows (as they should):

  • Initially – all nodes are selected.

  • Clicking a parent node toggles selection of all of the child nodes.

  • Unselecting a single child node will unselect the parent (and any grandparent / top-level nodes)

Most of these things I believe are fairly commonplace when dealing with Treeviews and selection. The current method that is being used isn’t the cleanest and calls an unnecessary amount of additional events to be fired during the selection process.

I was just curious if anyone had handled an issue similar to this before I began tearing apart the current code (available below).

Existing Selection Code:

$('#TreeView').find("li").find('> div > .t-checkbox :checkbox').bind('click', function (e) {

        var isChecked = $(e.target).is(':checked');
        var treeView = $($(e.target).closest('.t-treeview')).data('tTreeView');
        var item = $(e.target).closest('.t-item');
        var checkboxes = item.find('.t-checkbox :checkbox');
        $.each(checkboxes, function (index, checkbox) { $(checkbox).attr('checked', isChecked ? true : false); treeView.checkboxClick(e, checkbox); });
        var siblings = item.parent().find('> li .t-checkbox');
        var siblingsLength = siblings.length;
        var checkedLength = siblings.find(':checked').length;
        if (siblingsLength == checkedLength) {
            var parentCheckBox = item.parent().closest('.t-item').find('> div .t-checkbox :checkbox');
            var grandparentCheckBox = item.parent().parent().parent().closest('.t-item').find('> div .t-checkbox :checkbox');
            parentCheckBox.attr('checked', true)
            grandparentCheckBox.attr('checked', true)
            treeView.checkboxClick(e, parentCheckBox)
            treeView.checkboxClick(e, grandparentCheckBox)
        }
        else {
            var parentCheckBox = item.parent().closest('.t-item').find('> div .t-checkbox :checkbox');
            var grandparentCheckBox = item.parent().parent().parent().closest('.t-item').find('> div .t-checkbox :checkbox');
            parentCheckBox.attr('checked', false)
            grandparentCheckBox.attr('checked', false)
            treeView.checkboxClick(e, parentCheckBox)
            treeView.checkboxClick(e, grandparentCheckBox)
        }
    });
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-08T08:54:08+00:00Added an answer on June 8, 2026 at 8:54 am

    I found a solution that I feel will function at least effectively as of right now and works a great deal faster than the existing solution, even when dealing with very large data sets.

    I created a simple function that fires upon the Checked event within the TreeView and handles all the necessary child selection:

    function TreeView_Checked(e) {
        var current = $(e.item).find(':checkbox:eq(0)');
        //Check or uncheck all child nodes from this one
        var children = $(e.item).find(':checkbox');
        current.is(':checked') ? children.attr('checked', 'checked') : children.removeAttr('checked');
    }
    

    which is implemented by adding the following within the TreeView declaration:

    TreeView().Name("TreeView").ClientEvents(e => e.OnChecked("TreeView_Checked"))
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I recently encountered a printing issue in Firefox that eventually turned out to be
Recently I have encountered an issue with Scribd where searching via Scribd API (docs.search)
I've recently encountered an issue with the multi-threaded nature of the BizTalk Mapper and
I have recently encountered an issue that is related to code running in the
I use Rails 3.0.6 with mongoID 2.0.2. Recently I encountered an issue with save!
I recently encountered an issue regarding outputting a PDF generated in iTextSharp into a
I've recently encountered an issue where I have an ObservableCollection bound to a ListView.
Recently, I encountered a very strange issue, this issue only happens in Windows XP
I have recently encountered a very specific issue/requirement regarding an Android Button and ListView
I recently encountered a problem with my Profile provider: it wouldn't retrieve profiles correctly

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.