Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
285
XamWebDialogWindow dynamic resize
posted

Hello,

 

I'm using the XamWebDialogWindow as a modal popup.

I've got a few teething issues with it.

 

1)  The scrollbars don't appear if the content is "dynamically" resized.

My dialog contains a user control that contains a XamWebGrid and I bind data to it. When the data is bound, the grid becomes bigger and doesn't fit anymore. The dialog doesn't show the scrollbars.

If I "hardcode" the content, the scrollbars appear as expected

 

2) Dialog not resized to fit content.

I expect the dialog to fit itself to its content. Once again, that happens with "hardcoded" data in the XamWebGrid but not with bound data.

 

3) (Don't know if it's related) The XamWebGrid in the dialog fits all the width available and makes the dialog take all the available width. I'd like it to fit to data and it doesn't seem to work in that instance (code copy-pasted from other control and it shows the expected behaviour).

 

 

Cheers.

 

Parents
No Data
Reply
  • 4666
    posted

    Hi bjunk!

    If you want to have a scrollbars you can put the content od the XamWebDialogWIndow inside a ScrollViewer:

     <igWindow:XamWebDialogWindow Width="200" Height ="200">

     

     

     

    <ScrollViewer>

     

     

     

    <Button Width="300" Height="300" Content="Content"/>

     

     

     

    </ScrollViewer>

     

     

     

    </igWindow:XamWebDialogWindow>

     

     

    If you didn't specify size of the window (Width and Height) - window will be resized to show all content:

    <igWindow:XamWebDialogWindow >

     

     

     

    <Button Width="300" Height="300" Content="Content"/>

     

     

     

    </igWindow:XamWebDialogWindow>

    Id dynamically change the size of the XamWebDialogWindow content you can listen to

    SizeChanged ebent of the content element.

    For example:

    XAML:

     

     

     

     

     

     

     

     

    <igWindow:XamWebDialogWindow x:Name="myWin">

     

     

     

    <Button Width="300" x:Name="myBtn" Height="300" Content="Content"/>

     

     

     

    </igWindow:XamWebDialogWindow>

    C#

    this

     

    .myBtn.SizeChanged += new SizeChangedEventHandler(MyBtn_SizeChanged);

     

    void MyBtn_SizeChanged(object sender, SizeChangedEventArgs e)

    {

    myWin.Height += (e.NewSize.Height - e.PreviousSize.Height);

    myWin.Width += (e.NewSize.Width - e.PreviousSize.Width);

    }

    This approach can work with other UI components, uncluding Grid

    I hope this can help :-)

     Kind Regards!

    Mihail

Children