Hi Telerik,
I have reviewed the example on how to remove a dynamically created splitbar here. I am trying to remove a RadPane and RadSplitBar from a RadSplitter on collapse.
First, during the OnClientCollapsed event I make an ajaxRequest to force a postback on the page. Then, during SaveDockLayout I perform validation on my controls and remove those controls which need to be removed.
I do this inside of SaveDockLayout -- which causes an exception to be thrown later on. Presumably, this exception is being caused by the fact that I am modifying the view state (?) during a period in which it should not be modified.
By using the line "splitter.Items.Remove(splitBarToRemove)" I get the message
off over in a Telerik.Web.UI.WebResource -- the one for the RadSplitter, presumably.
Anyway, I remove the code that brings the dynamically created SplitBar back -- so I'm not adding a new SplitBar to the RadSplitter. I've tried just disabling the control. The code doesn't know that the RadSplitBar should be removed until after the ajaxRequest has finished processing as SaveDockLayout needs to fire and an AjaxRequest is necessary to make the postback happen.
Any thoughts?
I have reviewed the example on how to remove a dynamically created splitbar here. I am trying to remove a RadPane and RadSplitBar from a RadSplitter on collapse.
First, during the OnClientCollapsed event I make an ajaxRequest to force a postback on the page. Then, during SaveDockLayout I perform validation on my controls and remove those controls which need to be removed.
RadSplitter splitter = splitBarToRemove.Splitter;
splitter.Items.Remove(splitBarToRemove);
RadControlStates.SplitbarStates.Remove(splitBarToRemove.ID);
I do this inside of SaveDockLayout -- which causes an exception to be thrown later on. Presumably, this exception is being caused by the fact that I am modifying the view state (?) during a period in which it should not be modified.
By using the line "splitter.Items.Remove(splitBarToRemove)" I get the message
else
{
var
g=
this
.getSplitBarByIndex(0);
var
e=g.get_element();
Uncaught TypeError: Cannot call method
'get_element'
of
null