I have seen how you can relative widths for the splitter and panes using the ASP markup, e.g ...
<div id="splitterDIV" style="width: 100%; height: 200px;"> <ig:WebSplitter runat="server" ID="WebSplitter1" Height="100%"> <Panes> <ig:SplitterPane Size="50%"> </ig:SplitterPane> <ig:SplitterPane Size="50%"> </ig:SplitterPane> </Panes> </ig:WebSplitter></div>
However, in my application I am dynamically creating nested splitters in the CreateChildControls event. I want to set the width of the root splitter to 100%, and the pane size to say 60% and 40%. The splitter width and height properties, and the pane size property only seem to allow me to set fixed pixel sizes and the ResizeWithBrowser property seems to have no effect.ThanksNick
Hi Nick,
There should be no difference in behavior of splitter if you set properties in aspx or in aspx.cs dynamically. It is not clear what exactly does not work for you. If exactly same layout works in aspx and fails in aspx.cs, then please provide a sample for that.
You should keep in mind, that if you work with heights (horizontal splitter bar), then in order to use % values, your application should ensure that absolutely all parent html elements of splitter also have height, because under XHTML default heights of containers are collapsed. If it is the case, then you may consider adding style="height:100%" to all containers of splitter including <form>, <body> and <html> objects.
Hi Viktor,
The problem is in VB (or C#) the splitter width property, and pane size property only accept a numeric value. If I pass 100, it takes this as 100 pxiels, not 100%, and there is no property that allows me to say treat my values as relative not specific.
ThanksNick
The Size property is Unit, but not int or double. The intellisense of VisualStudio should show that as a prompt for type of property.
If VB allows you to type-in int instead of Unit, then I would think about that feature as a bug (well, may be friendly automatic conversion).
You may set Size or any other Unit-type property at run time using Unit-value static "builders" like Percentage, Pixel, etc. You also may use Parse, though, in this case format of string should be legal. For example:
this.WebSplitter1.Panes[0].Size = Unit.Percentage(40);this.WebSplitter1.Panes[1].Size = Unit.Parse("60%");
In my ASP application ig:websplitter Height in % not working. But when i put a Div outside and using CSS position propert i place the div to the top and bottom effectively and it works
<ig:websplitter id="wsJSMain" runat="server" Height="100%" Width="100%" DynamicResize="True" orientation="Vertical" ClientIDMode="Static"></ig:websplitter>
But there is an extra Scroll for the ig control ...and its class name is .igspl_Pane. So i put .igspl_Pane {height:auto!important} and the scroll disappears but when content overflows splitter bar container will not have scroll.
Stupid me,obvious when you point it out!
Thanks for the help.Nick