Home - Forums-.NET - FlyTreeView (ASP.NET) - how to get checkbox value??

FlyTreeView (ASP.NET)

Technical support and KB related to the FlyTreeView control

This forum related to following products: FlyTreeView for ASP.NET

how to get checkbox value??
Link Posted: 09-Nov-2005 21:32
aspx:
                runat="server" BackColor="White" Font-Size="X-Small" Font-Names="Tahoma" Width="200px" Height="100%" BorderStyle="Solid"
                BorderWidth="0px" BorderColor="#92CCD6" Padding="2" IconSetPath="classic/" ExpandLevel="3" ClientRuntimePath="./client_runtime/"
                ShowLines="True" LoadingMessage="载入中..." onNodeClientEvent="handleNodeEvent2();">
                                  PostBackOnCollapse="False" PostBackOnExpand="False" HoverStyle="padding: 2px 4px 2px 4px; FONT-FAMILY: Tahoma; FONT-SIZE: 11px; cursor: hand; TEXT-DECORATION: underline;"
                  PostBackOnDeselect="False" SelectedExpandedImageUrl="" NavigateUrl="" CanBeSelected="True" ContextMenuID=""
                  SelectCollapses="False" PostBackOnSelect="False" ExpandedImageUrl="" PostBackOnUncheck="False"
                  PostBackOnCheck="False" DefaultStyle="padding: 2px 4px 2px 4px; FONT-FAMILY: Tahoma; FONT-SIZE: 11px;"
                  SelectExpands="True" SelectedStyle="padding: 1px 3px 1px 3px; border: #aaaaaa 1px solid; FONT-FAMILY: Tahoma; FONT-SIZE: 11px; background-color: whitesmoke; cursor: hand;">
              



i want to after click button,i can get selected chexkbox's value
in cs page,how to write??
Link Posted: 10-Nov-2005 20:55
you should use the
category_tree.GetCheckedNodes() method in order to get the collection of checked nodes in treeview.
Link Posted: 10-Nov-2005 22:23
but can you tell me how to use GetCheckedNodes(),
when i write in this way:Response.Write(category_tree.GetCheckedNodes());
i got the result:NineRays.Web.UI.WebControls.FlyTreeView.TreeNode[]
this is not the result i want to get,can you help me??
Link Posted: 12-Nov-2005 02:52
As you can see the method GetCheckedNodes returns an array of TreeNode object.
So you may simply loop through the collection (using foreach statement or etc) to write its value.
Or use category_tree.GetCheckedNodes()[0] to get the first node of this collection and so on.
Link Posted: 13-Nov-2005 15:24
foreach( NineRays.Web.UI.WebControls.FlyTreeView.TreeNode node in FTV.SelectedNode)
{
        Response.Write(node.Text);
}
i write the code in this way,but it's error,
can you tell me where the error?
Link Posted: 13-Nov-2005 22:30
But do you mean selected node or checked nodes?
Definitelly you cannot loop through ftv.SelectedNode because it is not a collection. You should loop through the result of ftv.GetCheckedNodes()