private void CreateUnboundButton_Click(object sender, RoutedEventArgs e)
        {
            DataGridColumnTypeModel columnTypeModel = columnTypeComboBox.SelectedItem as DataGridColumnTypeModel;

            if (columnTypeModel == null)
            {
                throw new Exception("unexpected state");
            }

            // Set databinding related properties
            DataGridHelper.SparseSetValue(_dataGrid.Properties[DataGrid.AutoGenerateColumnsProperty], false);

            ModelItem dataGridColumn = columnTypeModel.CreateDataGridColumn(_context);

            _columns.Add(dataGridColumn);
        }
        /// <summary>
        ///     Edit the column associated with the button that was clicked.
        /// </summary>
        private void EditColumn_Click(object sender, RoutedEventArgs e)
        {
            ListBoxItem item = DataGridHelper.FindParent <ListBoxItem>((Button)sender);

            if (item != null)
            {
                ListBox listBox = DataGridHelper.FindParent <ListBox>(item);
                if (listBox != null)
                {
                    listBox.SelectedItems.Clear();
                }

                item.IsSelected = true;
                EditColumn();
            }
        }
 public override ModelItem CreateDataGridColumn(EditingContext context, PropertyDescriptor pd)
 {
     return(DataGridHelper.CreateBoundDataGridTemplateColumn(context, pd));
 }
 public override ModelItem CreateDataGridColumn(EditingContext context)
 {
     return(DataGridHelper.CreateUnboundDataGridTemplateColumn(context));
 }
 public virtual ModelItem CreateDataGridColumn(EditingContext context, PropertyDescriptor pd)
 {
     return(DataGridHelper.CreateDataGridColumn(context, ColumnType, pd));
 }
 public virtual ModelItem CreateDataGridColumn(EditingContext context)
 {
     return(DataGridHelper.CreateUnboundDataGridColumn(context, ColumnType));
 }