Home All Groups Group Topic Archive Search About
Author
2 Feb 2006 2:36 AM
Jasmine
Hi,

Is there way to know how many nodes have been checked total in the tree view
from the client side (java script)?

Thanks, Jasmine

Author
5 Feb 2006 6:00 AM
Phillip Williams
Jasmine,

The TreeView server control does not provide client-side functions such as
the number of checked items on the TreeView or changing the colors of the
checked nodes. All these activities have to be done using JavaScript.

http://www.webswapp.com/codesamples/aspnet20/treeview/

In this demo I perform the following JavaScript manipulations:
1-  Count the number of checked nodes
2-  Suppress the ToolTip display when the mouse if hovered over the checkbox

Show quoteHide quote
"Jasmine" wrote:

> Hi,
>
> Is there way to know how many nodes have been checked total in the tree view
> from the client side (java script)?
>
> Thanks, Jasmine
Author
5 Feb 2006 7:28 PM
Jasmine
Hi Phillp,

Thank you very much for answering my question. Your demo is great!

May I ask you how could I binding the tree view check box with the grid view
besides it, every time  the node get checked,the node value (such as student
ID) will pass to grid view, a new row with the selected student ID will
append to grid view.  if the node unchecked, the row is the grid view will
get removed, it is for client side only (for UI, it won't affect database).

I try to use the
"OnTreeNodeCheckChanged="treeview1_TreeNodeCheckChanged"),it doesn't triger
the event at all, do you have any idea how to implement it?

Thank you very much, Jasmine

Show quoteHide quote
"Phillip Williams" wrote:

> Jasmine,
>
> The TreeView server control does not provide client-side functions such as
> the number of checked items on the TreeView or changing the colors of the
> checked nodes. All these activities have to be done using JavaScript.
>
> http://www.webswapp.com/codesamples/aspnet20/treeview/
>
> In this demo I perform the following JavaScript manipulations:
> 1-  Count the number of checked nodes
> 2-  Suppress the ToolTip display when the mouse if hovered over the checkbox
>
> --
> HTH,
> Phillip Williams
> http://www.societopia.net
> http://www.webswapp.com
>
>
> "Jasmine" wrote:
>
> > Hi,
> >
> > Is there way to know how many nodes have been checked total in the tree view
> > from the client side (java script)?
> >
> > Thanks, Jasmine
Author
6 Feb 2006 6:30 AM
Phillip Williams
Jasmine,

According to the TreeView documentation on the MSDN: "The TreeView control
does not expose an AutoPostBack property. Thus, to submit check box
selections, you must place a control, such as a Button Web server control, on
the page to post information back to the server."
http://msdn2.microsoft.com/en-us/library/ms178259.aspx

To be able to make use of that event you need to have another control that
triggers the PostBack, like I did in this demo: http://www.webswapp.com/codesamples/aspnet20/treeview/TreeNodeCheckChanged.aspx

Show quoteHide quote
"Jasmine" wrote:

> Hi Phillp,
>
> Thank you very much for answering my question. Your demo is great!
>
> May I ask you how could I binding the tree view check box with the grid view
> besides it, every time  the node get checked,the node value (such as student
> ID) will pass to grid view, a new row with the selected student ID will
> append to grid view.  if the node unchecked, the row is the grid view will
> get removed, it is for client side only (for UI, it won't affect database).
>
> I try to use the
> "OnTreeNodeCheckChanged="treeview1_TreeNodeCheckChanged"),it doesn't triger
> the event at all, do you have any idea how to implement it?
>
> Thank you very much, Jasmine
>
> "Phillip Williams" wrote:
>
> > Jasmine,
> >
> > The TreeView server control does not provide client-side functions such as
> > the number of checked items on the TreeView or changing the colors of the
> > checked nodes. All these activities have to be done using JavaScript.
> >
> > http://www.webswapp.com/codesamples/aspnet20/treeview/
> >
> > In this demo I perform the following JavaScript manipulations:
> > 1-  Count the number of checked nodes
> > 2-  Suppress the ToolTip display when the mouse if hovered over the checkbox
> >
> > --
> > HTH,
> > Phillip Williams
> > http://www.societopia.net
> > http://www.webswapp.com
> >
> >
> > "Jasmine" wrote:
> >
> > > Hi,
> > >
> > > Is there way to know how many nodes have been checked total in the tree view
> > > from the client side (java script)?
> > >
> > > Thanks, Jasmine
Author
6 Feb 2006 9:48 PM
Jasmine
Hi Phillip,

Thank you very much, could I check the parent node, and the subnodes in the
tree get checked automaticlly ?



Show quoteHide quote
"Phillip Williams" wrote:

> Jasmine,
>
> According to the TreeView documentation on the MSDN: "The TreeView control
> does not expose an AutoPostBack property. Thus, to submit check box
> selections, you must place a control, such as a Button Web server control, on
> the page to post information back to the server."
> http://msdn2.microsoft.com/en-us/library/ms178259.aspx
>
> To be able to make use of that event you need to have another control that
> triggers the PostBack, like I did in this demo:
> http://www.webswapp.com/codesamples/aspnet20/treeview/TreeNodeCheckChanged.aspx
>
> --
> HTH,
> Phillip Williams
> http://www.societopia.net
> http://www.webswapp.com
>
>
> "Jasmine" wrote:
>
> > Hi Phillp,
> >
> > Thank you very much for answering my question. Your demo is great!
> >
> > May I ask you how could I binding the tree view check box with the grid view
> > besides it, every time  the node get checked,the node value (such as student
> > ID) will pass to grid view, a new row with the selected student ID will
> > append to grid view.  if the node unchecked, the row is the grid view will
> > get removed, it is for client side only (for UI, it won't affect database).
> >
> > I try to use the
> > "OnTreeNodeCheckChanged="treeview1_TreeNodeCheckChanged"),it doesn't triger
> > the event at all, do you have any idea how to implement it?
> >
> > Thank you very much, Jasmine
> >
> > "Phillip Williams" wrote:
> >
> > > Jasmine,
> > >
> > > The TreeView server control does not provide client-side functions such as
> > > the number of checked items on the TreeView or changing the colors of the
> > > checked nodes. All these activities have to be done using JavaScript.
> > >
> > > http://www.webswapp.com/codesamples/aspnet20/treeview/
> > >
> > > In this demo I perform the following JavaScript manipulations:
> > > 1-  Count the number of checked nodes
> > > 2-  Suppress the ToolTip display when the mouse if hovered over the checkbox
> > >
> > > --
> > > HTH,
> > > Phillip Williams
> > > http://www.societopia.net
> > > http://www.webswapp.com
> > >
> > >
> > > "Jasmine" wrote:
> > >
> > > > Hi,
> > > >
> > > > Is there way to know how many nodes have been checked total in the tree view
> > > > from the client side (java script)?
> > > >
> > > > Thanks, Jasmine
Author
7 Feb 2006 1:48 AM
Phillip Williams
Hi Jasmine,

Taken that the Microsoft TreeView control does not expose a method for
programming the onclick event of the checkbox, I do not think that you can
extend it to do this function.  You can probably add another button where you
process the checkboxes on the server side using the TreeNodeCheckChanged
event.  Though I think it would not be intuitive for the user.

You might find it easier writing a custom control that implements the
specific functions that you required.  It can be done using a datalist or a
datarepeater.  I found it much easier creating my TreeView for navigating to
the City of North Vancouver website www.cnv.org

BTW, your other thread where you asked about the GridView Hyperlink, did you
find the answer that you were looking for?

Show quoteHide quote
"Jasmine" wrote:

> Hi Phillip,
>
> Thank you very much, could I check the parent node, and the subnodes in the
> tree get checked automaticlly ?
>
>
>
> "Phillip Williams" wrote:
>
> > Jasmine,
> >
> > According to the TreeView documentation on the MSDN: "The TreeView control
> > does not expose an AutoPostBack property. Thus, to submit check box
> > selections, you must place a control, such as a Button Web server control, on
> > the page to post information back to the server."
> > http://msdn2.microsoft.com/en-us/library/ms178259.aspx
> >
> > To be able to make use of that event you need to have another control that
> > triggers the PostBack, like I did in this demo:
> > http://www.webswapp.com/codesamples/aspnet20/treeview/TreeNodeCheckChanged.aspx
> >
> > --
> > HTH,
> > Phillip Williams
> > http://www.societopia.net
> > http://www.webswapp.com
> >
> >
> > "Jasmine" wrote:
> >
> > > Hi Phillp,
> > >
> > > Thank you very much for answering my question. Your demo is great!
> > >
> > > May I ask you how could I binding the tree view check box with the grid view
> > > besides it, every time  the node get checked,the node value (such as student
> > > ID) will pass to grid view, a new row with the selected student ID will
> > > append to grid view.  if the node unchecked, the row is the grid view will
> > > get removed, it is for client side only (for UI, it won't affect database).
> > >
> > > I try to use the
> > > "OnTreeNodeCheckChanged="treeview1_TreeNodeCheckChanged"),it doesn't triger
> > > the event at all, do you have any idea how to implement it?
> > >
> > > Thank you very much, Jasmine
> > >
> > > "Phillip Williams" wrote:
> > >
> > > > Jasmine,
> > > >
> > > > The TreeView server control does not provide client-side functions such as
> > > > the number of checked items on the TreeView or changing the colors of the
> > > > checked nodes. All these activities have to be done using JavaScript.
> > > >
> > > > http://www.webswapp.com/codesamples/aspnet20/treeview/
> > > >
> > > > In this demo I perform the following JavaScript manipulations:
> > > > 1-  Count the number of checked nodes
> > > > 2-  Suppress the ToolTip display when the mouse if hovered over the checkbox
> > > >
> > > > --
> > > > HTH,
> > > > Phillip Williams
> > > > http://www.societopia.net
> > > > http://www.webswapp.com
> > > >
> > > >
> > > > "Jasmine" wrote:
> > > >
> > > > > Hi,
> > > > >
> > > > > Is there way to know how many nodes have been checked total in the tree view
> > > > > from the client side (java script)?
> > > > >
> > > > > Thanks, Jasmine