This is a migrated thread and some comments may be shown as answers.

Check node in Treeview On Demand

2 Answers 118 Views
TreeView
This is a migrated thread and some comments may be shown as answers.
Meaning Of Lights
Top achievements
Rank 2
Meaning Of Lights asked on 11 Nov 2008, 01:57 AM
Hi,

I've almost got this Treeview Loaded On Demand working!!

My last question is how do you check a node that you load on-demand. I've tried CheckState, Checked, Checkable but no luck.

I cant find a sample that demonstrates how to check a node loaded on demand


My aspx:

  <telerik:RadTreeView runat="server" ID="RadTreeView1"
             OnNodeDataBound="RadTreeView1_NodeDataBound" CheckBoxes="true" CheckChildNodes="true"  
            LoadingStatusPosition="None" PersistLoadOnDemandNodes="false" EnableViewState="false"
            Style="float: left" OnClientNodeClicked="onNodeClicked" Width="300px">
            <WebServiceSettings Method="GetTreeViewNodes" Path="~/PopulateTreeview.asmx" />
            <Nodes>
             
            <telerik:RadTreeNode Text="mgpage_BalanceSheet" Checked="true" Value="1" ExpandMode="WebService"> </telerik:RadTreeNode>
            .....


My Code behind:

[WebMethod(EnableSession = true)]
        public List<NodeData> GetTreeViewNodes(RadTreeNodeData node)
        {
            DataTable dt = Helper.ConfigurationHelper.GetCofiguration(node.Text);
            List<NodeData> nodes = new List<NodeData>();
            NodeData nodeData = new NodeData();
            foreach (DataRow dr in dt.Rows)




 foreach (DataRow dr in dt.Rows)
            {
                nodeData = new NodeData();
                nodeData.Text =  dr["DisclosureCode"].ToString();
                nodeData.Value = dr["DisclosureCodeId"].ToString();
                nodeData.ExpandMode = TreeNodeExpandMode.WebService;
                nodeData.CheckState  = TreeNodeCheckState.Checked;
                nodeData.Checkable = true;
                nodeData.Checked = true;

                nodes.Add(nodeData);


        public class NodeData
        {
            public string Value { get; set; }
            public string Text { get; set; }
            public TreeNodeCheckState CheckState { get; set; }
            public bool Checked { get; set; }
            public bool Checkable { get; set; }
            
            public TreeNodeExpandMode ExpandMode { get; set; }
        }



thanks in advance


<edit>
This post http://www.telerik.com/community/forums/aspnet-ajax/treeview/on-demand-loaded-non-checkable-nodes.aspx#673490
recommends the latest Telerik DLL 2008.3.1105.35 and that resolves the problem.. no wonder it was doing my head in.

I see the FindNodeByText and FindNodeByValue, have second boolean parameter ignoreCase.. unfortunalely with the latest DLL I can still produce the StackOverFlow
</edit>

2 Answers, 1 is accepted

Sort by
0
Veselin Vasilev
Telerik team
answered on 14 Nov 2008, 10:29 AM
Hi Jeremy,

I am glad that the problem with the Checked property is now resolved.

As for the other problem with FindNodeByText and FindNodeByValue methods I noticed that you have opened another post, so lets close this one.

Sincerely yours,
Veselin Vasilev
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0
Meaning Of Lights
Top achievements
Rank 2
answered on 29 Dec 2008, 08:44 AM
Hi Veselin ,

Sure archive this case and have a happy new year!

I've written some great doco's using telerik controls for project hand-overs, I'll try and get around to collecting them.. and submitting some:)

For everyone's reference, the link to the open case is: http://www.telerik.com/community/forums/aspnet-ajax/treeview/radtreeview-findnodebyvalue-stackoverflow-repro.aspx , which I am happy to report is solved:)

Cheers Jerermy Lecky-Thompson

ps I'll remain Subscribed to this thread.
Tags
TreeView
Asked by
Meaning Of Lights
Top achievements
Rank 2
Answers by
Veselin Vasilev
Telerik team
Meaning Of Lights
Top achievements
Rank 2
Share this question
or