Ejemplo n.º 1
0
                public ItemControl(int index, object item, bool singletonMode, int indexColumnWidth, object context,
                    PropertyGridView parentPropertyGridView)
                {
                    m_editControl = new PropertyGridView
                    {
                        ShowScrollbar = false,
                        PropertySorting = PropertySorting.None,
                        Dock = DockStyle.Fill,
                    };

                    m_parentPropertyGridView = parentPropertyGridView;
                    if (m_parentPropertyGridView != null)
                    {
                        m_editControl.CustomizeAttributes = m_parentPropertyGridView.CustomizeAttributes;
                        m_editControl.DescriptionSetter = parentPropertyGridView.DescriptionSetter;
                        m_parentPropertyGridView.SelectedPropertyChanged += ParentSelectedPropertyChanged;
                    }
                  
                    m_editControl.MouseUp += editControl_MouseUp;
                    Controls.Add(m_editControl);

                    Init(index, item, singletonMode, indexColumnWidth, context);

                    GotFocus += (sender, e) => m_editControl.Focus();
                    m_editControl.GotFocus += (sender, e) => UpdateSelection();

                    m_editControl.EditingContextUpdated += (sender, e) =>
                    {
                        Height = m_editControl.GetPreferredHeight();
                    };
                }