Silverlight DataGri列模版,行头图标模版,列头模版,多重表头,,编辑模版,样式

Silverlight DataGri列模版,行头图标模版,列头模版,多重表头,,编辑模版,样式,第1张

概述行头居中  <!--头部居中-->     <Style x:Key="DataGridHeaderStyle" TargetType="Primitives:DataGridColumnHeader">         <Setter Property="HorizontalContentAlignment" Value="Center"/>         <Setter Property="

行头居中

 <!--头部居中-->
    <Style x:Key="DataGrID@R_419_5548@Style" targettype="Primitives:DataGrIDColumn@R_419_5548@">
        <Setter Property="HorizontalContentAlignment" Value="Center"/>
        <Setter Property="VerticalContentAlignment" Value="Center"/>
        <Setter Property="Height" Value="25"/>
        <Setter Property="padding" Value="11,0"/>
        <Setter Property="Background">
            <Setter.Value>
                <linearGradIEntBrush StartPoint="1,0" >
                    <GradIEntStop color="#F7F8F9" Offset="0.2"/>
                    <GradIEntStop color="#DFE3E6" Offset="0.7"/>
                </linearGradIEntBrush>
            </Setter.Value>
        </Setter>
    </Style>

 

 

单击不带边框

<!--列居左-->
    <Style x:Key="DataGrIDCellStyleleft" targettype="sdk:DataGrIDCell">
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate targettype="sdk:DataGrIDCell">
                    <GrID>
                        <!--<visualstatemanager.VisualStateGroups>
                            <VisualStateGroup x:name="SelectionStates">
                                <VisualState x:name="Unselected"/>
                                <VisualState x:name="Selected"/>
                            </VisualStateGroup>
                        </visualstatemanager.VisualStateGroups>-->
                        <ContentPresenter x:name="contentPresenter" ContentTemplate="{TemplateBinding ContentTemplate}" Content="{TemplateBinding Content}" HorizontalAlignment="left" VerticalAlignment="Center" margin="5,5,0"/>
                        <Rectangle Height="25" WIDth="1" Fill="#C9CACA" VerticalAlignment="top" HorizontalAlignment="Right"/>
                    </GrID>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <!--列居中-->
    <Style x:Key="DataGrIDCellStyleCenter" targettype="sdk:DataGrIDCell">
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate targettype="sdk:DataGrIDCell">
                    <GrID>
                        <visualstatemanager.VisualStateGroups>
                            <VisualStateGroup x:name="SelectionStates">
                                <VisualState x:name="Unselected"/>
                                <VisualState x:name="Selected"/>
                            </VisualStateGroup>
                        </visualstatemanager.VisualStateGroups>
                        <ContentPresenter x:name="contentPresenter" ContentTemplate="{TemplateBinding ContentTemplate}" Content="{TemplateBinding Content}" HorizontalAlignment="Center" VerticalAlignment="Center" margin="5,0"/>
                        <Rectangle Height="25" WIDth="1" Fill="#C9CACA" VerticalAlignment="top" HorizontalAlignment="Right"/>
                    </GrID>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <!--列填充-->
    <Style x:Key="DataGrIDCellStyleStretch" targettype="sdk:DataGrIDCell">
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate targettype="sdk:DataGrIDCell">
                    <GrID>
                        <visualstatemanager.VisualStateGroups>
                            <VisualStateGroup x:name="SelectionStates">
                                <VisualState x:name="Unselected"/>
                                <VisualState x:name="Selected"/>
                            </VisualStateGroup>
                        </visualstatemanager.VisualStateGroups>
                        <ContentPresenter x:name="contentPresenter" ContentTemplate="{TemplateBinding ContentTemplate}" Content="{TemplateBinding Content}" HorizontalAlignment="Stretch" VerticalAlignment="Stretch"/>
                        <Rectangle Height="25" WIDth="1" Fill="#C9CACA" VerticalAlignment="top" HorizontalAlignment="Right"/>
                    </GrID>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
    <!--列靠右-->
    <Style x:Key="DataGrIDCellStyleRight" targettype="sdk:DataGrIDCell">
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate targettype="sdk:DataGrIDCell">
                    <GrID>
                        <visualstatemanager.VisualStateGroups>
                            <VisualStateGroup x:name="SelectionStates">
                                <VisualState x:name="Unselected"/>
                                <VisualState x:name="Selected"/>
                            </VisualStateGroup>
                        </visualstatemanager.VisualStateGroups>
                        <ContentPresenter x:name="contentPresenter" ContentTemplate="{TemplateBinding ContentTemplate}" Content="{TemplateBinding Content}" HorizontalAlignment="Right" VerticalAlignment="Center" margin="5,0"/>
                        <Rectangle Height="25" WIDth="1" Fill="#C9CACA" VerticalAlignment="top" HorizontalAlignment="Right"/>
                    </GrID>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

 

 

 

<!--DataGrID头部图标样式Begin-->
    <Style x:Key="RowHeander" targettype="sdk:DataGrIDRow@R_419_5548@">
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate>
                    <GrID>
                        <GrID.Background>
                            <linearGradIEntBrush StartPoint="1,0" >
                                <GradIEntStop color="#F7F8F9" Offset="0.2"/>
                                <GradIEntStop color="#DFE3E6" Offset="0.7"/>
                            </linearGradIEntBrush>
                        </GrID.Background>
                        <Image Source="{Binding State,Mode=TwoWay,Converter={StaticResource RowEditBoolConverter}}" WIDth="15" Height="15"/>
                    </GrID>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
    <!--DataGrID头部图标样式End-->

 

<!--多重表头单列上下布局,下右有列分割线(价格优惠)-->
    <Style x:Key="HaveColumnline@R_419_5548@Style" targettype="sdk:DataGrIDColumn@R_419_5548@" BasedOn="{StaticResource DataGrIDBase@R_419_5548@Style}">
        <Setter Property="Foreground" Value="#FF000000"/>
        <Setter Property="HorizontalContentAlignment" Value="left"/>
        <Setter Property="VerticalContentAlignment" Value="Center"/>
        <Setter Property="IsTabStop" Value="False"/>
        <Setter Property="SeparatorBrush" Value="#FFC9CACA"/>
        <Setter Property="padding" Value="8"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate targettype="sdk:DataGrIDColumn@R_419_5548@">
                    <GrID x:name="Root">
                        <GrID.RowDeFinitions>
                            <RowDeFinition Height="20"/>
                            <RowDeFinition Height="1"/>
                            <RowDeFinition Height="20"/>
                        </GrID.RowDeFinitions>
                        <visualstatemanager.VisualStateGroups>
                            <VisualStateGroup x:name="CommonStates">
                                <VisualState x:name="normal"/>
                                <VisualState x:name="MouSEOver">
                                    <Storyboard>
                                        <colorAnimation Duration="0"
                                                    Storyboard.Targetname="BackgroundRectangle"
                                                    Storyboard.TargetProperty="(Fill).color" To="#FF448DCA"/>
                                        <colorAnimation Duration="0"
                                                    Storyboard.Targetname="BackgroundGradIEnt"
                                                    Storyboard.TargetProperty="(Fill).(GradIEntStops)[3].color" To="#7FFFFFFF"/>
                                        <colorAnimation Duration="0"
                                                    Storyboard.Targetname="BackgroundGradIEnt"
                                                    Storyboard.TargetProperty="(Fill).(GradIEntStops)[2].color" To="#CCFFFFFF"/>
                                        <colorAnimation Duration="0"
                                                    Storyboard.Targetname="BackgroundGradIEnt"
                                                    Storyboard.TargetProperty="(Fill).(GradIEntStops)[1].color" To="#F2FFFFFF"/>
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:name="pressed">
                                    <Storyboard>
                                        <colorAnimation Duration="0"
                                                    Storyboard.Targetname="BackgroundRectangle"
                                                    Storyboard.TargetProperty="(Fill).color" To="#FF448DCA"/>
                                        <colorAnimation Duration="0"
                                                    Storyboard.Targetname="BackgroundGradIEnt"
                                                    Storyboard.TargetProperty="(Fill).(GradIEntStops)[0].color" To="#D8FFFFFF"/>
                                        <colorAnimation Duration="0"
                                                    Storyboard.Targetname="BackgroundGradIEnt"
                                                    Storyboard.TargetProperty="(Fill).(GradIEntStops)[1].color" To="#C6FFFFFF"/>
                                        <colorAnimation Duration="0"
                                                    Storyboard.Targetname="BackgroundGradIEnt"
                                                    Storyboard.TargetProperty="(Fill).(GradIEntStops)[2].color" To="#8CFFFFFF"/>
                                        <colorAnimation Duration="0"
                                                    Storyboard.Targetname="BackgroundGradIEnt"
                                                    Storyboard.TargetProperty="(Fill).(GradIEntStops)[3].color" To="#3FFFFFFF"/>
                                    </Storyboard>
                                </VisualState>
                            </VisualStateGroup>
                            <VisualStateGroup x:name="SortStates">
                                <VisualState x:name="Unsorted"/>
                                <VisualState x:name="SortAscending" />
                                <VisualState x:name="SortDescending" />
                            </VisualStateGroup>
                        </visualstatemanager.VisualStateGroups>
                        <Rectangle x:name="BackgroundRectangle" Fill="#FF1F3B53" Stretch="Fill"  GrID.rowspan="3"/>
                        <Rectangle x:name="BackgroundGradIEnt" Stretch="Fill" GrID.rowspan="3">
                            <Rectangle.Fill>
                                <linearGradIEntBrush EndPoint=".7,1" StartPoint=".7,0">
                                    <GradIEntStop color="#FCFFFFFF" Offset="0.015"/>
                                    <GradIEntStop color="#F7FFFFFF" Offset="0.375"/>
                                    <GradIEntStop color="#E5FFFFFF" Offset="0.6"/>
                                    <GradIEntStop color="#D1FFFFFF" Offset="1"/>
                                </linearGradIEntBrush>
                            </Rectangle.Fill>
                        </Rectangle>

                        <Rectangle Fill="#FFC9CACA" VerticalAlignment="Stretch" Height="1"  HorizontalAlignment="Stretch" GrID.Row="1"/>
                        <ContentPresenter Content="{TemplateBinding Content}" GrID.Row="2" VerticalAlignment="Center" HorizontalAlignment="Center"/>

                        <Rectangle Fill="#FFC9CACA" VerticalAlignment="Stretch" Height="20" WIDth="1" HorizontalAlignment="Right" GrID.Row="2"/>

                    </GrID>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
    <!--多重表头单列上下布局,下右没有列分割线(价格优惠)-->
    <Style x:Key="HaveNotColumnline@R_419_5548@Style" targettype="sdk:DataGrIDColumn@R_419_5548@" BasedOn="{StaticResource DataGrIDBase@R_419_5548@Style}">
        <Setter Property="Foreground" Value="#FF000000"/>
        <Setter Property="HorizontalContentAlignment" Value="left"/>
        <Setter Property="VerticalContentAlignment" Value="Center"/>
        <Setter Property="IsTabStop" Value="False"/>
        <Setter Property="SeparatorBrush" Value="#FFC9CACA"/>
        <Setter Property="padding" Value="8"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate targettype="sdk:DataGrIDColumn@R_419_5548@">
                    <GrID x:name="Root">
                        <GrID.RowDeFinitions>
                            <RowDeFinition Height="20"/>
                            <RowDeFinition Height="1"/>
                            <RowDeFinition Height="20"/>
                        </GrID.RowDeFinitions>
                        <visualstatemanager.VisualStateGroups>
                            <VisualStateGroup x:name="CommonStates">
                                <VisualState x:name="normal"/>
                                <VisualState x:name="MouSEOver">
                                    <Storyboard>
                                        <colorAnimation Duration="0"
                                                    Storyboard.Targetname="BackgroundRectangle"
                                                    Storyboard.TargetProperty="(Fill).color" To="#FF448DCA"/>
                                        <colorAnimation Duration="0"
                                                    Storyboard.Targetname="BackgroundGradIEnt"
                                                    Storyboard.TargetProperty="(Fill).(GradIEntStops)[3].color" To="#7FFFFFFF"/>
                                        <colorAnimation Duration="0"
                                                    Storyboard.Targetname="BackgroundGradIEnt"
                                                    Storyboard.TargetProperty="(Fill).(GradIEntStops)[2].color" To="#CCFFFFFF"/>
                                        <colorAnimation Duration="0"
                                                    Storyboard.Targetname="BackgroundGradIEnt"
                                                    Storyboard.TargetProperty="(Fill).(GradIEntStops)[1].color" To="#F2FFFFFF"/>
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:name="pressed">
                                    <Storyboard>
                                        <colorAnimation Duration="0"
                                                    Storyboard.Targetname="BackgroundRectangle"
                                                    Storyboard.TargetProperty="(Fill).color" To="#FF448DCA"/>
                                        <colorAnimation Duration="0"
                                                    Storyboard.Targetname="BackgroundGradIEnt"
                                                    Storyboard.TargetProperty="(Fill).(GradIEntStops)[0].color" To="#D8FFFFFF"/>
                                        <colorAnimation Duration="0"
                                                    Storyboard.Targetname="BackgroundGradIEnt"
                                                    Storyboard.TargetProperty="(Fill).(GradIEntStops)[1].color" To="#C6FFFFFF"/>
                                        <colorAnimation Duration="0"
                                                    Storyboard.Targetname="BackgroundGradIEnt"
                                                    Storyboard.TargetProperty="(Fill).(GradIEntStops)[2].color" To="#8CFFFFFF"/>
                                        <colorAnimation Duration="0"
                                                    Storyboard.Targetname="BackgroundGradIEnt"
                                                    Storyboard.TargetProperty="(Fill).(GradIEntStops)[3].color" To="#3FFFFFFF"/>
                                    </Storyboard>
                                </VisualState>
                            </VisualStateGroup>
                            <VisualStateGroup x:name="SortStates">
                                <VisualState x:name="Unsorted"/>
                                <VisualState x:name="SortAscending" />
                                <VisualState x:name="SortDescending" />
                            </VisualStateGroup>
                        </visualstatemanager.VisualStateGroups>
                        <Rectangle x:name="BackgroundRectangle" Fill="#FF1F3B53" Stretch="Fill"  GrID.rowspan="3"/>
                        <Rectangle x:name="BackgroundGradIEnt" Stretch="Fill" GrID.rowspan="3">
                            <Rectangle.Fill>
                                <linearGradIEntBrush EndPoint=".7,0">
                                    <GradIEntStop color="#FCFFFFFF" Offset="0.015"/>
                                    <GradIEntStop color="#F7FFFFFF" Offset="0.375"/>
                                    <GradIEntStop color="#E5FFFFFF" Offset="0.6"/>
                                    <GradIEntStop color="#D1FFFFFF" Offset="1"/>
                                </linearGradIEntBrush>
                            </Rectangle.Fill>
                        </Rectangle>

                        <Rectangle Fill="#FFC9CACA" VerticalAlignment="Stretch" Height="1"  HorizontalAlignment="Stretch" GrID.Row="1"/>
                        <ContentPresenter Content="{TemplateBinding Content}" GrID.Row="2" VerticalAlignment="Center" HorizontalAlignment="Center"/>

                    </GrID>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
    <!--多重表头单列下左右布局(价格优惠)-->
    <Style x:Key="DownleftRight@R_419_5548@Style" targettype="sdk:DataGrIDColumn@R_419_5548@" BasedOn="{StaticResource DataGrIDBase@R_419_5548@Style}">
        <Setter Property="Foreground" Value="#FF000000"/>
        <Setter Property="HorizontalContentAlignment" Value="left"/>
        <Setter Property="VerticalContentAlignment" Value="Center"/>
        <Setter Property="IsTabStop" Value="False"/>
        <Setter Property="SeparatorBrush" Value="#FFC9CACA"/>
        <Setter Property="padding" Value="8"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate targettype="sdk:DataGrIDColumn@R_419_5548@">
                    <GrID x:name="Root">
                        <GrID.RowDeFinitions>
                            <RowDeFinition Height="20"/>
                            <RowDeFinition Height="1"/>
                            <RowDeFinition Height="20"/>
                        </GrID.RowDeFinitions>
                        <GrID.ColumnDeFinitions>
                            <ColumnDeFinition WIDth="*"/>
                            <ColumnDeFinition WIDth="1"/>
                            <ColumnDeFinition WIDth="*"/>
                        </GrID.ColumnDeFinitions>
                        <visualstatemanager.VisualStateGroups>
                            <VisualStateGroup x:name="CommonStates">
                                <VisualState x:name="normal"/>
                                <VisualState x:name="MouSEOver">
                                    <Storyboard>
                                        <colorAnimation Duration="0"
                                                    Storyboard.Targetname="BackgroundRectangle"
                                                    Storyboard.TargetProperty="(Fill).color" To="#FF448DCA"/>
                                        <colorAnimation Duration="0"
                                                    Storyboard.Targetname="BackgroundGradIEnt"
                                                    Storyboard.TargetProperty="(Fill).(GradIEntStops)[3].color" To="#7FFFFFFF"/>
                                        <colorAnimation Duration="0"
                                                    Storyboard.Targetname="BackgroundGradIEnt"
                                                    Storyboard.TargetProperty="(Fill).(GradIEntStops)[2].color" To="#CCFFFFFF"/>
                                        <colorAnimation Duration="0"
                                                    Storyboard.Targetname="BackgroundGradIEnt"
                                                    Storyboard.TargetProperty="(Fill).(GradIEntStops)[1].color" To="#F2FFFFFF"/>
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:name="pressed">
                                    <Storyboard>
                                        <colorAnimation Duration="0"
                                                    Storyboard.Targetname="BackgroundRectangle"
                                                    Storyboard.TargetProperty="(Fill).color" To="#FF448DCA"/>
                                        <colorAnimation Duration="0"
                                                    Storyboard.Targetname="BackgroundGradIEnt"
                                                    Storyboard.TargetProperty="(Fill).(GradIEntStops)[0].color" To="#D8FFFFFF"/>
                                        <colorAnimation Duration="0"
                                                    Storyboard.Targetname="BackgroundGradIEnt"
                                                    Storyboard.TargetProperty="(Fill).(GradIEntStops)[1].color" To="#C6FFFFFF"/>
                                        <colorAnimation Duration="0"
                                                    Storyboard.Targetname="BackgroundGradIEnt"
                                                    Storyboard.TargetProperty="(Fill).(GradIEntStops)[2].color" To="#8CFFFFFF"/>
                                        <colorAnimation Duration="0"
                                                    Storyboard.Targetname="BackgroundGradIEnt"
                                                    Storyboard.TargetProperty="(Fill).(GradIEntStops)[3].color" To="#3FFFFFFF"/>
                                    </Storyboard>
                                </VisualState>
                            </VisualStateGroup>
                            <VisualStateGroup x:name="SortStates">
                                <VisualState x:name="Unsorted"/>
                                <VisualState x:name="SortAscending" />
                                <VisualState x:name="SortDescending" />
                            </VisualStateGroup>
                        </visualstatemanager.VisualStateGroups>
                        <Rectangle x:name="BackgroundRectangle" Fill="#FF1F3B53" Stretch="Fill" GrID.Column="0" GrID.Row="0" GrID.rowspan="3" GrID.ColumnSpan="3"/>
                        <Rectangle x:name="BackgroundGradIEnt" Stretch="Fill" GrID.rowspan="3" GrID.ColumnSpan="3" GrID.Column="0" GrID.Row="0">
                            <Rectangle.Fill>
                                <linearGradIEntBrush EndPoint=".7,0">
                                    <GradIEntStop color="#FCFFFFFF" Offset="0.015"/>
                                    <GradIEntStop color="#F7FFFFFF" Offset="0.375"/>
                                    <GradIEntStop color="#E5FFFFFF" Offset="0.6"/>
                                    <GradIEntStop color="#D1FFFFFF" Offset="1"/>
                                </linearGradIEntBrush>
                            </Rectangle.Fill>
                        </Rectangle>

                        <ContentPresenter Content="{TemplateBinding Content}" GrID.Row="0" GrID.ColumnSpan="3" VerticalAlignment="Center" HorizontalAlignment="Center"/>

                        <Rectangle Fill="#FFC9CACA" VerticalAlignment="Stretch" Height="1"  HorizontalAlignment="Stretch" GrID.Row="1" GrID.ColumnSpan="3"/>
                        <TextBlock Text="单光价" VerticalAlignment="Center" HorizontalAlignment="Center" GrID.Row="2" GrID.Column="0"/>
                        <TextBlock Text="散光价" VerticalAlignment="Center" HorizontalAlignment="Center" GrID.Row="2" GrID.Column="2"/>

                        <Rectangle Fill="#FFC9CACA" VerticalAlignment="Stretch" Height="20" WIDth="1" GrID.Row="2" GrID.Column="1"/>
                        <Rectangle Fill="#FFC9CACA" VerticalAlignment="Stretch" Height="41" WIDth="1" HorizontalAlignment="Right" GrID.Row="0" GrID.rowspan="3" GrID.ColumnSpan="3"/>
                        <Rectangle Fill="#FFC9CACA" VerticalAlignment="Stretch" Height="41" WIDth="1" HorizontalAlignment="left" GrID.Row="0" GrID.rowspan="3" GrID.ColumnSpan="3"/>

                    </GrID>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
    <!--多重表头单列居中布局(价格优惠)-->
    <Style x:Key="Center@R_419_5548@Style" targettype="sdk:DataGrIDColumn@R_419_5548@" BasedOn="{StaticResource DataGrIDBase@R_419_5548@Style}">
        <Setter Property="Foreground" Value="#FF000000"/>
        <Setter Property="HorizontalContentAlignment" Value="left"/>
        <Setter Property="VerticalContentAlignment" Value="Center"/>
        <Setter Property="IsTabStop" Value="False"/>
        <Setter Property="SeparatorBrush" Value="#FFC9CACA"/>
        <Setter Property="padding" Value="8"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate targettype="sdk:DataGrIDColumn@R_419_5548@">
                    <GrID x:name="Root">
                        <visualstatemanager.VisualStateGroups>
                            <VisualStateGroup x:name="CommonStates">
                                <VisualState x:name="normal"/>
                                <VisualState x:name="MouSEOver">
                                    <Storyboard>
                                        <colorAnimation Duration="0"
                                                    Storyboard.Targetname="BackgroundRectangle"
                                                    Storyboard.TargetProperty="(Fill).color" To="#FF448DCA"/>
                                        <colorAnimation Duration="0"
                                                    Storyboard.Targetname="BackgroundGradIEnt"
                                                    Storyboard.TargetProperty="(Fill).(GradIEntStops)[3].color" To="#7FFFFFFF"/>
                                        <colorAnimation Duration="0"
                                                    Storyboard.Targetname="BackgroundGradIEnt"
                                                    Storyboard.TargetProperty="(Fill).(GradIEntStops)[2].color" To="#CCFFFFFF"/>
                                        <colorAnimation Duration="0"
                                                    Storyboard.Targetname="BackgroundGradIEnt"
                                                    Storyboard.TargetProperty="(Fill).(GradIEntStops)[1].color" To="#F2FFFFFF"/>
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:name="pressed">
                                    <Storyboard>
                                        <colorAnimation Duration="0"
                                                    Storyboard.Targetname="BackgroundRectangle"
                                                    Storyboard.TargetProperty="(Fill).color" To="#FF448DCA"/>
                                        <colorAnimation Duration="0"
                                                    Storyboard.Targetname="BackgroundGradIEnt"
                                                    Storyboard.TargetProperty="(Fill).(GradIEntStops)[0].color" To="#D8FFFFFF"/>
                                        <colorAnimation Duration="0"
                                                    Storyboard.Targetname="BackgroundGradIEnt"
                                                    Storyboard.TargetProperty="(Fill).(GradIEntStops)[1].color" To="#C6FFFFFF"/>
                                        <colorAnimation Duration="0"
                                                    Storyboard.Targetname="BackgroundGradIEnt"
                                                    Storyboard.TargetProperty="(Fill).(GradIEntStops)[2].color" To="#8CFFFFFF"/>
                                        <colorAnimation Duration="0"
                                                    Storyboard.Targetname="BackgroundGradIEnt"
                                                    Storyboard.TargetProperty="(Fill).(GradIEntStops)[3].color" To="#3FFFFFFF"/>
                                    </Storyboard>
                                </VisualState>
                            </VisualStateGroup>
                            <VisualStateGroup x:name="SortStates">
                                <VisualState x:name="Unsorted"/>
                                <VisualState x:name="SortAscending" />
                                <VisualState x:name="SortDescending" />
                            </VisualStateGroup>
                        </visualstatemanager.VisualStateGroups>
                        <Rectangle x:name="BackgroundRectangle" Fill="#FF1F3B53" Stretch="Fill"/>
                        <Rectangle x:name="BackgroundGradIEnt" Stretch="Fill">
                            <Rectangle.Fill>
                                <linearGradIEntBrush EndPoint=".7,0">
                                    <GradIEntStop color="#FCFFFFFF" Offset="0.015"/>
                                    <GradIEntStop color="#F7FFFFFF" Offset="0.375"/>
                                    <GradIEntStop color="#E5FFFFFF" Offset="0.6"/>
                                    <GradIEntStop color="#D1FFFFFF" Offset="1"/>
                                </linearGradIEntBrush>
                            </Rectangle.Fill>
                        </Rectangle>

                        <ContentPresenter Content="{TemplateBinding Content}" VerticalAlignment="Center" HorizontalAlignment="Center"/>

                    </GrID>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

 

 

 

 

多重表头

<sdk:DataGrID x:name="dgPriceFavorble" ItemsSource="{Binding CustomerFavorableSource,Mode=TwoWay}"  GrID.Column="2" GrID.Row="4" CanUserResizeColumns="True" VerticalAlignment="Stretch" HorizontalAlignment="Stretch" GrIDlinesVisibility="Vertical" autoGenerateColumns="False">             <sdk:DataGrID.Columns>                 <!--选择-->                 <sdk:DataGrIDTemplateColumn CellStyle="{StaticResource DataGrIDCellStyleCenter}" @R_419_5548@Style="{StaticResource HaveColumnline@R_419_5548@Style}" @R_419_5548@="选择" MinWIDth="40" WIDth="auto">                     <sdk:DataGrIDTemplateColumn.CellTemplate>                         <DataTemplate>                             <CheckBox HorizontalAlignment="Center" VerticalAlignment="Center" IsChecked="{Binding IsChecked,Mode=TwoWay}" Click="CheckBox_Click"/>                         </DataTemplate>                     </sdk:DataGrIDTemplateColumn.CellTemplate>                 </sdk:DataGrIDTemplateColumn>                 <!--供应商-->                 <sdk:DataGrIDTextColumn IsReadonly="True"  @R_419_5548@Style="{StaticResource HaveColumnline@R_419_5548@Style}" CellStyle="{StaticResource DataGrIDCellStyleleft}" @R_419_5548@="供应商" WIDth="auto" MinWIDth="60" Binding="{Binding Path=vendorCodename}"/>                 <!--品牌-->                 <sdk:DataGrIDTextColumn IsReadonly="True"  @R_419_5548@Style="{StaticResource HaveColumnline@R_419_5548@Style}" CellStyle="{StaticResource DataGrIDCellStyleleft}" @R_419_5548@="品牌" WIDth="auto" MinWIDth="60" Binding="{Binding Path=Model.Brand}"/>                 <!--代号-->                 <sdk:DataGrIDTextColumn IsReadonly="True"  @R_419_5548@Style="{StaticResource HaveColumnline@R_419_5548@Style}" CellStyle="{StaticResource DataGrIDCellStyleleft}" @R_419_5548@="代号" WIDth="auto" MinWIDth="60" Binding="{Binding Path=Model.ProductCode}"/>                 <!--中文名-->                 <sdk:DataGrIDTextColumn IsReadonly="True"  @R_419_5548@Style="{StaticResource HaveColumnline@R_419_5548@Style}" CellStyle="{StaticResource DataGrIDCellStyleleft}" @R_419_5548@="中文名" WIDth="auto" MinWIDth="60" Binding="{Binding Path=Model.ProductCname}"/>                 <!--开始日期-->                 <sdk:DataGrIDTemplateColumn @R_419_5548@Style="{StaticResource HaveColumnline@R_419_5548@Style}" MinWIDth="60" @R_419_5548@="开始日期" WIDth="auto">                     <sdk:DataGrIDTemplateColumn.CellTemplate>                         <DataTemplate>                             <TextBlock margin="5,0" VerticalAlignment="Center" Text="{Binding Path=Model.StartDate,StringFormat=yyyy-MM-dd}" Foreground="{Binding Path=Model.StartDate,Converter={StaticResource ClickEditConverter}}"/>                         </DataTemplate>                     </sdk:DataGrIDTemplateColumn.CellTemplate>                     <sdk:DataGrIDTemplateColumn.CellEditingTemplate>                         <DataTemplate>                             <sdk:DatePicker SelectedDateFormat="Long" WIDth="110" SelectedDate="{Binding Model.StartDate,Mode=TwoWay}" Height="25" VerticalAlignment="Center" HorizontalAlignment="Center"/>                         </DataTemplate>                     </sdk:DataGrIDTemplateColumn.CellEditingTemplate>                 </sdk:DataGrIDTemplateColumn>                 <!--结束日期-->                 <sdk:DataGrIDTemplateColumn @R_419_5548@Style="{StaticResource HaveNotColumnline@R_419_5548@Style}"  @R_419_5548@="结束日期" MinWIDth="60" WIDth="auto">                     <sdk:DataGrIDTemplateColumn.CellTemplate>                         <DataTemplate>                             <TextBlock margin="5,0" VerticalAlignment="Center" Text="{Binding Path=Model.EndDate,StringFormat=yyyy-MM-dd}" Foreground="{Binding Path=Model.EndDate,Converter={StaticResource ClickEditConverter}}"/>                         </DataTemplate>                     </sdk:DataGrIDTemplateColumn.CellTemplate>                     <sdk:DataGrIDTemplateColumn.CellEditingTemplate>                         <DataTemplate>                             <sdk:DatePicker SelectedDateFormat="Long" WIDth="110" SelectedDate="{Binding Path=Model.EndDate,Mode=TwoWay}" Height="25" VerticalAlignment="Center" HorizontalAlignment="Center"/>                         </DataTemplate>                     </sdk:DataGrIDTemplateColumn.CellEditingTemplate>                 </sdk:DataGrIDTemplateColumn>                 <!--改价前-->                 <sdk:DataGrIDTemplateColumn @R_419_5548@Style="{StaticResource DownleftRight@R_419_5548@Style}" CellStyle="{StaticResource DataGrIDCellStyleStretch}" @R_419_5548@="原价" MinWIDth="120" WIDth="auto">                     <sdk:DataGrIDTemplateColumn.CellTemplate>                         <DataTemplate>                             <GrID margin="0" VerticalAlignment="Stretch" HorizontalAlignment="Stretch">                                 <GrID.ColumnDeFinitions>                                     <ColumnDeFinition WIDth="*"/>                                     <ColumnDeFinition WIDth="1"/>                                     <ColumnDeFinition WIDth="*"/>                                 </GrID.ColumnDeFinitions>                                 <!--左边单光价-->                                 <TextBlock Text="{Binding Path=Model.SinglelightPrice,StringFormat='#,0.00'}" VerticalAlignment="Center" HorizontalAlignment="left" GrID.Column="0" margin="5,0"/>                                 <!--中间分割线-->                                 <Rectangle VerticalAlignment="Stretch" HorizontalAlignment="Stretch" GrID.Column="1" Fill="#FFC9CACA"/>                                 <!--右边散光价-->                                 <TextBlock Text="{Binding Path=Model.AstigmatismPrice,0.00'}" VerticalAlignment="Center" HorizontalAlignment="left" GrID.Column="2" margin="5,0"/>                             </GrID>                         </DataTemplate>                     </sdk:DataGrIDTemplateColumn.CellTemplate>                 </sdk:DataGrIDTemplateColumn>                 <!--优惠-->                 <sdk:DataGrIDTemplateColumn @R_419_5548@Style="{StaticResource Center@R_419_5548@Style}"  @R_419_5548@="优惠幅度" MinWIDth="60" WIDth="auto">                     <sdk:DataGrIDTemplateColumn.CellTemplate>                         <DataTemplate>                             <TextBlock Text="{Binding Path=Favorableshowtext}" VerticalAlignment="Center" margin="5,0"/>                         </DataTemplate>                     </sdk:DataGrIDTemplateColumn.CellTemplate>                     <sdk:DataGrIDTemplateColumn.CellEditingTemplate>                         <DataTemplate>                             <GrID>                                 <GrID.ColumnDeFinitions>                                     <ColumnDeFinition WIDth="*"/>                                     <ColumnDeFinition WIDth="*"/>                                 </GrID.ColumnDeFinitions>                                 <TextBox GrID.Column="0" WIDth="40" Text="{Binding Path=Favorable,Mode=TwoWay}" VerticalAlignment="Stretch" HorizontalAlignment="Stretch"/>                                 <ComboBox GrID.Column="1" SelectedValue="{Binding Path=SignID,Mode=TwoWay}" VerticalAlignment="Stretch" HorizontalAlignment="Stretch" DataContextChanged="ComboBox_DataContextChanged"/>                             </GrID>                         </DataTemplate>                     </sdk:DataGrIDTemplateColumn.CellEditingTemplate>                 </sdk:DataGrIDTemplateColumn>                 <!--改价后-->                 <sdk:DataGrIDTemplateColumn @R_419_5548@Style="{StaticResource DownleftRight@R_419_5548@Style}"  @R_419_5548@="优惠价" MinWIDth="120" WIDth="auto">                     <sdk:DataGrIDTemplateColumn.CellTemplate>                         <DataTemplate>                             <GrID>                                 <GrID.ColumnDeFinitions>                                     <ColumnDeFinition WIDth="*"/>                                     <ColumnDeFinition WIDth="1"/>                                     <ColumnDeFinition WIDth="*"/>                                 </GrID.ColumnDeFinitions>                                 <!--左边单光价-->                                 <TextBlock Text="{Binding Path=NewSinglelightPrice,0.00'}" VerticalAlignment="Center" GrID.Column="0" margin="5,0"/>                                 <!--中间分割线-->                                 <Rectangle VerticalAlignment="Stretch" HorizontalAlignment="Stretch" GrID.Column="1" Fill="#FFC9CACA"/>                                 <!--右边散光价-->                                 <TextBlock Text="{Binding Path=NewAstigmatismPrice,0.00'}" VerticalAlignment="Center" GrID.Column="2" margin="5,0"/>                             </GrID>                         </DataTemplate>                     </sdk:DataGrIDTemplateColumn.CellTemplate>                     <sdk:DataGrIDTemplateColumn.CellEditingTemplate>                         <DataTemplate>                             <GrID  margin="0" VerticalAlignment="Stretch" HorizontalAlignment="Stretch">                                 <GrID.ColumnDeFinitions>                                     <ColumnDeFinition WIDth="*"/>                                     <ColumnDeFinition WIDth="1"/>                                     <ColumnDeFinition WIDth="*"/>                                 </GrID.ColumnDeFinitions>                                 <!--左边单光-->                                 <TextBox Text="{Binding Path=NewSinglelightPrice,Mode=TwoWay}" VerticalAlignment="Stretch" HorizontalAlignment="Stretch" GrID.Column="0"/>                                 <!--中间分割线-->                                 <Rectangle VerticalAlignment="Stretch" HorizontalAlignment="Stretch" GrID.Column="1" Fill="#FFC9CACA"/>                                 <!--右边散光-->                                 <TextBox Text="{Binding Path=NewAstigmatismPrice,Mode=TwoWay}" VerticalAlignment="Center" GrID.Column="2"/>                             </GrID>                         </DataTemplate>                     </sdk:DataGrIDTemplateColumn.CellEditingTemplate>                 </sdk:DataGrIDTemplateColumn>             </sdk:DataGrID.Columns>         </sdk:DataGrID>

总结

以上是内存溢出为你收集整理的Silverlight DataGri列模版,行头图标模版,列头模版,多重表头,,编辑模版,样式全部内容,希望文章能够帮你解决Silverlight DataGri列模版,行头图标模版,列头模版,多重表头,,编辑模版,样式所遇到的程序开发问题。

如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。

欢迎分享,转载请注明来源:内存溢出

原文地址: http://outofmemory.cn/web/1019188.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2022-05-23
下一篇 2022-05-23

发表评论

登录后才能评论

评论列表(0条)

保存