iSeller Commerce
iSeller POS Retail
iSeller POS F&B
iSeller POS Express
Crosslight
WebUI
ClientUI
What's New
Download Trial
Web Solution
Mobile Solution
Enterprise Solution
Custom Development
Blog
Community
Latest Development Blogs
ForumPostTopic
Browse By Tag
I have a form with 2 WebCombo and 1 WebTab and 1 WebTreeView and 1 WebButton.
My WebCombo1 record is retrieved from sql.
When user selected any record in WebCombo1, I'll retrieve data from sql based on record selected in WebCombo1, and populate the records into WebCombo2.
When user selected any record in WebCombo2, i'll retrieve data from sql based on record selected in WebCombo2, and populate the records into WebTreeView (the WebTreeView reside in the WebTab).
So far, everything works fine. When user check node in WebTreeView, and click the WebButton (also reside in WebTab), in the WebButton_Clicked event (i use AutoPostBack=True and PostBackMode=FullPostBack), i try to get checked nodes by using WebTreeView.CheckedNodes. But no nodes is returned.
Another issue here is after user click the WebButton, and the page is PostBack, then the content in the WebTreeView is gone.
Any suggestion?
Hi,
I noticed what caused your error now. It is because you used Master Page. While we are using HiddenField with attribute "runat=server", the clientID has been changed because inside MasterPage.
There are 2 workarounds to get the hidden object:
1.You can get new changed client id by using "view source" when running the page. You can search the changed id from there.e,g if you search for "hfCheckedNode", the new client id should be "ctl00_ContentPlaceHolder1_hfCheckedNode".
2. Instead used the hard/static way, there is another workaround to use.
We need to add Hidden input html control without "runat=server" attribute. Then, cast the object in the value,such as <input id="Hidden1" type="hidden" value="<%=hfCheckedNode.ClientID %>"/>
For further details, please look into my modified sample. I have also changed some codes to get checkednodes.Hope this helps.
Regards,Handy
I tested with simpler scenario:
I have a page with 1 WebTreeView and 1 WebButton.
During page load, i'll retrieve data from sql and populate the data into WebTreeView.
In the WebButton (AutoPostBack=True and PostBackMode=FullPostBack) clicked event, i use WebTreeView.CheckedNodes to get the nodes checked by user.
When i checked few nodes and click the WebButton, the CheckedNodes function return no nodes checked.
It seems like we are not able to get checked nodes if the WebTreeView is populated from sql instead of xml?
Pls advise! Thanks!
No response from Intersoft? I thought support response time is within 48 hours?
Sorry for the late respond.
I refer to the sample in the following thread, http://www.intersoftpt.com/Community/WebTreeView/tree-using-database/, in order to populate WebTreeView node from database (please let me know if you have different way to populate WebTreeView node). When populating WebTreeView node using such way explained in that thread, then you are not going to be able to get the checked nodes.
Basically, the mechanism to populate WebTreeView node from database is pretty similar to advanced load on demand sample (AdvancedLoadOnDemand.aspx reference sample). I recommend you to obtain the checked nodes from client side as shown in the attached sample.
Appreciate your reply, Yudi.
But in my case, i need to get the checked nodes at server side because after i get checked nodes, i need to perform some database query execution.
Pls advise.
Thanks!
No response again?
Merry Chrismast and Happy New Year.
Yudi is still having day off.
First, you could not just use "WebTreeView1.CheckedNodes". You will need to cast the collection object into WebTreeView Nodes.
e.g
((WebTreeViewNode)WebTreeView1.CheckedNodes[0]).Name;
Also, it seems that You could not do that via server side(postback) for now because Our WebTreeView doesn't have properties to persist checkbox during FullPostBack for now.
The possible way which i think you can do now, is saving the checked nodes via onCheckBoxesChanged client side event into hidden input and check/uncheck manually after FullPostBack based on the hidden input.
Id like to add to this thread. I too am having problems with the treeview "disappearing" after a standard postback. I have a treeview, which I am binding to an xml data source. The datasource is generated dynamically from code behind when the page loads. This is all fine, but, as i say, the tree disappears on postback.
Hello All,
It would be great if you guys could help me by sending me a simple sample which replicates your issue. Sometimes, the issue occured because the way you bound WebTreeView in incorrect event.
E.g for Darrent,
I think you should not bind in PageLoad. You will need to bind inside Page_Init.
Here is my attached sample and hope this can help you.
Hi Handy,
That works for me. I dont think I saw anything in the sample code or documentation on using Page_Init for data binding, but maybe I missed something.
Thanks for your help!
Darren
I can get the checked nodes on client side event. But when i tried to save the checked nodes into hidden input (asp.net label control), it seems like i'm not able to save it. Can you show me how to do it?
Here is my attached sample about how to save the checked nodes into HiddenField. But once again, i need to tell you that it is very hard to persist the checkboxes value in Unbound WebTreeView because all the nodes would be get rendered again every Postback. I suggest you to persist the checkbox value via client side.
Attached is the error i hit when i make use of your code.
I hit the error when i check on any node of the WebTreeView.
It seems the value or object is null. Please ensure that you are not putting the hiddenList control inside a template or something. The code i gave you is HiddenList control code. If you are using the other control, it might be not working. I could not just inspect what the error just by looking the screenshots. It is better if you can provide me your working sample so i can debug to see where the real problem is.
hI,
i tried the code in WebTreeView sample project & it doesn't work either. Attached is the aspx file i make changes to GetCheckedNodes example.
It works now.
Ok, glad to hear that.
or
Choose this if you're already a member of Intersoft Community Forum. You can link your OpenID account to your existing Intersoft Social ID.
Choose this if you don't have an Intersoft account yet. Your authenticated OpenID will be automatically linked to your new Intersoft account.
Enter your Wordpress Blogname