I want to prevent a TreeNode to be collapsed, so I do the following, in
the BeforeCollapse event:
// Verify if it is the root node
if (e.Node.Name == "0")
e.Cancel = true;
It works ok, but is there a way to not display the minus button?
Regards.
Junior. 4 1688
Hi,
You can set the property "showplusminus" to false to hide ALL the plus
and minus signs,
HTH,
James.
osmarjunior wrote:
I want to prevent a TreeNode to be collapsed, so I do the following, in
the BeforeCollapse event:
// Verify if it is the root node
if (e.Node.Name == "0")
e.Cancel = true;
It works ok, but is there a way to not display the minus button?
Regards.
Junior.
Hi again,
A better way to test if it is the root would be
if (e.Node == ((TreeView)sender).Nodes[0])
Cheers,
James.
osmarjunior wrote:
I want to prevent a TreeNode to be collapsed, so I do the following, in
the BeforeCollapse event:
// Verify if it is the root node
if (e.Node.Name == "0")
e.Cancel = true;
It works ok, but is there a way to not display the minus button?
Regards.
Junior.
Actually, I just wanna take off the minus button from the first node,
not from all nodes.
But your answer has taken me to another property of the TreeView:
ShowRootLines.
I set it to false, and I got what I want.
Thanks.
pigeonrandle escreveu:
Hi again,
A better way to test if it is the root would be
if (e.Node == ((TreeView)sender).Nodes[0])
Cheers,
James.
osmarjunior wrote:
I want to prevent a TreeNode to be collapsed, so I do the following, in
the BeforeCollapse event:
// Verify if it is the root node
if (e.Node.Name == "0")
e.Cancel = true;
It works ok, but is there a way to not display the minus button?
Regards.
Junior.
In which case, i'm glad i couldn't help :o)
osmarjunior wrote:
Actually, I just wanna take off the minus button from the first node,
not from all nodes.
But your answer has taken me to another property of the TreeView:
ShowRootLines.
I set it to false, and I got what I want.
Thanks.
pigeonrandle escreveu:
Hi again,
A better way to test if it is the root would be
if (e.Node == ((TreeView)sender).Nodes[0])
Cheers,
James.
osmarjunior wrote:
I want to prevent a TreeNode to be collapsed, so I do the following, in
the BeforeCollapse event:
>
// Verify if it is the root node
if (e.Node.Name == "0")
e.Cancel = true;
>
It works ok, but is there a way to not display the minus button?
>
Regards.
>
Junior.
This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
by: Benny Raymond |
last post by:
More problems with this... When I run this code, the main form returns
an invalid cast exception as it's executing the line "TreeNode n =
(TreeNode) this.Nodes;"
Does anyone know what would...
|
by: naija naija |
last post by:
Hi All,
I'm using the TreView Web Control for my MENU.
And the Menu is populated from an XML file below.
I want a way in which i can manipulate the XML when i want to manage it
without having to...
|
by: markaelkins |
last post by:
Hi. I am trying to enter a variable in the treenodesrc of a treenode. I am
basically trying to send an ID variable into sql to return different records.
I've searched everywhere and cannot find the...
|
by: bclegg |
last post by:
Hi,
When I implement the example code it errors with
'No parameterless constructor defined for this object.'
experimenting with dim o as object = mytreenode.clone() gives the same
error.
The...
|
by: garyusenet |
last post by:
I could do with something similiar, can you tell me if you think this
would work for me, and if there's any advantage in working with
controls
this way than how I currently am.
At the moment...
|
by: tanya foster |
last post by:
Hello,
I am re-writing a visual basic .net application(visual studio 2003) in an
asp.net application(visual studio 2005). The vb.net application relied on a
treeview and hence, treenodes. The...
|
by: divya1949 |
last post by:
Create a windows c# application which will
Read a xml file and populate nodes in the treeview.
1 On selection of treenode display the child nodes of that node in listview control
2. ...
|
by: jmDesktop |
last post by:
I am trying to add nodes with keys to my treeview. I can add general
nodes without problem with:
//create new node
TreeNode newNode = new TreeNode(myIdNumber);
//create children
TreeNode...
|
by: AAaron123 |
last post by:
If you see this posted twice - sorry.
My news reader showed my first post as "No Longer Available"
I have the following in a .css file.
The treeNodes behave as if they were "a" elements.
...
|
by: CloudSolutions |
last post by:
Introduction:
For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
|
by: ryjfgjl |
last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
|
by: taylorcarr |
last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
|
by: Charles Arthur |
last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
|
by: aa123db |
last post by:
Variable and constants
Use var or let for variables and const fror constants.
Var foo ='bar';
Let foo ='bar';const baz ='bar';
Functions
function $name$ ($parameters$) {
}
...
|
by: ryjfgjl |
last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
|
by: emmanuelkatto |
last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud.
Please let me know.
Thanks!
Emmanuel
|
by: nemocccc |
last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
|
by: Sonnysonu |
last post by:
This is the data of csv file
1 2 3
1 2 3
1 2 3
1 2 3
2 3
2 3
3
the lengths should be different i have to store the data by column-wise with in the specific length.
suppose the i have to...
| |