hai
i read the following ariticle https://demos.telerik.com/aspnet-ajax/treeview/examples/functionality/checkboxes/defaultcs.aspx
in the we use tristateheckboxes,if inner node partial checked it show partial checked color in check box,if select all check box then wee see tick mark in tristatecheckbox.
but my need is use not allow to check and uncheck the tristatecheckbox,bcz now if check tristatecheckbox ,its child node all checked,if uncheck tristatecheck ,its child node all are unchecked.
Why i am ask this ,i have restriction for check child node upto 3 by using javascript.means i have to count no, of nodes checked from db and apply in hidden field,and from OnClientNodeChecked i will increase or decrease node selected count and apply in same hidden field.if hidden field count more than 3 it show msg and remove lastly selected node like that.
now what i get problem if user click tristatecheckbox ,its child nodes all are checked ,so i cant count the nodes and apply in hidden filed.
below code i use in client side
function onClientNodeClickedHandler(sender, eventArgs) {
var tree = $find("<%= RadTreeView1.ClientID %>");
var childNodes = eventArgs.get_node().get_text();
var chnode = tree.findNodeByText(childNodes);
var node = eventArgs.get_node();
var nodetext = eventArgs._node.get_text();
if (nodetext == "Software" || nodetext == "Books" || nodetext == "Music" || nodetext == "Movies"
) {
// node.toggle()-- nothing affect its child node check boxes like select all or unselect all
}
else {
if (node.get_checked() == true) {
var hdFldLang = document.getElementById("ctl00_ContentPlaceHolder1_hdLangCount").value;
if (hdFldLang < 3) {
if (hdFldLang == "") {
hdFldLang = 1;
}
else {
var Add = parseInt(hdFldLang);
hdFldLang = Add + 1;
}
document.getElementById("ctl00_ContentPlaceHolder1_hdLangCount").value = hdFldLang;
}
else {
alert("Maximum of 20 language is allowed")
}
chnode.uncheck()
}
}
else {
var hdFldLang1 = document.getElementById("ctl00_ContentPlaceHolder1_hdLangCount").value;
var sub = parseInt(hdFldLang1)
hdFldLang1 = sub - 1;
document.getElementById("ctl00_ContentPlaceHolder1_hdLangCount").value = hdFldLang1;
}
}
Note: user not allow to tounch tristatecheckbox ,only to show paritially or fully selected mark, and also i need that tristatecheckbox
Regards
Aravinb
i read the following ariticle https://demos.telerik.com/aspnet-ajax/treeview/examples/functionality/checkboxes/defaultcs.aspx
in the we use tristateheckboxes,if inner node partial checked it show partial checked color in check box,if select all check box then wee see tick mark in tristatecheckbox.
but my need is use not allow to check and uncheck the tristatecheckbox,bcz now if check tristatecheckbox ,its child node all checked,if uncheck tristatecheck ,its child node all are unchecked.
Why i am ask this ,i have restriction for check child node upto 3 by using javascript.means i have to count no, of nodes checked from db and apply in hidden field,and from OnClientNodeChecked i will increase or decrease node selected count and apply in same hidden field.if hidden field count more than 3 it show msg and remove lastly selected node like that.
now what i get problem if user click tristatecheckbox ,its child nodes all are checked ,so i cant count the nodes and apply in hidden filed.
below code i use in client side
function onClientNodeClickedHandler(sender, eventArgs) {
var tree = $find("<%= RadTreeView1.ClientID %>");
var childNodes = eventArgs.get_node().get_text();
var chnode = tree.findNodeByText(childNodes);
var node = eventArgs.get_node();
var nodetext = eventArgs._node.get_text();
if (nodetext == "Software" || nodetext == "Books" || nodetext == "Music" || nodetext == "Movies"
) {
// node.toggle()-- nothing affect its child node check boxes like select all or unselect all
}
else {
if (node.get_checked() == true) {
var hdFldLang = document.getElementById("ctl00_ContentPlaceHolder1_hdLangCount").value;
if (hdFldLang < 3) {
if (hdFldLang == "") {
hdFldLang = 1;
}
else {
var Add = parseInt(hdFldLang);
hdFldLang = Add + 1;
}
document.getElementById("ctl00_ContentPlaceHolder1_hdLangCount").value = hdFldLang;
}
else {
alert("Maximum of 20 language is allowed")
}
chnode.uncheck()
}
}
else {
var hdFldLang1 = document.getElementById("ctl00_ContentPlaceHolder1_hdLangCount").value;
var sub = parseInt(hdFldLang1)
hdFldLang1 = sub - 1;
document.getElementById("ctl00_ContentPlaceHolder1_hdLangCount").value = hdFldLang1;
}
}
Note: user not allow to tounch tristatecheckbox ,only to show paritially or fully selected mark, and also i need that tristatecheckbox
Regards
Aravinb