첨부 소스 코드는 나눔고딕코딩 폰트를 사용합니다.
728x90
반응형
728x170
<Window.Resources>
    <Style x:Key="CellStyleKey" TargetType="dxg:CellContentPresenter">
        <Style.Triggers>
            <Trigger
                Property="SelectionState"
                Value="Selected">
                <Setter Property="Background" Value="Red" />
            </Trigger>
            <Trigger
                Property="SelectionState"
                Value="Focused">
                <Setter Property="Background"           Value="Green" />
                <Setter Property="TextBlock.Foreground" Value="Pink"  />
            </Trigger>
            <Trigger
                Property="SelectionState"
                Value="FocusedAndSelected">
                <Setter Property="Background"           Value="Gray"  />
                <Setter Property="TextBlock.Foreground" Value="Black" />
            </Trigger>
        </Style.Triggers>
    </Style>
    <Style x:Key="FocusedRowStyle" TargetType="dxg:GridRowContent">
        <Style.Triggers>
            <Trigger
                Property="dxg:GridViewBase.IsFocusedRow"
                Value="True">
                <Setter Property="Background" Value="Gray"  />
                <Setter Property="Foreground" Value="White" />
            </Trigger>
        </Style.Triggers>
    </Style>
</Window.Resources>
<Grid>
    <dxg:GridControl x:Name="gridControl"
        AutoGenerateColumns="AddNew"
        SelectionMode="Cell">
        <dxg:GridControl.View>
            <dxg:TableView
                ShowGroupPanel="False"
                AllowGrouping="False"
                CellStyle="{StaticResource CellStyleKey}">
            </dxg:TableView>
        </dxg:GridControl.View>
    </dxg:GridControl>
</Grid>
728x90
반응형
그리드형(광고전용)
Posted by icodebroker

댓글을 달아 주세요