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
460
XamDataGrid Grouping layout
posted

I have a customer that runs a older VB Winforms application  where they have  Infragistics datagrid that I want to convert to WPF XamDataGrid in C#. The customer want to have it looking the same way after  grouping

that before Grouping looks like this 

And After Grouping byt Annoncør  it looks like this

  • 1500
    Offline posted

    Hello  Thomas,

    Styling components in WPF will allow you to do that.

    You can create a simple version of the groupByRecord presenter like this:

    <Style TargetType="{x:Type igDP:GroupByRecordPresenter}">

                <Setter Property="Template">

                    <Setter.Value>

                        <ControlTemplate TargetType="{x:Type igDP:GroupByRecordPresenter}">

                            <StackPanel Orientation="Horizontal">

                                <Image Source="pic.png" Width="30" Height="30"/>

                                <ContentControl Content="{Binding Path=Description, 

                                    RelativeSource={RelativeSource TemplatedParent}}"/>

                            </StackPanel>

                        </ControlTemplate>

                    </Setter.Value>

                </Setter>

            </Style>

    This will add image to the record presenter, however by doing so most of the functionalities of the GroupByRecordPresenter will be lost(such as expansion indicator, etc.).

    The groupByRecordPresenter have no contnentTemplate, so if you would like to modify it and keep all the current functionalities, you will need to get the default template which is located in the installation directory on your device, and keep modifying it from there. The location of the default styles should be something like this:

    C:\Program Files (x86)\Infragistics\<version>\WPF\DefaultStyles\DataPresenter

    Please let me know if you have any other questions or concerns on this matter.

    Sincerely,
    Tihomir Tonev
    Associate Software Developer
    Infragistics