
Untitled
By: a guest on
Jun 20th, 2012 | syntax:
None | size: 0.75 KB | hits: 11 | expires: Never
Dynamic Data binding in WPF Devx GridControl
public class Property : INotifyPropertyChanged
{
public Property(string name, object value)
{
Name = name;
Value = value;
}
public string Name { get; private set; }
public object Value { get; set; }
}
public class Record
{
private readonly ObservableCollection<Property> properties = new ObservableCollection<Property>();
public Record(params Property[] properties)
{
foreach (var property in properties)
Properties.Add(property);
}
public ObservableCollection<Property> Properties
{
get { return properties; }
}
}
<DataGrid
Name="dataGrid"
AutoGenerateColumns="false"
ItemsSource="{Binding Path=Records}"/>