473,406 Members | 2,273 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,406 software developers and data experts.

TreeView In GridView - OnTreeNodeCheckChanged event problem


Hi All,

I have a TreeView with CheckBoxes in one of the cells of a GridView and
OnTreeNodeCheckChanged event it does nothing (basically does not postback)
but if I have a button on the page then the OnTreeNodeCheckChanged 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 3867
Hi Stephen,

You can try the following code to fire the treeNodeCheckChanged 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.EventArgs) Handles Me.Load

End Sub

Protected Sub tv_TreeNodeCheckChanged(ByVal sender As Object, ByVal e As
System.Web.UI.WebControls.TreeNodeEventArgs)
Response.Write(e.Node.Text)
End Sub
Protected Sub GridView1_RowCreated(ByVal sender As Object, ByVal e As
System.Web.UI.WebControls.GridViewRowEventArgs) Handles GridView1.RowCreated
If e.Row.RowType = DataControlRowType.DataRow Then
tv = e.Row.FindControl("TreeView1")
AddHandler tv.TreeNodeCheckChanged, AddressOf
tv_TreeNodeCheckChanged
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
OnTreeNodeCheckChanged event it does nothing (basically does not postback)
but if I have a button on the page then the OnTreeNodeCheckChanged 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
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)...
0
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...
0
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...
0
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"...
3
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...
1
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...
1
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...
0
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...
2
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...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
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...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
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,...
0
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...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

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.