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

Re: Question about checkboxes and databases that don't have bools yet

  •  04-25-2008, 4:02 PM

    Re: Question about checkboxes and databases that don't have bools yet

    You can change the column's CellContentTemplate to a DataTemplate as demonstrates in the Providing a cell-content template example in the documentation:

    <Grid xmlns:xcdg="http://schemas.xceed.com/wpf/xaml/datagrid">
      <Grid.Resources>
        <xcdg:DataGridCollectionViewSource x:Key="cvs_products"
                                        Source="{Binding Source={x:Static Application.Current},
                                                          Path=Products}"/>
      </Grid.Resources>
       <xcdg:DataGridControl x:Name="ProductsGrid"
                             ItemsSource="{Binding Source={StaticResource cvs_products}}">
          <xcdg:DataGridControl.Columns>

            <xcdg:Column FieldName="Discontinued">
               <xcdg:Column.CellContentTemplate>
                  <DataTemplate>
                     <Image x:Name="img" Source="D:\true.png" Stretch="None" />
                        <DataTemplate.Triggers>
                           <DataTrigger Binding="{Binding}" Value="False">
                             <Setter TargetName="img" Property="Source" Value="D:\false.png" />
                           </DataTrigger>
                        </DataTemplate.Triggers>
                  </DataTemplate>
               </xcdg:Column.CellContentTemplate>
            </xcdg:Column>
          </xcdg:DataGridControl.Columns>
       </xcdg:DataGridControl>
    </Grid>


    Technical Writer - Xceed Software

    Of all the things I've lost, I miss my mind the most. - Mark Twain
    Filed under:
View Complete Thread
Contact | Site Map | Reviews | Legal Terms of Use | Trademarks | Privacy Statement Copyright 2008 Xceed Software Inc.