2009-12-31 92 views

回答

1

是的,但你需要複製的控件模板的DataGridRowHeader控制,並將其放置在一個Style對象的資源: -

<UserControl.Resources> 
    <Style x:Key="CustomRowHeader" TargetType="DataGridRowHeader"> 
    <Setter Property="Template"> 
     <Setter.Value> 
      <ControlTemplate TargetType="localprimitives:DataGridRowHeader"> 
      <!-- Copy of the rest of the standard controls template --> 
      </ControlTemplate> 
     </Setter.Value> 
    </Setter> 
    </Style> 
<UserControl.Resources> 

<DataGrid RowHeaderStyle="{StaticResouce CustomRowHeader}" ... > 

現在你可以反覆折騰的顏色值和幾乎任何東西用於呈現行選擇器。

你可以用Blend很好地做到這一點,如果你有它熟悉使用它。我更喜歡從文檔中複製模板。見DataGrid Styles and Templates

0

沒有該行選擇的顏色,但它是完全可能的細分網格爲行/列,用矩形框+背景或東西填補他們像那樣。