This project is read-only.

Datagrid in flyout

Jun 9, 2009 at 6:35 PM

I have added a datagrid to dockable container.  It shows up correctly with the items.  When I unpin it, and make it's parent a flyout, the datagrid height becomes zero (as expected).

When I then click on the tab for the flyout, the container is shown, but the datagrid ONLY shows the headers.  Looking at the contents through SNOOP, it has all the data, but it's height is only the height of the datagrid headers.  Is there some workaround where I can get the datagrid to size correctly to the complete flyout size?

If I do the same thing with a textbox it works.  I am also asking a similar question in the WPF toolkit forums, but want to ask if anyone here as found a workaround.

 

Jun 12, 2009 at 2:07 PM

FYI,

This ended up being an issue that has already been reported in regards to depenedency properties and data binding with the datacontext.  When the window becomes a flyout (or floating), the location in the tree changes, so an DP set based on the parent is lost.  I worked around this...

 

 

Apr 4, 2010 at 2:08 AM

Hi

How did you manage to work around that?

Any source coude would be helpfull

:)

thanks in advance

May 14, 2010 at 1:39 PM
drati wrote:

Hi

How did you manage to work around that?

Any source coude would be helpfull

:)

thanks in advance

In order to fix data binding with controls inside a dockable pane try to specify the binding source explicitly for every binding which depends on DataContext of some control outside the dockable pane.

<dock:DockablePane>
  <dock:DockableContent Title="Pane 1">
    <DataGrid ItemsSource="{Binding Path=PathToData, Source={StaticResource SourceForData}}"/>
  </dock:DockableContent>
</dock:DockablePane>