Oh,--
My tree has expand/collapse functionality, but each node is displayed as a
link.
It represents categories and subcategories. When a user clicks on category
or subcategory - onSelectionChanged event fires performing the search for
documents falling into selected category. When a user expands a category,
they see subcategories undeneath.
Here is my tree:
<iewc:treeview id="TreeCtrl" runat="server"
DefaultStyle="color:#FFF;font-family:Arial;font-size:10px;text-decoration:un
derline;" AutoPostBack="True"></iewc:treeview>
In the code from dataset I set id of the node to be CategoryID and node Text
to be Category Name, so the output is like this:
<tvns:treenode Type="category" Target="doc" ID="GeneralInfo"> General
Information
<tvns:treenode Type="subcategory" Target="doc" ID="Operations">
Operations
</tvns:treenode>
<tvns:treenode Type="subcategory" Target="doc" ID="Merchandising">
Merchandising
</tvns:treenode>
</tvns:treenode>
and I simply perform the search based on the ID of the node that the user
clicks on.
So the problem is that by default Tree Control has first node in the tree
(Node with the index of 0) selected like so:
<tvns:treenode Type="category" Selected="true" Target="doc" ID="Fixtures">
Fixtures
</tvns:treenode>
As a result, when the user clicks on it nothing happens (cuz slected status
does not change) - so what I am trying to do is to overwrite this default so
that the first node of the tree is not selected and all of my links are
clickable.
"Alvin Bruney" <vapordan_spam_me_not@hotmail_no_spamhotmail.com> wrote in
message news:O3xjUgrkDHA.1084@tk2msftngp13.phx.gbl...
[quoted text, click to view] > back up a bit, clicking on the node should fire the expand event, that is
> where your code needs to go, inside the expand handler, not in the
> selectchange because it may fire when you least expect it. If you map to
the
> expand event, it doesn't matter what is selected.
> regards
>
> "ilona" <ieshulman@sseinc.com> wrote in message
> news:OIdwaZpkDHA.2000@TK2MSFTNGP12.phx.gbl...
> > Alvin, thankyou--
> > very excited on getting closer - but not there yet :
> > selectednodeindex must be a string, so put in
> > TreeCtrl.SelectedNodeIndex="-1";
> > Got
> > Invalid node index "-1". Node index must consist of numbers separated by
> > periods.
> > tried "0.-1" as well but it would not take that either. It seems to
simply
> > not take -1.
> > Did you somehow get it to work with -1?
> >
> > It says this in the help:
> > The structure of the index returned by this method is a concatentation
of
> > the ordinal number of the parent node at each level counting through the
> > tree from 0 down to the selected node and delimiting each level with a
dot
> > (.). The uppermost node in the top level of the tree is 0; the second
node
> > is 1, and so on. The node that immediately follows the first top-level
> node
> > is 0.0; the second is 0.1, and so on. For example, for the index value
> > 1.3.2, 1 is the second node at the top level of the tree; 3 is the
fourth
> > node under node 1; and 2 is the third node under node 1.3 and it is the
> > selected node.
> >
> >
> >
> >
> > "Alvin Bruney" <vapordan_spam_me_not@hotmail_no_spamhotmail.com> wrote
in
> > message news:O$Jqw0okDHA.976@tk2msftngp13.phx.gbl...
> > > selectednodeindex = -1 will do the trick
> > > "ilona" <ieshulman@sseinc.com> wrote in message
> > > news:#1BMmvZkDHA.2528@TK2MSFTNGP12.phx.gbl...
> > > > Hi,
> > > > trying to use Microsoft Treeview control w/dynamically populated
> nodes.
> > > > The problem is that the first node in the tree is always selected
and
> as
> > a
> > > > result when user clicks on it, OnSelectionChange event can not fire.
> So
> > if
> > > a
> > > > user has permissions to see only one node then he can not do
anything
> > with
> > > > it.
> > > > I would like the tree to display with no nodes selected - so that
all
> of
> > > the
> > > > nodes that are shown as link work. Do you have any ideas on how to
> > achieve
> > > > that? Or maybe you can recommend another tree control (not the
> > microsoft's
> > > > one) where this is possible?
> > > > Tried:
> > > > on page load - TreeControl.SelectedNodeIndex = null or ""; - first
> node
> > > > still gets selected.
> > > >
> > > >
> > >
> > >
> >
> >
>
>