Пример #1
0
        private DataGridBoundColumn CreateDataGridBoundColumn(IDataGridColumnDescriptor descriptor)
        {
            DataGridBoundColumn column = null;
            
            if(descriptor is DataGridDisplayOnlyColumnDescriptor)
            {
                column = new DataGridTextColumn();
            }

            return column;
        }
Пример #2
0
        private DataGridBoundColumn CreateDataGridColumn(IDataGridColumnDescriptor descriptor)
        {
            var dataGridBoundColumn = CreateDataGridBoundColumn(descriptor);

            dataGridBoundColumn.Width = double.IsNaN(descriptor.Width)
                                            ? DataGridLength.SizeToHeader
                                            : new DataGridLength(descriptor.Width);
            dataGridBoundColumn.IsReadOnly = descriptor.IsReadOnly;

            dataGridBoundColumn.Header = descriptor.Header;

            var binding = new Binding(descriptor.PropertyName);

            dataGridBoundColumn.Binding = binding;

            return dataGridBoundColumn;
        }