IT Community - Software Programming, Web Development and Technical Support

How to postback the checkbox value in treeview when each time it is checked ?

This is a discussion on How to postback the checkbox value in treeview when each time it is checked ? within the ASP and ASP.NET Programming forums, part of the Web Development category; How to postback the checkbox value in treeview when each time it is checked? (in asp.net) for example we ...


Go Back   IT Community - Software Programming, Web Development and Technical Support > Web Development > ASP and ASP.NET Programming

Register FAQ Members List Calendar Mark Forums Read
  #1  
Old 07-15-2007, 11:24 PM
bluesky bluesky is offline
D-Web Architect
 
Join Date: Jun 2007
Posts: 667
bluesky is on a distinguished road
Default How to postback the checkbox value in treeview when each time it is checked ?

How to postback the checkbox value in treeview when each time it is checked? (in asp.net)

for example
we have the <treeview control coding here>
.....
....................
<asp:TreeView ID="TreeView1" ImageSet="Msdn" ExpandDepth="1" CssClass="text1"
ShowCheckBoxes="All" runat="server" Width="600px">
<RootNodeStyle Width="400px" ChildNodesPadding="1px" Height="20px" CssClass="text1"
BackColor="White" />
..............
.............


and the value for that are assigned to it from the database when the page is loaded

..............
.............
TreeNode root = new TreeNode();
root.Text = ParentNode[loop, 1];
SqlConnection SqlCon = new SqlConnection("")

SqlCon.Open();
SqlCommand SqlCmd = new SqlCommand( sql statement , SqlCon);
while (Sdr.Read())
{

ParentNode[count, 0] = Sdr.GetValue(Sdr.GetOrdinal("SysMenuID")).ToString ();
ParentNode[count++, 1] = Sdr.GetValue(Sdr.GetOrdinal("Name")).ToString();

.............
.............


now the problem is when the page is loaded .. we get all the values for the checkboxes displayed using the Treeview control

but when we click the check box and submit the page ..how to get the value of the check box ..?

when try to get the id of checked box

foreach(TreeNode root in TreeView1.CheckedNodes)
{
checkmessage.Text = how to get the ParentNode id ..?

}
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
How to populate a Winforms treeview control from dataset arjkhanna Operating Systems 8 05-22-2009 11:42 PM
count the time in seconds that a checkbox is really checked itbarota HTML, CSS and Javascript Coding Techniques 1 02-13-2008 09:16 PM
I am having checkbox in datagrid and treeview, while click the button i need to check kingmaker C# Programming 3 08-14-2007 08:39 AM
I have a TreeView control in one of my webpages and I am facing the following problem itbarota C# Programming 1 07-27-2007 04:33 AM
Checked and UnChecked Exception sivakumar Java Programming 1 07-12-2007 03:01 AM


All times are GMT -7. The time now is 04:29 AM.


Copyright ©2004 - 2007, DiscussWeb. All Rights Reserved.
Our Partners
One Way Moving Companies | Stamford Dentist | Euro Millions Lottery | Home Loans| Furniture

SEO by vBSEO 3.0.0