private void btnGetDataType_Click(object sender, RoutedEventArgs e)
        {
            var inp_Dtt = new Inp_DataType(null, null);

            inp_Dtt.ShowDialog();
            var dataType = inp_Dtt.dataType;
            var indexRow = this.dtg.Items.IndexOf(this.dtg.CurrentItem);
            var indexCol = this.dtg.CurrentCell.Column.DisplayIndex;
            var row      = (DataGridRow)this.dtg.ItemContainerGenerator.ContainerFromIndex(indexRow);

            var cell = (SchemaModelView)row.Item;

            cell.datatype = dataType.DataType;

            attrs[indexRow]      = cell;
            this.dtg.ItemsSource = attrs;
        }
Example #2
0
        private void DataGridCell_MouseLeftButtonDown(object sender, MouseButtonEventArgs e)
        {
            var inp_Dtt = new Inp_DataType(null, null);

            inp_Dtt.ShowDialog();
            var dataType = inp_Dtt.dataType;

            var x        = this.dtg.SelectedItem;
            var indexRow = this.dtg.Items.IndexOf(this.dtg.SelectedItem);

            var obj = (SchemaModelView)this.dtg.SelectedItem;

            obj.datatype = dataType.DataType;
            obj.domain   = dataType.DomainString;
            obj.typeName = dataType.TypeName;

            attrs[indexRow]      = obj;
            this.dtg.ItemsSource = attrs;
            this.dtg.CommitEdit();

            this.dtg.Items.Refresh();
        }