Quantcast
Channel: Extended WPF Toolkit™ Community Edition
Viewing all articles
Browse latest Browse all 4964

New Post: simple questions

$
0
0
Hi,

1) DataGridTemplateColumn on Xceed DataGrid :
You can set the property you want on the Column individually :
<xcdg:DataGridControl x:Name="_datagrid" >
         <xcdg:DataGridControl.Resources>
            <DataTemplate x:Key="FirstNameCellContentTemplate">
               <StackPanel Width="20"
                                    Height="30">
                  <Border Background="LightBlue"
                          BorderBrush="Black"
                          BorderThickness="1">
                     <TextBlock Text="{Binding}"
                                FontSize="8"
                                HorizontalAlignment="Center" />
                  </Border>
               </StackPanel>
            </DataTemplate>
            <DataTemplate x:Key="FirstNameCellEditorTemplate">
                 <TextBox Text="{xcdg:CellEditorBinding}"
                          Background="Green" />
            </DataTemplate>
         </xcdg:DataGridControl.Resources>        
         
         <xcdg:DataGridControl.Columns>
            <xcdg:Column FieldName="FirstName"
                                    CellContentTemplate="{StaticResource FirstNameCellContentTemplate}">
               <xcdg:Column.CellEditor>
                  <xcdg:CellEditor EditTemplate="{StaticResource FirstNameCellEditorTemplate}" />
               </xcdg:Column.CellEditor>
            </xcdg:Column>
         </xcdg:DataGridControl.Columns>
</xcdg:DataGridControl>
2) Have DataRows with Green Background and rounded borders :
Re-template the DataRow (xcdg:FixedCellPanel based on default DataRow Template):
<Style TargetType="{x:Type xcdg:DataRow}">
               <Setter Property="Template">
                  <Setter.Value>
                     <ControlTemplate TargetType="{x:Type xcdg:DataRow}">
                        <Border Background="Green"
                                CornerRadius="10">
                           <!-- The PART_CellsHost part designates the Panel to which this Row's Cells should be added.-->
                           <xcdg:FixedCellPanel x:Name="PART_CellsHost"
                                                ColumnStretchMinWidth="{Binding RelativeSource={RelativeSource Self}, Path=(xcdg:DataGridControl.DataGridContext).ColumnStretchMinWidth}"
                                                ColumnStretchMode="{Binding RelativeSource={RelativeSource Self}, Path=(xcdg:DataGridControl.DataGridContext).ColumnStretchMode}"
                                                FixedCellCount="{Binding RelativeSource={RelativeSource Self}, Path=(xcdg:DataGridControl.DataGridContext).FixedColumnCount, Mode=TwoWay}"
                                                FixedColumnDropMarkPen="{Binding RelativeSource={RelativeSource Self}, Path=(xcdg:DataGridControl.DataGridContext).FixedColumnDropMarkPen}"
                                                Margin="{TemplateBinding BorderThickness}" />
                        </Border>
                     </ControlTemplate>
                  </Setter.Value>
               </Setter>
</Style>
Complete doc for Xceed DataGrid can be found here : http://doc.xceedsoft.com/products/XceedWpfDataGrid/

Viewing all articles
Browse latest Browse all 4964

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>