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

Dock Windows dont fill container

5 Answers 110 Views
Dock
This is a migrated thread and some comments may be shown as answers.
Dess | Tech Support Engineer, Principal
Telerik team
Dess | Tech Support Engineer, Principal asked on 15 Apr 2016, 05:09 AM
Hello Alex,

Thank you for writing.

Following the provided information, I was unable to reproduce the issue you are facing. I have attached my sample project. Could you please specify the exact steps how to reproduce the problem or feel free to modify the project in a way to replicate the experienced problem. You can provide the sample modified application in the support thread that you have opened on the same topic.

I am looking forward to your reply.

Regards,
Dess
Telerik
Do you need help with upgrading your AJAX, WPF or WinForms project? Check the Telerik API Analyzer and share your thoughts.

5 Answers, 1 is accepted

Sort by
0
George
Top achievements
Rank 1
answered on 18 Apr 2016, 02:20 PM

Hello,

 

I just upgraded to the latest version and I run into the same bug.

Everything was working perfectly before.

Did you find a solution?

Thanks.

0
Alex
Top achievements
Rank 1
answered on 18 Apr 2016, 02:28 PM

No i havent. Telerik said the below, but that sucks because the control worked fine with the normal MS SplitContainer.....

 

"It seems that the MS SplitContainer doesn't invalidate its children. In order to avoid this undesired behavior, I would recommend you to use RadSplitContainer."

0
Dess | Tech Support Engineer, Principal
Telerik team
answered on 19 Apr 2016, 04:21 AM
Hello guys,

Thank you for writing.

Firstly, I would like to note that RadDock is a container control and it is not necessary to be hosted in another container. However, if you insist on using the MS SplitContainer, you can subscribe to the SplitContainer.SizeChanged event, invalidate each child and activate the respective window in RadDock:
AddHandler Me.SplitContainer1.SizeChanged, AddressOf SplitContainer_SizeChanged

Private Sub SplitContainer_SizeChanged(sender As Object, e As EventArgs)
    For Each c As Control In Me.SplitContainer1.Panel2.Controls
        c.Invalidate()
        Dim dock As RadDock = TryCast(c, RadDock)
        If dock IsNot Nothing Then
            dock.ActivateWindow(Me.DocumentWindow1)
        End If
    Next
End Sub

I hope this information helps. Should you have further questions I would be glad to help.

 Regards,
Dess
Telerik
Do you need help with upgrading your AJAX, WPF or WinForms project? Check the Telerik API Analyzer and share your thoughts.
0
George
Top achievements
Rank 1
answered on 19 Apr 2016, 06:17 AM

Hello and thanks for your reply.

 

In my case I was not using an MS split container but had a rad dock inside a user control in a page of a page viewer.

I have replicated the error and have an open ticket with a project showing the problem.

I was adding pages using the following code:

Private Sub RadButtonElement1_Click(sender As System.Object, e As System.EventArgs) Handles RadButtonElement1.Click
    pageCustomers = New RadPageViewPage()
    Me.pageViewer.Pages.Add(pageCustomers)
    pageCustomers.Controls.Add(New ucManageCustomers With {.Dock = DockStyle.Fill})

    Me.pageViewer.SelectedPage = pageCustomers
    ucMngCustomers = pageCustomers.Controls(0)
End Sub

And I realized I could bypass the UI error by changing the code to the following:

 

Private Sub RadButtonElement1_Click(sender As System.Object, e As System.EventArgs) Handles RadButtonElement1.Click
    pageCustomers = New RadPageViewPage()
    Me.pageViewer.Pages.Add(pageCustomers)
    pageCustomers.Controls.Add(New ucManageCustomers With {.Dock = DockStyle.Fill})
    ucMngCustomers = pageCustomers.Controls(0)
    Me.pageViewer.SelectedPage = Nothing
    Me.pageViewer.SelectedPage = pageCustomers
End Sub

 

(Setting the selected page as the last line of code, right after setting the selected page to nothing).

Hope this helps.

0
Accepted
Hristo
Telerik team
answered on 19 Apr 2016, 08:10 AM
Hello guys,

Thank you for writing.

It appears that you have bumped into a known issue within RadDock. It is already logged in our feedback portal and you can vote for it and subscribe for status changes here: feedback item.

As a possible workaround, you could handle the SizeChanged event and refresh the control this way: 
Private Sub RadForm1_SizeChanged(sender As Object, e As EventArgs)
    Dim window = Me.RadDock1.ActiveWindow
    Me.RadDock1.ActiveWindow = Nothing
    Me.RadDock1.ActiveWindow = window
End Sub

I hope this information was useful. Should you have further questions please do not hesitate to write back.

Regards,
Hristo Merdjanov
Telerik
Do you need help with upgrading your AJAX, WPF or WinForms project? Check the Telerik API Analyzer and share your thoughts.
Tags
Dock
Asked by
Dess | Tech Support Engineer, Principal
Telerik team
Answers by
George
Top achievements
Rank 1
Alex
Top achievements
Rank 1
Dess | Tech Support Engineer, Principal
Telerik team
Hristo
Telerik team
Share this question
or