GridView within odc.Expander

Dec 21, 2009 at 1:26 PM

Hi,

I've been using the Expander control for several of my pages. So far so good. But recently I tried to place a ListView with multiple columns (GridView as the ListView.View) within the Expander, where the Itemssource is provided through data binding in the XAML. However the end result is not what I expected. The list view is displaying rows of "xyz.MyData" instead of the fields depicted in the DisplayMemberBindings. Initially I tot it could be something wrong with my binding. But once I shifted the whole ListView out of the expander, the ListViewItems displayed perfectly. So I'm rather puzzled. Could someone please advise me on how to overcome this problem? I hope my descriptions make sense. Thanks a lot.

Jun 15, 2010 at 10:50 AM
Same problem, really confused.
Jun 20, 2010 at 10:18 PM
Edited Jun 20, 2010 at 10:43 PM

Same here, took me a while to realize that it is cause of Odyssey.

Has someone a solution or a workaround for this one?

 

Edit: Just found a workaround.

It's caused cause of the skinning of the listview.

I just commented out everything regarding 'ListViewItemTemplate'.

 

It seems to be caused out of this codeblock (perhaps somebody sees the reason):

    <ControlTemplate x:Key="{ComponentResourceKey odc:Skins, ListViewItemTemplate}" TargetType="{x:Type ListViewItem}">
        <odc:RibbonChrome x:Name="border" RenderMouseOver="{TemplateBinding IsMouseOver}" CornerRadius="3"
                HorizontalContentAlignment="Stretch"
                MouseOverBackground="{DynamicResource {ComponentResourceKey odc:Skins, TransparentMouseOverBtnBrush}}">
            <ContentPresenter x:Name="PART_Content" ContentSource="Content" />
        </odc:RibbonChrome>
        <ControlTemplate.Triggers>
            <Trigger Property="IsSelected" Value="True">
                <Setter Property="RenderFlat" Value="False" TargetName="border" />
                <Setter Property="RenderMouseOver" Value="False" TargetName="border" />
            </Trigger>
            <Trigger Property="IsFocused" Value="False">
                <Setter TargetName="border" Property="Background"
                        Value="{DynamicResource {ComponentResourceKey odc:Skins, DeactiveItemSelectedBgBrush}}" />
                <Setter TargetName="border" Property="BorderBrush"
                        Value="{DynamicResource {ComponentResourceKey odc:Skins, DeactiveItemSelectedBorderBrush}}" />
            </Trigger>
        </ControlTemplate.Triggers>
    </ControlTemplate>

Jul 12, 2010 at 9:27 AM

In the file Themes\TreeViewStyle.xaml you have to change

<ControlTemplate x:Key="{ComponentResourceKey odc:Skins, ListViewItemTemplate}" TargetType="{x:Type ListViewItem}">
        <odc:RibbonChrome x:Name="border" RenderMouseOver="{TemplateBinding IsMouseOver}" CornerRadius="3"
                HorizontalContentAlignment="Stretch"
                MouseOverBackground="{DynamicResource {ComponentResourceKey odc:Skins, TransparentMouseOverBtnBrush}}">
            <ContentPresenter x:Name="PART_Content" ContentSource="Content" />


to

<ControlTemplate x:Key="{ComponentResourceKey odc:Skins, ListViewItemTemplate}" TargetType="{x:Type ListViewItem}">
    <odc:RibbonChrome x:Name="border" RenderMouseOver="{TemplateBinding IsMouseOver}" CornerRadius="3"
                HorizontalContentAlignment="Stretch"
                MouseOverBackground="{DynamicResource {ComponentResourceKey odc:Skins, TransparentMouseOverBtnBrush}}">
      <GridViewRowPresenter x:Name="PART_Content" />


and the ListView works correctly!
See you!