How to set TreeView for partial control?

I have an asp.net treeview control that I need to set so that the parent node element is partially checked to show that the child nodes are marked. Basically, I need to set 3 states or a multi-position flag. All I see while looking at the code are ways to check the true or false checkbox.

Thanks.

+4
source share
2 answers

There is no flag of 3rd or multi-state value in the .Net framework, mainly because this function is not supported in HTML for a flag. There are several third-party components that do this (for example, FolderView controls). Or you can easily roll back your own server control for this. Sorry for the bad news.

+2
source

I have done this before. The main thing you do is to monitor the status of the base flag. Using a custom javascript class and CSS sprites for your images, you check the box with the corresponding image.

Here is a quick example I found

http://www.codeproject.com/KB/aspnet/TriStateCheckBox.aspx

Here is the CSS Sprites concept and the tri-state checkbox. I have done something in this direction.

http://shamsmi.blogspot.com/2008/12/tri-state-checkbox-using-javascript.html

+4
source

Source: https://habr.com/ru/post/1301735/


All Articles