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 links from elsewhere to this Post. Click to view. #1 (permalink)  
Old 07-16-2007, 12:24 AM
bluesky bluesky is offline
D-Web Analyst
 
Join Date: Jun 2007
Posts: 201
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
Sponsored Links
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 On
Pingbacks are On
Refbacks are On

LinkBacks (?)
LinkBack to this Thread: http://www.discussweb.com/asp-asp-net-programming/1741-how-postback-checkbox-value-treeview-when-each-time-checked.html
Posted By For Type Date
How to postback the checkbox value in treeview when each time it ... | Web Hosting This thread Refback 10-29-2007 03:12 PM

Similar Threads
Thread Thread Starter Forum Replies Last Post
count the time in seconds that a checkbox is really checked itbarota HTML, CSS and Javascript Coding Techniques 1 02-13-2008 10: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 09: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 05:33 AM
When should u use a checked & unchecked exception in java? H2o Java Programming 1 07-24-2007 03:47 AM
Checked and UnChecked Exception sivakumar Java Programming 1 07-12-2007 04:01 AM


All times are GMT -7. The time now is 06:47 PM.


Copyright ©2004 - 2007, DiscussWeb. All Rights Reserved.

SEO by vBSEO 3.0.0