Example #1
0
        public override FrameworkElement GetCellEditingContent(C1.WPF.DataGrid.DataGridRow row)
        {
            var numeric = (C1NumericBox)base.GetCellEditingContent(row);

            numeric.HandleUpDownKeys = false;
            return(numeric);
        }
Example #2
0
        public override void UnbindCellContent(FrameworkElement cellContent, C1.WPF.DataGrid.DataGridRow row)
        {
            Panel panel = (Panel)cellContent;

            // bind individual cells
            for (int i = 0; i < InnerColumns.Count; i++)
            {
                var col     = InnerColumns[i];
                var control = panel.Children[i] as FrameworkElement;
                col.UnbindCellContent(control, row);
            }
        }
Example #3
0
        public override FrameworkElement GetCellEditingContent(C1.WPF.DataGrid.DataGridRow row)
        {
            // initialize grid
            var panel = new Grid();

            foreach (var col in InnerColumns)
            {
                panel.ColumnDefinitions.Add(new ColumnDefinition()
                {
                    Width = new GridLength(col.Width.Value)
                });
            }

            // add individual content
            for (int i = 0; i < InnerColumns.Count; i++)
            {
                var col     = InnerColumns[i];
                var content = col.GetCellEditingContent(row);
                Grid.SetColumn(content, i);
                panel.Children.Add(content);
            }
            return(panel);
        }
Example #4
0
 public override object GetCellContentRecyclingKey(C1.WPF.DataGrid.DataGridRow row)
 {
     return(typeof(CompositeColumn));
 }
Example #5
0
        public override void BindCellContent(System.Windows.FrameworkElement cellContent, C1.WPF.DataGrid.DataGridRow row)
        {
            var maskedTextBox = (C1MaskedTextBox)cellContent;

            if (Binding == null)
            {
                maskedTextBox.ClearValue(C1MaskedTextBox.ValueProperty);
                return;
            }

            maskedTextBox.Mask                = Mask;
            maskedTextBox.TextMaskFormat      = TextMaskFormat;
            maskedTextBox.PromptChar          = ' ';
            maskedTextBox.TextWrapping        = TextWrapping;
            maskedTextBox.HorizontalAlignment = base.HorizontalAlignment;
            maskedTextBox.VerticalAlignment   = base.VerticalAlignment;
            maskedTextBox.BorderBrush         = null;
            maskedTextBox.Background          = Brushes.Transparent;
            if (FlowDirection != null)
            {
                maskedTextBox.FlowDirection = (FlowDirection)FlowDirection;
            }

            if (Binding != null)
            {
                Binding newBinding = CopyBinding(Binding);
                newBinding.Source = row.DataItem;
                newBinding.Mode   = BindingMode.OneWay;
                maskedTextBox.SetBinding(C1MaskedTextBox.ValueProperty, newBinding);
            }
        }
Example #6
0
 public override System.Windows.FrameworkElement CreateCellContent(C1.WPF.DataGrid.DataGridRow row)
 {
     return(new C1MaskedTextBox());
 }
Example #7
0
 public override object GetCellContentRecyclingKey(C1.WPF.DataGrid.DataGridRow row)
 {
     return(typeof(C1MaskedTextBox));
 }
 private static void UpdateRowVisibility(C1.WPF.DataGrid.DataGridRow row, Task task)
 {
     row.Visibility = task.IsVisible ? Visibility.Visible : Visibility.Collapsed;
 }
 public override object GetCellContentRecyclingKey(C1.WPF.DataGrid.DataGridRow row)
 {
     return(typeof(DataGridValueLablesCol));
 }