반응형
1.그리드 내의 lookupedit
2.Resources를 활용한 lookupedit
3.comboboxedit



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 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 | < 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.Grid03EditGrid" mc:Ignorable = "d" d:DesignHeight = "700" d:DesignWidth = "1200" Title = "Grid01" > < Page.Resources > <!--#region lookup grid popup template--> < ControlTemplate x:Key = "cocktailNoGridTemplate" > < dxg:GridControl x:Name = "PART_GridControl" > < dxg:GridControl.Columns > < dxg:GridColumn FieldName = "CocktailNo" Header = "CocktailNo" /> < dxg:GridColumn FieldName = "CocktailNmKR" Header = "CocktailNmKR" /> < dxg:GridColumn FieldName = "CocktailNmEn" Header = "CocktailNmEn" /> < dxg:GridColumn FieldName = "CreateType" Header = "CreateType" /> < dxg:GridColumn FieldName = "Remark" Header = "Remark" /> < dxg:GridColumn FieldName = "CocktailURL" Header = "CocktailURL" /> < dxg:GridColumn FieldName = "CocktailScore" Header = "CocktailScore" /> < dxg:GridColumn FieldName = "Comment" Header = "Comment" /> </ dxg:GridControl.Columns > </ dxg:GridControl > </ ControlTemplate > <!--#endregion--> </ 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 AllowPerPixelScrolling = "True" ShowTotalSummary = "True" /> </ dxg:GridControl.View > < dxg:GridControl.Columns > < dxg:GridColumn FieldName = "CocktailNo" Header = "CocktailNoType1" Width = "110" > < dxg:GridColumn.HeaderTemplate > < DataTemplate > < TextBlock Text = "CocktailNoType1" FontWeight = "Bold" /> </ DataTemplate > </ dxg:GridColumn.HeaderTemplate > < dxg:GridColumn.EditSettings > < dxg:LookUpEditSettings x:Name = "lueCocktailNo" ValueMember = "CocktailNo" DisplayMember = "CocktailNmKR" AutoPopulateColumns = "false" IsTextEditable = "False" IsPopupAutoWidth = "True" AutoComplete = "True" ImmediatePopup = "True" ShowSizeGrip = "False" IncrementalFiltering = "True" PopupWidth = "500" > < dxg:LookUpEditSettings.PopupContentTemplate > < ControlTemplate > < dxg:GridControl x:Name = "PART_GridControl" > <!--PART_GridControl ????--> < dxg:GridControl.Columns > < dxg:GridColumn FieldName = "CocktailNo" Header = "CocktailNo" /> < dxg:GridColumn FieldName = "CocktailNmKR" Header = "CocktailNmKR" /> < dxg:GridColumn FieldName = "CocktailNmEn" Header = "CocktailNmEn" /> < dxg:GridColumn FieldName = "CreateType" Header = "CreateType" /> < dxg:GridColumn FieldName = "Remark" Header = "Remark" /> < dxg:GridColumn FieldName = "CocktailURL" Header = "CocktailURL" /> < dxg:GridColumn FieldName = "CocktailScore" Header = "CocktailScore" /> < dxg:GridColumn FieldName = "Comment" Header = "Comment" /> </ dxg:GridControl.Columns > </ dxg:GridControl > </ ControlTemplate > </ dxg:LookUpEditSettings.PopupContentTemplate > </ dxg:LookUpEditSettings > </ dxg:GridColumn.EditSettings > </ dxg:GridColumn > < dxg:GridColumn FieldName = "CocktailNoType2" Header = "CocktailNoType2" Width = "110" > < dxg:GridColumn.HeaderTemplate > < DataTemplate > < TextBlock Text = "CocktailNoType2" FontWeight = "Bold" /> </ DataTemplate > </ dxg:GridColumn.HeaderTemplate > < dxg:GridColumn.EditSettings > < dxg:LookUpEditSettings x:Name = "lueCocktailNoType2" ValueMember = "CocktailNo" DisplayMember = "CocktailNmKR" PopupContentTemplate = "{StaticResource cocktailNoGridTemplate}" AutoPopulateColumns = "false" IsTextEditable = "False" IsPopupAutoWidth = "True" AutoComplete = "True" ImmediatePopup = "True" ShowSizeGrip = "False" IncrementalFiltering = "True" PopupWidth = "500" /> </ dxg:GridColumn.EditSettings > </ dxg:GridColumn > < 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" ReadOnly = "false" > < dxg:GridColumn.EditSettings > < dxe:ComboBoxEditSettings x:Name = "cbeMaterialUnit" AutoComplete = "True" ImmediatePopup = "True" ValueMember = "Code" DisplayMember = "CodeName" /> </ dxg:GridColumn.EditSettings > </ dxg:GridColumn > < dxg:GridColumn FieldName = "Remark" Header = "Remark" Width = "100" /> < dxg:GridColumn FieldName = "UnitPrice" Header = "UnitPrice" Width = "100" ReadOnly = "false" > </ dxg:GridColumn > < 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 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 | 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 System.Data; using BIZ.Common.Dac; namespace WpfSample.DevTest { /// <summary> /// Grid03EditGrid.xaml에 대한 상호 작용 논리 /// </summary> public partial class Grid03EditGrid : Page { private DataSet data; public Grid03EditGrid() { InitializeComponent(); Dictionary< string , object > dic = new Dictionary< string , object >(); dic.Add( "param1" , 333); data = ( new ADOConnect()).GetDataSet( "Kaishaku" , "Z_UP_COCKTAIL_MATERIAL_LIST" , dic); cbeMaterialUnit.ItemsSource = data.Tables[1]; lueCocktailNo.ItemsSource = data.Tables[2]; lueCocktailNoType2.ItemsSource = data.Tables[2]; gcGrid.ItemsSource = data.Tables[0]; } private void Button_Click( object sender, RoutedEventArgs e) { //Dictionary<string, object> dic = new Dictionary<string, object>(); //dic.Add("param1", 333); //data = (new ADOConnect()).GetDataSet("Kaishaku", "Z_UP_COCKTAIL_MATERIAL_LIST", dic); //cbeMaterialUnit.ItemsSource = data.Tables[1]; //lueCocktailNo.ItemsSource = data.Tables[2]; //lueCocktailNoType2.ItemsSource = data.Tables[2]; //gcGrid.ItemsSource = data.Tables[0]; } } } |
LookUpEditSettings property
AutoPopulateColumns="false" //templeate 무시하고, 데이터에 따른 그리드생성.
반응형
'WPF - DevExpress' 카테고리의 다른 글
WPF & DevExpress GridControl Drag & Drop (4) | 2021.03.27 |
---|---|
WPF & DevExpress GridControl LookupEdit Dynamically change item source (6) | 2021.03.24 |
WPF & DevExpress GridControl Banded (4) | 2021.03.20 |
WPF & DevExpress GridControl Basic (6) | 2021.03.19 |
GridControl auto generate column (2) | 2021.03.18 |
댓글