Welcome to the Xceed Community Sign in | Join | Help
Community Search  

Problem with GroupConfiguration and GroupHeader customization

Sort Posts: Previous Next
  •  07-18-2008, 8:27 AM Post no. 13616

    Problem with GroupConfiguration and GroupHeader customization

     

    Hi everybody,

    I want to customize group header appearance defining a GroupConfiguration item  in window resource and passing this item to "OrderID" column on OnApplyTemplate method . To do this I wrote this XAML:

    <Window>

    <Window.Resources>

    <!--DataGridCollectionViewSource-->

      <xceed:DataGridCollectionViewSource x:Key="cvs_orders"

        Source="{Binding Source={x:Static Application.Current}, Path=Orders}" />

     

    <!-- GroupConfiguration -->

      <xceed:GroupConfiguration x:Key="orderIDGroupConfiguration"

        UseDefaultHeadersFooters="False">

        <xceed:GroupConfiguration.Headers>

          <xceed:GroupHeaderFooterItemTemplate VisibleWhenCollapsed="True">

            <DataTemplate>

              <xceed:GroupHeaderControl>

                <xceed:GroupHeaderControl.Resources>

                  <DataTemplate DataType="{x:Type xceed:Group}">

                    <StackPanel Orientation="Horizontal">

                      <TextBlock Text="TEXT" Background="Yellow" />

                    </StackPanel>

                  </DataTemplate>

                </xceed:GroupHeaderControl.Resources>

              </xceed:GroupHeaderControl>

            </DataTemplate>

          </xceed:GroupHeaderFooterItemTemplate>

        </xceed:GroupConfiguration.Headers>

      </xceed:GroupConfiguration>

    </Window.Resources>

     

    <!-Xceed DataGrid Instance -->

      <xceed:DataGridControl x:Name="OrdersGrid"  mItemsSource="{Binding Source={StaticResource cvs_orders}}">

    </xceed:DataGridControl>

     

    </Window>

     

     

     And in code behind a managed the OnApplyTemplate this way:

    public override void OnApplyTemplate()

    {

      base.OnApplyTemplate();

     

      this.OrdersGrid.Columns["OrderID"].GroupConfiguration =

               FindResource( "orderIDGroupConfiguration" ) as GroupConfiguration;

    }

    Running this code, ONLY the first group header contains the yellow textblock with "TEST" text inside, but all the other group headers use the default template.

    If I move the Groupconfiguration Item from resources to <window> main tag and directly initialize the GroupConfiguration item of OrderId column, all works perfectly...

     

    The problem is that I need to put groupconfigurations outside the main tag....

    Please help me sson because i'm blocked here from two days.....Crying

  •  07-24-2008, 6:18 AM Post no. 13727 in reply to 13616

    Re: Problem with GroupConfiguration and GroupHeader customization

    Any answer from xceed?!

     

    thanks

  •  07-24-2008, 9:21 AM Post no. 13729 in reply to 13727

    Re: Problem with GroupConfiguration and GroupHeader customization

    The team has their heads down finalizing the next release, a major one, so their presence on the forums is reduced. Besides, we don't guarantee any support at all on the forums. This is a free product, and support is community-based. But the developers, designers and technical writers love their product and voluntarily come to the forums anyway, to help out, and that's why there are typically lots of answers from Xceed.

    If you really need help and can't wait for other datagrid users to answer, we do offer priority support when you purchase the Professional Edition with a subscription.

    Thanks for understanding.


    Odi Kosmatos
    VP, R&D, Xceed
    Filed under:
  •  07-25-2008, 5:31 AM Post no. 13748 in reply to 13729

    Re: Problem with GroupConfiguration and GroupHeader customization

    Ok, no problem.

    Thanks for the reply.

View as RSS news feed in XML
Contact | Site Map | Reviews | Legal Terms of Use | Trademarks | Privacy Statement Copyright 2008 Xceed Software Inc.