Home Forums WPF controls Xceed DataGrid for WPF Get other columns value in group header

Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
    Posts
  • User (Old forums)
    Member
    Post count: 23064
    #41489 |

     How I can able to get value of ‘Country’ in ‘Song’ group header

      <DataTemplate DataType=”{x:Type xcdg:Group}”>
                   
    <StackPanel Orientation=”Horizontal” Name=”panelHeaderContent”
    Visibility=”Collapsed” Background=”Aqua” Width=”700″ >
                        <TextBlock Text=”My Country is “/>
                       
    <TextBlock Text=”Binding ” /> <!– I need ‘Country’ value here, Consider that value of ‘Country’ is same for particular ‘Song’
                    </StackPanel>
                </DataTemplate>

     

     Full Code

    <Window xmlns:xcdg=”http://schemas.xceed.com/wpf/xaml/datagrid”&nbsp; x:Class=”MainWindow”
        xmlns=”http://schemas.microsoft.com/winfx/2006/xaml/presentation&#8221;
        xmlns:x=”http://schemas.microsoft.com/winfx/2006/xaml&#8221;
        Title=”MainWindow” Height=”350″ Width=”525″ Loaded=”Window_Loaded”>
        <Window.Resources>
            <ResourceDictionary>
              
                <DataTemplate DataType=”{x:Type xcdg:Group}”>
                    <StackPanel Orientation=”Horizontal” Name=”panelHeaderContent” Visibility=”Collapsed” Background=”Aqua” Width=”700″ >
                        <TextBlock Text=”My Country is “/>
                        <TextBlock Text=”Binding” /> <!– I need Country valye here, Just consider value of ‘Country’ is same for perticulat ‘Song’
                        <TextBlock Text=”{Binding  Items.Count}”/>
                        <TextBlock Text=” items.”/>
                    </StackPanel>
                    <DataTemplate.Triggers>
                        <DataTrigger Binding=”{Binding Title}” Value=”Song”>
                            <Setter TargetName=”panelHeaderContent” Property=”Visibility” Value=”Visible” />
                            <Setter TargetName=”panelHeaderContent” Property=”Width” Value=”Auto” />
                        </DataTrigger>
                    </DataTemplate.Triggers>
                </DataTemplate>
                <xcdg:DataGridCollectionViewSource x:Key=”cvsSongs”
                                             Source=”{Binding Source={x:Static Application.Current},Path=Songs}” AutoFilterMode=”and”>
                </xcdg:DataGridCollectionViewSource>
            </ResourceDictionary>
       
        </Window.Resources>
        <Grid>
            <Grid.RowDefinitions >
                <RowDefinition ></RowDefinition>
            </Grid.RowDefinitions>
            <xcdg:DataGridControl Name=”grid” ItemsSource=”{Binding Source={StaticResource cvsSongs}}”>
                <xcdg:DataGridControl.Columns>
                    <xcdg:Column FieldName=”SongID”
                             Visible=”False”
                             ShowInColumnChooser=”False”/>
                    <xcdg:Column FieldName=”Included”
                             Visible=”False”
                             ShowInColumnChooser=”False”/>
                    <xcdg:Column FieldName=”SongName”
                             Title=”Song”
                             IsMainColumn=”True”
                             Width=”*”/>
                    <xcdg:Column FieldName=”Rating”
                             Width=”*”/>
                    <xcdg:Column FieldName=”LastPlayed”
                             Title=”Last Played”>
                    </xcdg:Column>
                    <xcdg:Column FieldName=”Artist” />
                    <xcdg:Column FieldName=”Category” />
                    <xcdg:Column FieldName=”Country”  Visible=”False” />
                </xcdg:DataGridControl.Columns>

                <xcdg:DataGridControl.DefaultGroupConfiguration>
                    <xcdg:GroupConfiguration>
                        <xcdg:GroupConfiguration.Footers>
                            <DataTemplate>
                                <xcdg:InsertionRow/>
                            </DataTemplate>
                        </xcdg:GroupConfiguration.Footers>
                    </xcdg:GroupConfiguration>
                </xcdg:DataGridControl.DefaultGroupConfiguration>
            </xcdg:DataGridControl>
        </Grid>
    </Window>

    Imported from legacy forums. Posted by SSS (had 322 views)

    User (Old forums)
    Member
    Post count: 23064

    Hi is any other way in code behind to retrieve other column data in xdgc:Group

    Imported from legacy forums. Posted by Sathish (had 73 views)

    Fawzi [Xceed]
    Member
    Post count: 722

    Hi,

    Can you give me more details regarding this issue along with a simple sample project which reprodcues it so that I could have a closer look.

    Imported from legacy forums. Posted by Fawzi [Xceed] (had 93 views)

    User (Old forums)
    Member
    Post count: 23064

    Hi Fawzi,

           I tried to upload my sample solution but I am unable to upload any files in  private message section I am getting below error

    ‘You do not have permission to upload or link to files. Please contact your system administrator.’

     

    Imported from legacy forums. Posted by Sathish (had 55 views)

    Fawzi [Xceed]
    Member
    Post count: 722

    Hi Sathish,

     

    Can you try sending your sample project to: support@xceed.com 

    Imported from legacy forums. Posted by Fawzi [Xceed] (had 98 views)

    User (Old forums)
    Member
    Post count: 23064

    Hi Fawzi,

             Thanks for you reply, I found different solution for our problem without touching the header

     

     

     

     

    Imported from legacy forums. Posted by Sathish (had 202 views)

    User (Old forums)
    Member
    Post count: 23064

    Hi Fawzi,

             Thanks for you reply, I found different solution for our problem without touching the header

     

     

     

     

    Imported from legacy forums. Posted by Sathish (had 50 views)

Viewing 7 posts - 1 through 7 (of 7 total)
  • You must be logged in to reply to this topic.