Hi,
I think what you want to do is to let user select only one checkbox at a time, if he checks other previous one should get unchecked automatically, if yes then you can do this by using following javascript code -
function
client_OnTreeNodeChecked(event)
{
var TreeNode = event.srcElement || event.target ;
if (TreeNode.tagName == "INPUT" && TreeNode.type == "checkbox")
{
if(TreeNode.checked)
{
uncheckOthers(TreeNode.id);
}
}
}
function
uncheckOthers(id)
{
var elements = document.getElementsByTagName('input');
// loop through all input elements in form
for(var i = 0; i < elements.length; i++)
{
if(elements.item(i).type == "checkbox")
{
if(elements.item(i).id!=id)
{
elements.item(i).checked=
false;
}
}
}
}
Add client_OnTreeNodeChecked function to your treeviews onclick event
private
void Page_PreRender(object sender, EventArgs e)
{
TreeView1.Attributes.Add(
"OnClick", "client_OnTreeNodeChecked(event)");
}
Now each time user checks a checkbox other checkboxes will get unchecked.
Hope thats what you wanted...
Aj