tabs docks and a lot more

7 posts, 0 answers
  1. ashish
    ashish avatar
    28 posts
    Member since:
    Jun 2012

    Posted 22 Jun 2007 Link to this post

    I have undertaken a major project which I am hoping the RAD controls will help me accomplish.

    I had started the project with webparts using connection and catalog zones of the webparts.

    What I have is this

    I need docks to be distributed accross tabs. And this needs to happen dynamically. I am tryng to use the rad dock from the prometheus controls. So i have the tabstrip and the dock  layout in the the default.aspx. In the code behind in the page load I am dynamically creating the various tabs and the zones and the initial docks. I am getting this information from am xml file that is the layout defined per user. 

    The docks are user controls , which are rad grids. The rad grids are various reports of the logged in users activities . So the user controls need to recognize the user, his account details and generate the reports accordingly.

    A user can have multiple accounts, so the system needs to allow the user to change the account to the one he needs. Also the user should be able to regenerate the reports for different dates. Also some of the user controls need to talk to each other. so selecting rows from one user control grid, should change a report generated at another user control docked in a diffferent zone. And all this needs to be done ajaxified.

    Also, there should be a way to have a drop down at the top of the page with all accounts that a user has access to , and a calendar. Selecting an account and a date should regenerate all / some (Each dock should have a configurable property allowing / disallowing this feature) the docks for the account and date selected.

    Also need a way to maximize each doc to a complete screen, with a detailed version of the report.

    First question, is all this possible?

    Second the roadblocks so far -
    1. When I distribute zones accross tabs , for some reason docks in only the initial tab works. Basically when  the tab indes set by selectedIndex property on the docklayout. So when I change tabs , I see the dock title on the docs but nothing else, not even a maximize button. Some code that I have -

     For Each page In Me.TabPages  
                Dim g As New Tab  
                ' Dim g As New AjaxControlToolkit.TabPanel  
     
                g.ID = page.Name  
                g.Text = page.Name  
                If (counter = 0) Then  
                    g.Visible = True 
                End If  
     
                ' g.HeaderText = page.Name  
     
                Dim pv As New PageView  
                pv.ID = page.Name  
     
     
     
                Dim tabl As New Table()  
                tabl.Width = Unit.Percentage(100)  
                tabl.Height = Unit.Percentage(100)  
                Dim tbr As New TableRow()  
                For Each z As ZoneDesc In page.Zones  
     
                    ' Next  
                    ' For i As Integer = 1 To page.Cols  
     
                    Dim tbc As New TableCell()  
                    'If page.Cols = 3 Then  
                    'Select Case i  
                    '   Case 1  
                    'tbc.Width = Unit.Percentage(15)  
                    '   Case 2  
                    'tbc.Width = Unit.Percentage(70)  
                    '   Case 3  
                    'tbc.Width = Unit.Percentage(15)  
     
                    ' End Select  
                    ' Else  
                    tbc.Width = Unit.Percentage(100 / page.Zones.Count)  
                    'End If  
     
                    tbc.Height = Unit.Percentage(100)  
                      
                    tbc.VerticalAlign = VerticalAlign.Top  
     
     
     
     
                    ' Dim zone As WebPartZone = New WebPartZone()  
                    Dim zone As New RadDockZone  
                    zzone.ID = z.Name  
                    zone.BorderWidth = Unit.Pixel(1)  
                    zone.Width = Unit.Percentage(100)  
                    'zone.Height = Unit.Percentage(50)  
     
                    zone.CssClass = "zone" 
                    Dim c As Integer = 0 
                    For Each d As Dockdesc In z.Docks  
     
                        Dim dock As New RadDock  
                        ddock.Tag = d.Tags  
                        Dim widget As Control = Me.LoadControl(dock.Tag, d.Value, "06/14/07")  
     
                        dock.ContentContainer.Controls.Add(widget)  
                        ddock.Title = d.Name  
                        dock.EnableDrag = False 
                        dock.Height = Unit.Percentage(100)  
                        dock.Width = Unit.Percentage(100)  
                        dock.ID = page.Name & "_" & d.Name & "_" & z.Name & "_" & c  
                        dock.Width = Unit.Percentage(100)  
                        zone.Controls.Add(dock)  
                        cc = c + 1  
                    Next  
     
                    tbc.Controls.Add(zone)  
                    tbr.Cells.Add(tbc)  
                Next  
     
                tabl.Rows.Add(tbr)  
                '  Dim txt As New Label  
                '  txt.Text = page.Name.ToString()  
                pv.Controls.Add(tabl)  
     
     
     
                RadMultiPage1.PageViews.Add(pv)  
     
     
     
     
                RadTabStrip1.Tabs.Add(g)  
     
                countercounter = counter + 1  
     
            Next 

    2. I am trying to do it so I can pass parameters in the loadcontrol method. I have overloaded the loadcontrol by the code

    Private Overloads Function LoadControl(ByVal UserControlPath As String, ByVal ParamArray constructorParameters As Object()) As UserControl  
            Dim constParamTypes As New List(Of Type)  
            For Each constParam As Object In constructorParameters  
                constParamTypes.Add(constParam.[GetType]())  
            Next  
     
            Dim ctl As UserControl = TryCast(Page.LoadControl(UserControlPath), UserControl)  
     
            ' Find the relevant constructor  
            Dim constructor As Reflection.ConstructorInfo = ctl.[GetType]().BaseType.GetConstructor(constParamTypes.ToArray())  
     
            'And then call the relevant constructor  
            If constructor Is Nothing Then  
                Throw New MemberAccessException("The requested constructor was not found on : " + ctl.[GetType]().BaseType.ToString())  
            Else  
                constructor.Invoke(ctl, constructorParameters)  
            End If  
     
            ' Finally return the fully initialized UC  
            Return ctl  
        End Function 

    This is something I ot of a blog. It was in C and I converted to VBnet and as of now it does not work. Still working on it, but ould appreciate if someone can point me in a better direction.

    3. Can doks be configured to be connected like webparts? If so I can 1. connec my docks to each other and 2. create a dock that has the account dropdowns and connect that to all docks. And can this connection be dynamic so the user can decide if the connection be enabled/ disabled?

    4. How do we maximize the  dock to be a complete page size - and also again regenerate the reports to get a detailed version.

    I am putting this out in the hope that someone says ' thats easy , and this is the code that will do it'! But I am sure thats high hopes. But any help on any of the issues will be appreciated. By the way I am doing all this using trial versions of the rad controls. My boss will authorize the purchase if I can show that this can work.

    Again, any help will be appreciated.

  2. Valeri Hristov
    Admin
    Valeri Hristov avatar
    2252 posts

    Posted 25 Jun 2007 Link to this post

    Hello ashish,

    To keep the forum content consistent I moved this post to the RadDock "Prometheus" forum.

    RadDock "Prometheus" was designed to be very simple and behave as regular ASP:Panel with the addition that it can be moved around the screen and docked in RadDockZone controls. If you need other functionality such as connecting the inner controls in RadDock controls you will need to implement it by yourself.

    Regarding the questions:
    1) Did you try with the latest version of RadDock "Prometheus" from this thread:
    http://www.telerik.com/community/forums/thread/b311D-mkedd.aspx
    I am pretty sure that it will be able to resolve the problem with RadTabStrip. If you still struggle with the problems, send me a simple page, which could be used to observe them. I will respond with a solution ASAP.

    2) I am not sure why this doesn't work, you could ask the blog owner for help. However, this approach is virtually equivalent to creating a method which initializes the UserControl properties, e.g. it does not need to be a constructor. You could create a method with the needed number of parameters and just call it by casting the loaded control to your UserControl type, or if you want to, use Reflection to invoke it.

    3) No. The RadDock controls cannot be connected as WebParts.

    4) RadDock cannot be resized yet. This is the next feature which will be implemented most probably by the end of the summer.

    All the best,
    Valeri Hristov (Senior Developer, MCSD)
    the Telerik team

    Instantly find answers to your questions at the new Telerik Support Center
  3. ashish
    ashish avatar
    28 posts
    Member since:
    Jun 2012

    Posted 27 Jun 2007 Link to this post

    Hey Valeri,

    Thanks for the quick reply! I saw it late as somehow my  spam blocker did not like it!


    "If you need other functionality such as connecting the inner controls in RadDock controls you will need to implement it by yourself. "

    Can you point me in the right direction to go about connecting docks? Actually, connecting doks is something I need in phase2 of my development phase. All I need now is a way of feeding parameters to a dock from outside and getting it to update ajaxed. Say all docks have date as a parameter. All I need now is a way of changing the global date and have docs update. Any ideas on this?

    Now the questions.

     1. I did download and install the said version of Prometheus, but no change. Unfortunately I am working off a firewalled server, that is not on the public domain. I will try to put it on a public server and will show it to you. Or I will get screen shots.

    2. I got the constructor thing to work. I needed a New() sub on the user control. That works.

    3. Any plans of integrating webparts into Prometheus?

    4. I am taking your word and am not going to bother to work on a solution for this.
  4. ashish
    ashish avatar
    28 posts
    Member since:
    Jun 2012

    Posted 27 Jun 2007 Link to this post

    I am going to experiment myself, but is there a way of integrating Ajax Manager with raddocks ? 
  5. Petya
    Admin
    Petya avatar
    869 posts

    Posted 03 Jul 2007 Link to this post

    Hi,

    Apologies for the delayed answer, however Telerik did not work for a couple of days and we are trying to catch up the best way we can.

    1. Currently there are no plans for integrating web parts into Prometheus.
    2. RadAjax and RadDock Prometheus work fine together. It depends on your particular scenario how easy it is to achieve it and if it is the best option. If you encounter problems with your project, please write us again.

    Greetings,
    Petya
    the Telerik team

    Instantly find answers to your questions at the new Telerik Support Center
  6. ashish
    ashish avatar
    28 posts
    Member since:
    Jun 2012

    Posted 11 Sep 2007 Link to this post

    I had been off this project for a while, but am back at it now.

    I am trying to integrate RadDock with radAjaxManager, and am running into roadblocks.

    I am dynamically creating Zones and docks off an xml file. Then I want to separately populate the docks using AjaxManager. I am not able to find the docks that I created earlier. I did give each doc a uniquename, and then used findcontrol() to find the dock, but I get nothing.

    Here'r some snippets of my code. The first function creates all the zones and docks on the page.The docks are mere placeholders. The second function is called by an ajaxed button, and this is supposed to load different user controls on each of the existing docks. I hoped the findcontrol with the ID given to dock while creating it should do the trick.. but it obviously is not.

    Apreciate any help .

    Thanks
     Private Sub AddPages1(ByVal TabId As String)  
            Me.tab_id = tabid 
     
            Dim counter As Integer = 0 
            Dim page As Tabdesc  
     
            For Each page In Me.TabPages  
     
     
                If page.Name.ToString() = tabid Then  
                    Dim tabl As New Table()  
     
                    Dim tbr As New TableRow()  
                    For Each z As ZoneDesc In page.Zones  
     
     
     
                        Dim tbc As New TableCell()  
     
                        tbc.VerticalAlign = VerticalAlign.Top  
     
     
     
     
                        ' Dim zone As WebPartZone = New WebPartZone()  
                        Dim zone As New RadDockZone  
                        zzone.ID = z.Name  
     
                        zone.CssClass = "zone" 
                        Dim c As Integer = 0 
                        For Each d As Dockdesc In z.Docks  
     
                            Dim dock As New RadDock  
                            ddock.Tag = d.Tags  
                            ddock.Title = d.Name  
                            dock.EnableDrag = False 
                            'dock.Collapsed = True 
                            dock.Width = 400 
     
     
                            dock.ID = page.Name & "_" & d.Name & "_" & z.Name & "_" & c  
     
                            dock.UniqueName = page.Name & "_" & d.Name & "_" & z.Name & "_" & c  
                            ' AddHandler dock.Command, AddressOf RadDock_Command  
     
     
                            Dim panelMain As New UpdatePanel()  
                            panelMain.ID = "panelMain" 
                            dock.ContentContainer.Controls.Add(panelMain)  
     
                            Dim pnl As New Panel  
                            pnl.ID = "pnl" & page.Name & "_" & d.Name & "_" & z.Name & "_" & c  
                            RadAjaxManager1.AjaxSettings.AddAjaxSetting(ImageButton1, pnl)  
                            pnl.Width = Unit.Percentage(100)  
                            pnl.Height = Unit.Percentage(100)  
                            panelMain.ContentTemplateContainer.Controls.Add(pnl)  
                            ' Dim ctl As Control = LoadControl(dock.Tag, d.Value, "", True)  
                            'ctl.ID = "uc" & page.Name & "_" & d.Name & "_" & z.Name & "_" & c  
     
     
                            'panelMain.ContentTemplateContainer.Controls.Add(ctl)  
     
                            Dim pdfcommand As New DockCommand()  
                            pdfcommand.AutoPostBack = True 
                            pdfcommand.CssClass = "pdficon" 
                            'command.Name = "Command1" 
     
     
                            pdfcommand.OnClientCommand = "OpenMasterBoxEditor" 
     
                            dock.Commands.Add(pdfcommand)  
                            Dim detcommand As New DockCommand()  
                            detcommand.AutoPostBack = True 
                            detcommand.CssClass = "deticon" 
                            'command.Name = "Command1" 
     
     
                            pdfcommand.OnClientCommand = "OpenMasterBoxEditor" 
     
                            dock.Commands.Add(detcommand)  
                            dock.Commands.Add(New DockCloseCommand())  
                            dock.Commands.Add(New DockExpandCollapseCommand())  
                            dock.Commands.Add(New DockPinUnpinCommand())  
     
                            zone.Controls.Add(dock)  
     
     
                            Dim apt As New AsyncPostBackTrigger()  
                            apt.ControlID = dock.ClientID  
                            apt.EventName = "Command" 
                            panelMain.Triggers.Add(apt)  
     
     
     
                            cc = c + 1  
                        Next  
     
                        tbc.Controls.Add(zone)  
                        tbr.Cells.Add(tbc)  
                    Next  
     
                    tabl.Rows.Add(tbr)  
                    '  Dim txt As New Label  
                    '  txt.Text = page.Name.ToString()  
     
     
                    countercounter = counter + 1  
                    Panel1.Controls.Add(tabl)  
     
                End If  
     
            Next  
     
     
     
     
     
     
        End Sub  
        Private Sub AddPages2(ByVal TabId As String)  
     
            Dim counter As Integer = 0 
            Dim page As Tabdesc  
     
            For Each page In Me.TabPages  
                If page.Name.ToString() = TabId Then  
                    For Each z As ZoneDesc In page.Zones  
     
     
     
     
                        Dim c As Integer = 0 
                        For Each d As Dockdesc In z.Docks  
     
                            'Dim dock As New RadDock  
                            'ddock.Tag = d.Tags  
                            'ddock.Title = d.Name  
                            'dock.EnableDrag = False 
     
                            'dock.ID = page.Name & "_" & d.Name & "_" & z.Name & "_" & c  
     
                            Dim dock As RadDock  
                            dock = Me.FindControl(page.Name & "_" & d.Name & "_" & z.Name & "_" & c)  
                            ' AddHandler dock.Command, AddressOf RadDock_Command  
     
     
                            Dim panelMain As New UpdatePanel()  
                            panelMain.ID = "panelMain" 
     
     
     
     
                            Dim ctl As Control = LoadControl(dock.Tag, d.Value, "06/14/07", True)  
                            ctl.ID = "uc" & page.Name & "_" & d.Name & "_" & z.Name & "_" & c  
     
     
                            panelMain.ContentTemplateContainer.Controls.Add(ctl)  
     
                            dock.ContentContainer.Controls.Add(panelMain)  
     
                            cc = c + 1  
                        Next  
     
     
                    Next  
     
                End If  
     
            Next  
     
        End Sub 
  7. Petio Petkov
    Admin
    Petio Petkov avatar
    825 posts

    Posted 14 Sep 2007 Link to this post


    Hi,

    Keep in mind, that you must update all RadDockZones and RadDockingManager when the Ajax is made. Also if you create dockObjects dynamically, you must create them in OnInit to allow proper viewstate loading and recreate them on every postback(ajax).

    Unfortunately your code snippets didn't help me much. If the suggestion above didn't help you, please open a new support ticket and send us a simple running project where we can observe this issue.

    All the best,
    Petio Petkov
    the Telerik team

    Instantly find answers to your questions at the new Telerik Support Center
Back to Top