文章分類/

Infragistics|Ultimate UI IgniteUI|利用 XamDataGrid 去設定 Row 欄位的style

1 次瀏覽
2023-02-20 更新

infragistics log


使用XamDataGrid時,預設對各種狀態(例如選定行、active行和hover行等)設定藍色為底色的執行。通常我們都會希望能根據不同情況去變動這些「行」欄位的style,因此本次教學將介紹如何各別更改每個「行」的style。


執行方法


XamDataGrid的「行」style可以在DataRecordPresenter的class裡設定。XamDataGrid各元素的配置請參考 ”關於xamDataGrid”文章。為DataRecordPresenter創立style。將Setter的值綁定為在ComboBox中選擇的顏色。有關的執行細節,請參閱範例檔。

<Style TargetType="{x:Type igDP:DataRecordCellArea}">
<Setter Property="BackgroundActive"
Value="{Binding ElementName=BackgroundActive_Color, Path=SelectedItem}"/>
<Setter Property="BackgroundSelected"
Value="{Binding ElementName=BackgroundSelected_Color, Path=SelectedItem}"/>
<Setter Property="BackgroundHover"
Value="{Binding ElementName=BackgroundHover_Color, Path=SelectedItem}"/>
<Setter Property="BorderActiveBrush"
Value="{Binding ElementName=BorderActiveBrush_Color, Path=SelectedItem}"/>
<Setter Property="BorderHoverBrush"
Value="{Binding ElementName=BorderHoverBrush_Color, Path=SelectedItem}"/>
<Setter Property="BorderSelectedBrush"
Value="{Binding ElementName=BorderSelectedBrush_Color, Path=SelectedItem}"/>
</Style>


執行結果

請從螢幕畫面右側的組合框中選擇顏色資訊。如果要禁用「行」的style,請在所有組合框中選擇白色 (#FFFFFFFF)。


網路資源:

更改record的hover顏色

http://jp.infragistics.com/help/wpf/xamdata-changing-the-record-hover-color


xamDataGrid、xamDataCarousel以及xamDataPresenter的styling point

http://jp.infragistics.com/help/wpf/wpf-working-with-xamdatagrid-xamdatacarousel-and-xamdatapresenter-styling-points XamDataGrid_Record_Style  (下載)


快速跳轉目錄

✦ 群昱 AccessSoft 你的全面軟體解決方案 ✦

身為全球眾多知名軟體在台灣合作夥伴,歡迎諮詢你需要的軟體服務!

Picture of 軟體專家
軟體專家

群昱作為全球知名軟體推薦合作夥伴,致力於提供更多軟體解決方案給你!

更多軟體新知

立即詢價

請留下完整資訊,以便我們提供精確的服務內容給你。

詢價資訊