我正在尝试自定义DataGrid的列标题以显示子列标题,如以下屏幕截图所示:
alt text http://img297.imageshack.us/img297/464/columnheaders.gif
我为2个子列创建了一个样式,如下面的XAML所示:
<UserControl
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:data="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls.Data"
xmlns:primitives="clr-namespace:System.Windows.Controls.Primitives;assembly=System.Windows.Controls.Data"
xmlns:sl="clr-namespace:UI" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" x:Class="UI.ColumnHeaderGrid"
mc:Ignorable="d">
<UserControl.Resources>
<Style x:Key="SplitColumnHeaderStyle" TargetType="primitives:DataGridColumnHeader">
<Setter Property="Foreground" Value="#FF000000"/>
<Setter Property="HorizontalContentAlignment" Value="Center"/>
<Setter Property="VerticalContentAlignment" Value="Center"/>
<Setter Property="IsTabStop" Value="False"/>
<Setter Property="SeparatorBrush" Value="#FFC9CACA"/>
<Setter Property="Padding" Value="4"/>
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="primitives:DataGridColumnHeader">
<Grid x:Name="Root">
<Grid.ColumnDefinitions>
<ColumnDefinition/>
<ColumnDefinition Width="Auto"/>
</Grid.ColumnDefinitions>
<Rectangle x:Name="BackgroundRectangle" Fill="#FF1F3B53" Stretch="Fill" Grid.ColumnSpan="2"/>
<Rectangle x:Name="BackgroundGradient" Stretch="Fill" Grid.ColumnSpan="2">
<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>
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition/> …
Run Code Online (Sandbox Code Playgroud) 正如您可能已经知道的那样,默认情况下,git不会为新的裸存储库启用reflog更新.问题是,我有一个很长的历史存储库,但它是在我设置标志"logAllRefUpdates"之前创建的,现在我希望其他应用程序的信息能够正常工作.
如何通过对现有存储库进行的最小更改来实现这一目标.一个非常简单的解决方案是推送一个我不想要的新提交(!):-)
我有2张桌子:
CREATE TABLE plans
(id int, benefit varchar(5), clip_state int);
INSERT INTO plans
(id, benefit, clip_state)
VALUES
(1, 'A', 1),
(2, 'A', 0),
(3, 'B', 0),
(4, 'C', 0);
CREATE TABLE clip_states
(state varchar(2), clip_state int);
INSERT INTO clip_states
(state, clip_state)
VALUES
('LA', 1),
('FL', 0);
Run Code Online (Sandbox Code Playgroud)
请注意,它clip_state
是0或1,数据模型允许从2个信息中查询表中的一个或没有计划plans
:benefit
&state
.首先,使用benefit
条件下,我们可以在过滤plans
表至多为2行,一个具有clip_state
通过使用= 0,和一个= 1.然后state
,用联接clip_states
表,我们可以通过检查结果减小到一排(或零):
state
在clip_states
表中,请确保clip_state
在两个表之间匹配.如果不匹配,则不返回任何结果.state
不存在clip_states …
c# ×1
database ×1
git ×1
git-bare ×1
left-join ×1
postgresql ×1
reflog ×1
silverlight ×1
sql ×1