Hi Everyone,
I'm using a RadTreeView with checkboxes enabled. I would like to persist the checked state of nodes to a new page that I POST to:
<asp:Button ID="PreviewButton" Text="Preview" OnClick="BtnPreview_click" PostBackUrl="<b>SomeNewPage.aspx</b>" runat="server" />;
To do this, inside the BtnPreview_click method, I want to get the value of all of the checked nodes and serialize/store them in a string that I can access from the new posted page (via cross-page posting).
The BtnPreview_click method is as follows:
However, the value of folderView.CheckedNodes is always empty (Count == 0). I've verified that the tree view nodes are populated at this point (albeit, programmatically).
protected void BtnPreview_click(object sender, EventArgs e) { // Get the RadTreeView (called "folderView") IList<RadTreeNode> checkedNodes = folderView.CheckedNodes; // Do some stuff with the nodes }
One other thing to note: this is posting to a new page so I put some breakpoints to see the program flow. When I click the Preview button, I get to Page_Load of the current page (which indicates that the page does a post back before sending me to the new page??), after which the BtnPreview_click(...) method is called, and then finally the Page_Load of the new page is called.
Does anyone know why folderView.CheckedNodes is empty?
Thanks,
Ryan