Created
September 25, 2013 08:22
-
-
Save ChrisWay/6696634 to your computer and use it in GitHub Desktop.
XamDataGrid issue
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.ComponentModel; | |
using System.Windows; | |
namespace DataGridTest | |
{ | |
public partial class MainWindow : Window | |
{ | |
public MainWindow() | |
{ | |
InitializeComponent(); | |
MyData = new BindingList<MyModel> | |
{ | |
new MyModel {Code = "T1", Description = "Test 1"}, | |
new MyModel {Code = "T2", Description = "Test 2"} | |
}; | |
MyData2 = new BindingList<MyModel> | |
{ | |
new MyModel {Code = "T1", Description = "Test 3"}, | |
new MyModel {Code = "T2", Description = "Test 4"} | |
}; | |
DataContext = this; | |
} | |
public BindingList<MyModel> MyData { get; set; } | |
public BindingList<MyModel> MyData2 { get; set; } | |
} | |
public class MyModel | |
{ | |
public string Code { get; set; } | |
public string Description { get; set; } | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<Window x:Class="DataGridTest.MainWindow" | |
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" | |
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" | |
xmlns:ig="http://infragistics.com/DataPresenter" | |
xmlns:igEditors="http://infragistics.com/Editors" | |
Title="MainWindow" Height="350" Width="525"> | |
<ig:XamDataGrid DataSource="{Binding MyData}" > | |
<ig:XamDataGrid.FieldLayoutSettings> | |
<ig:FieldLayoutSettings AllowAddNew="True" AutoGenerateFields="False" /> | |
</ig:XamDataGrid.FieldLayoutSettings> | |
<ig:XamDataGrid.FieldLayouts> | |
<ig:FieldLayout> | |
<ig:Field Name="Code"> | |
<ig:Field.Settings> | |
<ig:FieldSettings EditorType="{x:Type igEditors:XamComboEditor}"> | |
<ig:FieldSettings.EditorStyle> | |
<Style TargetType="{x:Type igEditors:XamComboEditor}"> | |
<Setter Property="ValuePath" Value="Code" /> | |
<Setter Property="DisplayMemberPath" Value="Description"/> | |
<Setter Property="ItemsSource" Value="{Binding RelativeSource={RelativeSource AncestorType=Window}, Path=MyData2}" /> | |
</Style> | |
</ig:FieldSettings.EditorStyle> | |
</ig:FieldSettings> | |
</ig:Field.Settings> | |
</ig:Field> | |
<ig:Field Name="Description"></ig:Field> | |
</ig:FieldLayout> | |
</ig:XamDataGrid.FieldLayouts> | |
</ig:XamDataGrid> | |
</Window> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment