반응형
devexpress의 레퍼런스 참고해서 컬러를 넣을 때...
완전 비효율이다.
Winform의 RowStyle처럼 바꾸면 좋은데.. 그렇지 못하다. T T

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 | < Page xmlns = "http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x = "http://schemas.microsoft.com/winfx/2006/xaml" xmlns:mc = "http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:d = "http://schemas.microsoft.com/expression/blend/2008" xmlns:local = "clr-namespace:WpfSample.DevTest" xmlns:dxlc = "http://schemas.devexpress.com/winfx/2008/xaml/layoutcontrol" xmlns:dx = "http://schemas.devexpress.com/winfx/2008/xaml/core" xmlns:Serialization = "clr-namespace:DevExpress.Xpf.LayoutControl.Serialization;assembly=DevExpress.Xpf.LayoutControl.v17.2" xmlns:dxe = "http://schemas.devexpress.com/winfx/2008/xaml/editors" xmlns:dxg = "http://schemas.devexpress.com/winfx/2008/xaml/grid" x:Class = "WpfSample.DevTest.Grid08RowColor" mc:Ignorable = "d" d:DesignHeight = "700" d:DesignWidth = "1200" Title = "Grid01" > < Page.Resources > < dx:Format x:Key = "colorYellow" Background = "Yellow" Foreground = "Black" /> < dx:Format x:Key = "colorRed" Background = "Red" Foreground = "Black" /> </ Page.Resources > < StackPanel Margin = "0,10,10,10" > < dxlc:LayoutControl HorizontalAlignment = "Stretch" VerticalAlignment = "Stretch" Orientation = "Vertical" > < dxlc:LayoutGroup Header = "Button" View = "GroupBox" HorizontalAlignment = "Stretch" > < dx:SimpleButton x:Name = "btnSearch" Content = "Search" HorizontalAlignment = "Left" Click = "Button_Click" /> </ dxlc:LayoutGroup > </ dxlc:LayoutControl > < dxlc:LayoutControl HorizontalAlignment = "Stretch" VerticalAlignment = "Stretch" Orientation = "Vertical" > < dxlc:LayoutGroup Header = "Grid" View = "GroupBox" HorizontalAlignment = "Stretch" Height = "500" > < dxg:GridControl x:Name = "gcGrid" HorizontalAlignment = "Stretch" > < dxg:GridControl.View > < dxg:TableView x:Name = "view" > <!--#region Format conditions--> < dxg:TableView.FormatConditions > < dxg:FormatCondition FieldName = "CocktailNo" Expression = "[MaterialUnit]='060601'" Format = "{StaticResource colorYellow}" /> < dxg:FormatCondition FieldName = "CocktailNoType2" Expression = "[MaterialUnit]='060601'" Format = "{StaticResource colorYellow}" /> < dxg:FormatCondition FieldName = "CocktailMaterialNo" Expression = "[MaterialUnit]='060601'" Format = "{StaticResource colorYellow}" /> < dxg:FormatCondition FieldName = "MaterialCode" Expression = "[MaterialUnit]='060601'" Format = "{StaticResource colorYellow}" /> < dxg:FormatCondition FieldName = "MaterialName" Expression = "[MaterialUnit]='060601'" Format = "{StaticResource colorYellow}" /> < dxg:FormatCondition FieldName = "MaterialQuantity" Expression = "[MaterialUnit]='060601'" Format = "{StaticResource colorYellow}" /> < dxg:FormatCondition FieldName = "MaterialUnit" Expression = "[MaterialUnit]='060601'" Format = "{StaticResource colorYellow}" /> < dxg:FormatCondition FieldName = "Remark" Expression = "[MaterialUnit]='060601'" Format = "{StaticResource colorYellow}" /> < dxg:FormatCondition FieldName = "UnitPrice" Expression = "[MaterialUnit]='060601'" Format = "{StaticResource colorYellow}" /> < dxg:FormatCondition FieldName = "CreateUser" Expression = "[MaterialUnit]='060601'" Format = "{StaticResource colorYellow}" /> < dxg:FormatCondition FieldName = "CreateDate" Expression = "[MaterialUnit]='060601'" Format = "{StaticResource colorYellow}" /> < dxg:FormatCondition FieldName = "UpdateUser" Expression = "[MaterialUnit]='060601'" Format = "{StaticResource colorYellow}" /> < dxg:FormatCondition FieldName = "UpdateDate" Expression = "[MaterialUnit]='060601'" Format = "{StaticResource colorYellow}" /> < dxg:FormatCondition FieldName = "CocktailNo" Expression = "[MaterialUnit]='060602'" Format = "{StaticResource colorRed}" /> < dxg:FormatCondition FieldName = "CocktailNoType2" Expression = "[MaterialUnit]='060602'" Format = "{StaticResource colorRed}" /> < dxg:FormatCondition FieldName = "CocktailMaterialNo" Expression = "[MaterialUnit]='060602'" Format = "{StaticResource colorRed}" /> < dxg:FormatCondition FieldName = "MaterialCode" Expression = "[MaterialUnit]='060602'" Format = "{StaticResource colorRed}" /> < dxg:FormatCondition FieldName = "MaterialName" Expression = "[MaterialUnit]='060602'" Format = "{StaticResource colorRed}" /> < dxg:FormatCondition FieldName = "MaterialQuantity" Expression = "[MaterialUnit]='060602'" Format = "{StaticResource colorRed}" /> < dxg:FormatCondition FieldName = "MaterialUnit" Expression = "[MaterialUnit]='060602'" Format = "{StaticResource colorRed}" /> < dxg:FormatCondition FieldName = "Remark" Expression = "[MaterialUnit]='060602'" Format = "{StaticResource colorRed}" /> < dxg:FormatCondition FieldName = "UnitPrice" Expression = "[MaterialUnit]='060602'" Format = "{StaticResource colorRed}" /> < dxg:FormatCondition FieldName = "CreateUser" Expression = "[MaterialUnit]='060602'" Format = "{StaticResource colorRed}" /> < dxg:FormatCondition FieldName = "CreateDate" Expression = "[MaterialUnit]='060602'" Format = "{StaticResource colorRed}" /> < dxg:FormatCondition FieldName = "UpdateUser" Expression = "[MaterialUnit]='060602'" Format = "{StaticResource colorRed}" /> < dxg:FormatCondition FieldName = "UpdateDate" Expression = "[MaterialUnit]='060602'" Format = "{StaticResource colorRed}" /> </ dxg:TableView.FormatConditions > <!--#endregion--> </ dxg:TableView > </ dxg:GridControl.View > < dxg:GridControl.Columns > < dxg:GridColumn FieldName = "CocktailNo" Header = "CocktailNoType1" Width = "110" /> < dxg:GridColumn FieldName = "CocktailNoType2" Header = "CocktailNoType2" Width = "110" /> < dxg:GridColumn FieldName = "CocktailMaterialNo" Header = "CocktailMaterialNo" Width = "100" /> < dxg:GridColumn FieldName = "MaterialCode" Header = "MaterialCode" Width = "100" /> < dxg:GridColumn FieldName = "MaterialName" Header = "MaterialName" Width = "100" /> < dxg:GridColumn FieldName = "MaterialQuantity" Header = "MaterialQuantity" Width = "100" /> < dxg:GridColumn FieldName = "MaterialUnit" Header = "MaterialUnit" Width = "100" /> < dxg:GridColumn FieldName = "Remark" Header = "Remark" Width = "100" /> < dxg:GridColumn FieldName = "UnitPrice" Header = "UnitPrice" Width = "100" /> < dxg:GridColumn FieldName = "CreateUser" Header = "CreateUser" Width = "100" /> < dxg:GridColumn FieldName = "CreateDate" Header = "CreateDate" Width = "100" /> < dxg:GridColumn FieldName = "UpdateUser" Header = "UpdateUser" Width = "100" /> < dxg:GridColumn FieldName = "UpdateDate" Header = "UpdateDate" Width = "100" /> </ dxg:GridControl.Columns > </ dxg:GridControl > </ dxlc:LayoutGroup > </ dxlc:LayoutControl > </ StackPanel > </ Page > |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 | using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using System.Windows; using System.Windows.Controls; using System.Windows.Data; using System.Windows.Documents; using System.Windows.Input; using System.Windows.Media; using System.Windows.Media.Imaging; using System.Windows.Navigation; using System.Windows.Shapes; using BIZ.Common.Dac; namespace WpfSample.DevTest { /// <summary> /// Grid08RowColor.xaml에 대한 상호 작용 논리 /// </summary> public partial class Grid08RowColor : Page { public Grid08RowColor() { InitializeComponent(); GetBindGrid(); } private void GetBindGrid() { Dictionary< string , object > dic = new Dictionary< string , object >(); dic.Add( "param1" , 333); var data = ( new ADOConnect()).GetDataSet( "Kaishaku" , "Z_UP_COCKTAIL_MATERIAL_LIST" , dic); gcGrid.ItemsSource = data.Tables[0]; } private void Button_Click( object sender, RoutedEventArgs e) { GetBindGrid(); } } } |
다음 게시물은 동적으로 코드로 row color를 변경하겠다.
이건 비교차원에서 올린 것이다. 이렇게하면... 미친놈 소리 들을 듯...
반응형
'WPF - DevExpress' 카테고리의 다른 글
WPF & DevExpress GridControl Move to next cell (6) | 2021.04.01 |
---|---|
WPF & DevExpress GridControl RowColor #2 dynamic (4) | 2021.03.30 |
WPF & DevExpress GridControl Cell Merge (2) | 2021.03.29 |
WPF & DevExpress GridControl Summary (3) | 2021.03.28 |
WPF & DevExpress GridControl Drag & Drop (4) | 2021.03.27 |
댓글