예제 #1
0
    /// <summary>
    /// Generates the editing element.
    /// </summary>
    /// <param name="cell">Cell for content</param>
    /// <param name="dataItem">Data item for binding</param>
    protected override FrameworkElement GenerateEditingElement(DataGridCell cell, object dataItem)
    {
      StackPanel panel = new StackPanel();
      panel.Orientation = Orientation.Horizontal;

      if (dataItem != null && Binding != null)
      {
        _editControl = CreateEditingElement();
        _editControl.SetBinding(EditingElementProperty, Binding);
        panel.Children.Add(_editControl);

        PropertyStatus status = new PropertyStatus();
        status.SetBinding(PropertyStatus.PropertyProperty, Binding);

        panel.Children.Add(status);
      }

      return panel;
    }
예제 #2
0
        /// <summary>
        /// Generates the display element.
        /// </summary>
        /// <param name="cell">Cell for content</param>
        /// <param name="dataItem">Data item for binding</param>
        protected override FrameworkElement GenerateElement(DataGridCell cell, object dataItem)
        {
            StackPanel panel = new StackPanel();

            panel.Orientation = Orientation.Horizontal;

            if (dataItem != null && Binding != null)
            {
                FrameworkElement element = CreateElement();
                element.SetBinding(ElementProperty, Binding);
                panel.Children.Add(element);

                PropertyStatus status = new PropertyStatus();
                status.SetBinding(PropertyStatus.PropertyProperty, Binding);

                panel.Children.Add(status);
            }

            return(panel);
        }