473,834 Members | 2,362 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

TreeView In GridView - OnTreeNodeCheck Changed event problem


Hi All,

I have a TreeView with CheckBoxes in one of the cells of a GridView and
OnTreeNodeCheck Changed event it does nothing (basically does not postback)
but if I have a button on the page then the OnTreeNodeCheck Changed get
triggered on PostBack. Can some please help me understand why? and how to
get it to postback from GridView itself? any sample articles would be
helpful....

Thanks again,
Stephen
Jun 27 '08 #1
1 3891
Hi Stephen,

You can try the following code to fire the treeNodeCheckCh anged event. this
onlt fires when you change the checkbox and then click on the Item.

Dim tv As New TreeView
Protected Sub Page_Load(ByVal sender As Object, ByVal e As
System.EventArg s) Handles Me.Load

End Sub

Protected Sub tv_TreeNodeChec kChanged(ByVal sender As Object, ByVal e As
System.Web.UI.W ebControls.Tree NodeEventArgs)
Response.Write( e.Node.Text)
End Sub
Protected Sub GridView1_RowCr eated(ByVal sender As Object, ByVal e As
System.Web.UI.W ebControls.Grid ViewRowEventArg s) Handles GridView1.RowCr eated
If e.Row.RowType = DataControlRowT ype.DataRow Then
tv = e.Row.FindContr ol("TreeView1" )
AddHandler tv.TreeNodeChec kChanged, AddressOf
tv_TreeNodeChec kChanged
End If
End Sub

Regards,
Manish
www.ComponentOne.com
"stephen" wrote:
>
Hi All,

I have a TreeView with CheckBoxes in one of the cells of a GridView and
OnTreeNodeCheck Changed event it does nothing (basically does not postback)
but if I have a button on the page then the OnTreeNodeCheck Changed get
triggered on PostBack. Can some please help me understand why? and how to
get it to postback from GridView itself? any sample articles would be
helpful....

Thanks again,
Stephen
Jun 27 '08 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
3917
by: rh | last post by:
I created a user control that is made up of a TreeView and a VScrollBar. I set the TreeView.FullRowSelect = True and it works as expected (full row is visible, appears on top of everything else) but only sometimes. Other times it appears behind the parent form and all that is visible is the last few characters of that row. Anyone know what might be causing this and how I can fix it? Thanks.
0
1784
by: Treeview Trouble | last post by:
I have an application where there are two radio buttons each of which populates a treeview control with a directory structure. Each radio button corresponds to a different directory which may or may not have some subdirectories with the same name. I am not having any problems populating the treeview with the corresponding directory structure when switching between radio buttons. In the treeview's AfterSelect event, I take the path from...
0
1220
by: Michael Lewis | last post by:
Does anyone know if it is possible to bind a gridview to a treeview. Ie. I want to be able to expand a treeview node and see a separate gridview for each node. The gridview will be filtered by a parameter specified by the treeview datasource (ie. ID). I have looked everywhere on the net and it seems that it cannot be done, or at least very difficult. Cheers
0
2205
by: Alex D. | last post by:
Hi. I have a treeview with some checkboxes and I need to postback every time a checkbox is checked or unchecked automatically, so I do this: <asp:TreeView onclick="mypostback(event)" ID="TreeView1" runat="server" OnTreeNodeCheckChanged="TreeView1_TreeNodeCheckChanged" ShowLines="True" ImageSet="Simple" Font-Bold="False" Font-Italic="False" Font-Names="Verdana" Font-Size="XX-Small" NodeIndent="40" ToolTip="Click to see full description."> ...
3
2260
by: Shawn | last post by:
Hi. I'm working with the TreeView control in my ASP.NET 1.1 application. I have a problem I haven't been able to figure out. When I click on a node (not expand), whether it's a parent node, a child node or a leaf node then a DataGrid is populated based on the node's ID property. If I expand a node then the DataGrid is not populated. This works fine. The problem is that this doesn't work if I collapse the tree. If I collapse the tree...
1
693
by: kvicky | last post by:
I am trying to load child nodes to a TreeNode in a TreeView in a ASP.net web application. The Treeview with parent nodes are loaded on a Page_load while doing if( ! ISPostback ) and then in the Treeview event I am dynamically trying to load the child nodes to the exisisting TreeView. The problem is since the TreeView is being loaded on not a Postback, I am unable to refer to any node in the TreeView event. Can anybody tell me how to...
1
7061
by: John Devlon | last post by:
Hi, I've created a small webpage, containing a Treeview and a Gridiview. The treeview is populated with all folders and subfolders of a directory. so far, so good. When clicking on a node in the treeview, I would like to display all files in that folder, in the gridview.
0
1751
by: munishbatra2002 | last post by:
hi all, we are using a gridview and a treeview control ... we want to drag a row from gridview control and drop it onto treeview control on a web page... we are using C# ASP.NET ... can anyone help how to drag and drop an item from gridview to treeview using javascript .. we are able to drop onto a particular area ( e:g a label), but itsn't possible to drop that item onto a particular node in treeview control ..
2
2192
by: =?Utf-8?B?anAybXNmdA==?= | last post by:
My first time using a TreeView: I've got a TreeView that I populated with some data and it has nodes. In the Properties window, I created an Event Handler for the TreeView's AfterSelect method, and it allows me to determine what Tree Node has been selected. However, if I expand the TreeView and select one of the Child TreeNodes, they do not trigger this event.
0
9796
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10786
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10503
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
7754
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6951
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5624
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5790
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4425
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3973
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.