473,947 Members | 15,466 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 3900
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
3928
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
1790
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
1228
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
2211
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
2265
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
7065
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
1761
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
2197
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
9982
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
11566
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
11153
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
11343
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9886
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
8254
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
7428
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
6331
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
4533
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.