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

RadSplitter Abstract Art

1 Answer 52 Views
Splitter
This is a migrated thread and some comments may be shown as answers.
Kevin
Top achievements
Rank 1
Kevin asked on 08 Jul 2009, 02:12 PM
I created this using dynamic RadSplitter creation with recursion:

http://imgur.com/uiWfq

Use the following code to recreate this masterpiece:
(use at own risk)

Imports Telerik.Web.UI 
 
Partial Class _Default 
    Inherits System.Web.UI.Page 
 
    Protected Overrides Sub OnLoad(ByVal e As System.EventArgs) 
        MyBase.OnLoad(e) 
 
        F(ph) 
 
    End Sub 
 
    Private Sub F(ByVal pane As Control, Optional ByVal limit As Integer = 10) 
 
        If limit <= 0 Then 
            Dim blah As New Literal() 
            blah.Text = " " 
            pane.Controls.Add(blah) 
            Exit Sub 
        End If 
 
        If TypeOf pane Is WebControl Then 
            Dim rand As New Random(pane.GetHashCode) 
            Dim r As Integer = rand.Next(100, 255) 
            Dim g As Integer = rand.Next(10, 255) 
            Dim b As Integer = rand.Next(50, 255) 
            CType(pane, WebControl).BackColor = System.Drawing.Color.FromArgb(r, g, b) 
        End If 
 
        Dim splitter As New RadSplitter() 
        splitter.Orientation = If(limit Mod 2 = 0, Orientation.Horizontal, Orientation.Vertical) 
        splitter.PanesBorderSize = 0 
 
        Dim leftPanel As New RadPane() 
        leftPanel.Scrolling = SplitterPaneScrolling.None 
        F(leftPanel, limit - 1) 
        splitter.Items.Add(leftPanel) 
 
        Dim rightPanel As New RadPane() 
        rightPanel.Scrolling = SplitterPaneScrolling.None 
        F(rightPanel, limit - 1) 
        splitter.Items.Add(rightPanel) 
 
        Dim spacing As New Panel() 
        spacing.Style.Add("padding""5px"
        spacing.Controls.Add(splitter) 
 
        pane.Controls.Add(spacing) 
    End Sub 
 
End Class 
 

<%@ Page Language="VB" AutoEventWireup="false" CodeFile="Default.aspx.vb" Inherits="_Default" %> 
 
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> 
 
<html xmlns="http://www.w3.org/1999/xhtml"
<head runat="server"
</head> 
<body> 
    <form id="form1" runat="server"
     
    <asp:ScriptManager runat="server" /> 
     
    <asp:PlaceHolder runat="server" ID="ph" /> 
     
    </form> 
</body> 
</html> 
 

1 Answer, 1 is accepted

Sort by
0
Mr. Plinko
Top achievements
Rank 1
answered on 06 Aug 2009, 02:15 PM
that would go perfect in my kitchen :)
Tags
Splitter
Asked by
Kevin
Top achievements
Rank 1
Answers by
Mr. Plinko
Top achievements
Rank 1
Share this question
or