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.