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
100
Multiple values in a column
posted

Hi, i'm trying to do something like this with XamDataGrid (2 or more values in one Column)

<DataGrid ItemSource="{Binding MyValues}">

<DataGrid.Columns>
 <DataGridTemplateColumn Header="Value A and B">
 <DataGridTemplateColumn.CellTemplate>
 <DataTemplate>
 <StackPanel Orientation="Horizontal">
 <TextBlock Text="{Binding ValueA}" />
 <TextBlock Text="{Binding ValueB}" />
 </StackPanel>
 </DataTemplate>
 </DataGridTemplateColumn.CellTemplate>
 </DataGridTemplateColumn>
</DataGrid>
But i don't know how?! I experimented with the CellValuePresenterStyle, but nothing worked for me.
Has anyone an Idea?
Parents
No Data
Reply
  • 100
    posted

    I just tried to solve the problem with XamGrid:

                    <ig:XamGrid ItemsSource="{Binding MyValues}" AutoGenerateColumns="False">
                        <ig:XamGrid.Columns>
                            <ig:TemplateColumn Key="ValueA" IsReadOnly="True" HeaderText="Value A and B">
                                <ig:TemplateColumn.ItemTemplate>
                                    <DataTemplate>
                                        <StackPanel Orientation="Horizontal">
                                            <TextBlock Text="{Binding ValueA}" />
                                            <TextBlock Text="{Binding ValueB}" />
    ...
    
    
    If i run this, for a half second are the values visible and than: invalidColumnKeyException because of Key="ValueA". 
    Really frustrating!
    
    

Children