System.Windows.Forms.CurrencyManager.GetItemProperties()

Here are the examples of the csharp api class System.Windows.Forms.CurrencyManager.GetItemProperties() taken from open source projects. By voting up you can indicate which examples are most useful and appropriate.

33 Examples 7

1. Example

Project: MvvmFx
Source File: BoundTreeView.cs
private bool PrepareDescriptors()
        {
            if (_listManager.GetItemProperties().Count > 0 && _identifierMember.Length != 0 &&
                _displayMember.Length != 0 && _parentIdentifierMember.Length != 0)
            {
                if (_identifierProperty == null)
                    _identifierProperty = _listManager.GetItemProperties()[_identifierMember];

                if (_displayProperty == null)
                    _displayProperty = _listManager.GetItemProperties()[_displayMember];

                if (_parentIdentifierProperty == null)
                    _parentIdentifierProperty = _listManager.GetItemProperties()[_parentIdentifierMember];

                if (_readOnlyMember != null && _readOnlyProperty == null)
                    _readOnlyProperty = _listManager.GetItemProperties()[_readOnlyMember];

                if (_toolTipTextMember != null && _toolTipTextProperty == null)
                {
                    _toolTipTextProperty = _listManager.GetItemProperties()[_toolTipTextMember];

                    if (_toolTipTextProperty != null)
                        ShowNodeToolTips = true;
                }
            }

            return (_identifierProperty != null && _displayProperty != null && _parentIdentifierProperty != null);
        }

2. Example

Project: MvvmFx
Source File: BoundTreeView.cs
private bool PrepareValueDescriptor()
        {
            if (_valueProperty == null)
            {
                if (_valueMember == string.Empty)
                    _valueMember = _identifierMember;

                _valueProperty = _listManager.GetItemProperties()[_valueMember];
            }

            return (_valueProperty != null);
        }

3. Example

Project: MvvmFx
Source File: BoundTreeView.cs
private bool PrepareDescriptors()
        {
            if (_listManager.GetItemProperties().Count > 0 && _identifierMember.Length != 0 &&
                _displayMember.Length != 0 && _parentIdentifierMember.Length != 0)
            {
                if (_identifierProperty == null)
                    _identifierProperty = _listManager.GetItemProperties()[_identifierMember];

                if (_displayProperty == null)
                    _displayProperty = _listManager.GetItemProperties()[_displayMember];

                if (_parentIdentifierProperty == null)
                    _parentIdentifierProperty = _listManager.GetItemProperties()[_parentIdentifierMember];

                if (_readOnlyMember != null && _readOnlyProperty == null)
                    _readOnlyProperty = _listManager.GetItemProperties()[_readOnlyMember];

                if (_toolTipTextMember != null && _toolTipTextProperty == null)
                {
                    _toolTipTextProperty = _listManager.GetItemProperties()[_toolTipTextMember];

                    if (_toolTipTextProperty != null)
                        ShowNodeToolTips = true;
                }
            }

            return (_identifierProperty != null && _displayProperty != null && _parentIdentifierProperty != null);
        }

4. Example

Project: MvvmFx
Source File: BoundTreeView.cs
private bool PrepareValueDescriptor()
        {
            if (_valueProperty == null)
            {
                if (_valueMember == string.Empty)
                    _valueMember = _identifierMember;

                _valueProperty = _listManager.GetItemProperties()[_valueMember];
            }

            return (_valueProperty != null);
        }

5. Example

Project: MvvmFx
Source File: BoundTreeView.cs
private bool PrepareDescriptors()
        {
            if (_listManager.GetItemProperties().Count > 0 && _identifierMember.Length != 0 &&
                _displayMember.Length != 0 && _parentIdentifierMember.Length != 0)
            {
                if (_identifierProperty == null)
                    _identifierProperty = _listManager.GetItemProperties()[_identifierMember];

                if (_displayProperty == null)
                    _displayProperty = _listManager.GetItemProperties()[_displayMember];

                if (_parentIdentifierProperty == null)
                    _parentIdentifierProperty = _listManager.GetItemProperties()[_parentIdentifierMember];

                if (_readOnlyMember != null && _readOnlyProperty == null)
                    _readOnlyProperty = _listManager.GetItemProperties()[_readOnlyMember];

                if (_toolTipTextMember != null && _toolTipTextProperty == null)
                {
                    _toolTipTextProperty = _listManager.GetItemProperties()[_toolTipTextMember];

                    if (_toolTipTextProperty != null)
                        ShowNodeToolTips = true;
                }
            }

            return (_identifierProperty != null && _displayProperty != null && _parentIdentifierProperty != null);
        }

6. Example

Project: MvvmFx
Source File: BoundTreeView.cs
private bool PrepareValueDescriptor()
        {
            if (_valueProperty == null)
            {
                if (_valueMember == string.Empty)
                    _valueMember = _identifierMember;

                _valueProperty = _listManager.GetItemProperties()[_valueMember];
            }

            return (_valueProperty != null);
        }

7. Example

Project: MvvmFx
Source File: BoundTreeView.cs
private bool PrepareDescriptors()
        {
            if (_listManager.GetItemProperties().Count > 0 && _identifierMember.Length != 0 &&
                _displayMember.Length != 0 && _parentIdentifierMember.Length != 0)
            {
                if (_identifierProperty == null)
                    _identifierProperty = _listManager.GetItemProperties()[_identifierMember];

                if (_displayProperty == null)
                    _displayProperty = _listManager.GetItemProperties()[_displayMember];

                if (_parentIdentifierProperty == null)
                    _parentIdentifierProperty = _listManager.GetItemProperties()[_parentIdentifierMember];

                if (_readOnlyMember != null && _readOnlyProperty == null)
                    _readOnlyProperty = _listManager.GetItemProperties()[_readOnlyMember];

                if (_toolTipTextMember != null && _toolTipTextProperty == null)
                {
                    _toolTipTextProperty = _listManager.GetItemProperties()[_toolTipTextMember];

                    if (_toolTipTextProperty != null)
                        ShowNodeToolTips = true;
                }
            }

            return (_identifierProperty != null && _displayProperty != null && _parentIdentifierProperty != null);
        }

8. Example

Project: MvvmFx
Source File: BoundTreeView.cs
private bool PrepareValueDescriptor()
        {
            if (_valueProperty == null)
            {
                if (_valueMember == string.Empty)
                    _valueMember = _identifierMember;

                _valueProperty = _listManager.GetItemProperties()[_valueMember];
            }

            return (_valueProperty != null);
        }

9. Example

Project: MvvmFx
Source File: BoundListView.cs
private void CalculateColumns()
        {
            if (_listManager == null)
                return;

            if (Columns.Count == 0)
            {
                foreach (PropertyDescriptor prop in _listManager.GetItemProperties())
                {
                    var column = new ColumnHeader {Text = prop.Name, Name = prop.Name};
                    Columns.Add(column);
                }
            }
        }

10. Example

Project: MvvmFx
Source File: BoundListView.cs
private void CalculateColumns()
        {
            if (_listManager == null)
                return;

            if (Columns.Count == 0)
            {
                foreach (PropertyDescriptor prop in _listManager.GetItemProperties())
                {
                    var column = new ColumnHeader {Text = prop.Name, Name = prop.Name};
                    Columns.Add(column);
                }
            }
        }

11. Example

Project: MvvmFx
Source File: BoundListView.cs
private void CalculateColumns()
        {
            if (_listManager == null)
                return;

            if (Columns.Count == 0)
            {
                foreach (PropertyDescriptor prop in _listManager.GetItemProperties())
                {
                    var column = new ColumnHeader {Text = prop.Name, Name = prop.Name};
                    Columns.Add(column);
                }
            }
        }

12. Example

Project: MvvmFx
Source File: BoundListView.cs
private void CalculateColumns()
        {
            if (_listManager == null)
                return;

            if (Columns.Count == 0)
            {
                foreach (PropertyDescriptor prop in _listManager.GetItemProperties())
                {
                    var column = new ColumnHeader {Text = prop.Name, Name = prop.Name};
                    Columns.Add(column);
                }
            }
        }

13. Example

Project: logwizard
Source File: DataSourceAdapter.cs
protected virtual void CreateColumnsFromSource() {
            if (this.CurrencyManager == null)
                return;

            // Don't generate any columns in design mode. If we do, the user will see them,
            // but the Designer won't know about them and won't persist them, which is very confusing
            if (this.ListView.IsDesignMode)
                return;

            // Don't create columns if we've been told not to
            if (!this.AutoGenerateColumns)
                return;

            // Use a Generator to create columns
            Generator generator = Generator.Instance as Generator ?? new Generator();

            PropertyDescriptorCollection properties = this.CurrencyManager.GetItemProperties();
            if (properties.Count == 0)
                return;

            foreach (PropertyDescriptor property in properties) {

                if (!this.ShouldCreateColumn(property))
                    continue;

                // Create a column
                OLVColumn column = generator.MakeColumnFromPropertyDescriptor(property);
                this.ConfigureColumn(column, property);

                // Add it to our list
                this.ListView.AllColumns.Add(column);
            }

            generator.PostCreateColumns(this.ListView);
        }

14. Example

Project: Bulk-Crap-Uninstaller
Source File: DataSourceAdapter.cs
protected virtual void CreateColumnsFromSource() {
            if (this.CurrencyManager == null)
                return;

            // Don't generate any columns in design mode. If we do, the user will see them,
            // but the Designer won't know about them and won't persist them, which is very confusing
            if (this.ListView.IsDesignMode)
                return;

            // Don't create columns if we've been told not to
            if (!this.AutoGenerateColumns)
                return;

            // Use a Generator to create columns
            Generator generator = Generator.Instance as Generator ?? new Generator();

            PropertyDescriptorCollection properties = this.CurrencyManager.GetItemProperties();
            if (properties.Count == 0)
                return;

            bool wereColumnsAdded = false;
            foreach (PropertyDescriptor property in properties) {

                if (!this.ShouldCreateColumn(property))
                    continue;

                // Create a column
                OLVColumn column = generator.MakeColumnFromPropertyDescriptor(property);
                this.ConfigureColumn(column, property);

                // Add it to our list
                this.ListView.AllColumns.Add(column);
                wereColumnsAdded = true;
            }

            if (wereColumnsAdded)
                generator.PostCreateColumns(this.ListView);
        }

15. Example

Project: SquareOne
Source File: DataSourceAdapter.cs
protected virtual void CreateColumnsFromSource() {
            if (this.CurrencyManager == null)
                return;

            // Don't generate any columns in design mode. If we do, the user will see them,
            // but the Designer won't know about them and won't persist them, which is very confusing
            if (this.ListView.IsDesignMode)
                return;

            // Don't create columns if we've been told not to
            if (!this.AutoGenerateColumns)
                return;

            // Use a Generator to create columns
            Generator generator = Generator.Instance as Generator ?? new Generator();

            PropertyDescriptorCollection properties = this.CurrencyManager.GetItemProperties();
            if (properties.Count == 0)
                return;

            foreach (PropertyDescriptor property in properties) {

                if (!this.ShouldCreateColumn(property))
                    continue;

                // Create a column
                OLVColumn column = generator.MakeColumnFromPropertyDescriptor(property);
                this.ConfigureColumn(column, property);

                // Add it to our list
                this.ListView.AllColumns.Add(column);
            }

            generator.PostCreateColumns(this.ListView);
        }

16. Example

Project: tesvsnip
Source File: DataSourceAdapter.cs
protected virtual void CreateColumnsFromSource()
        {
            if (CurrencyManager == null |/n ..... /n //View Source file for more details /n }

17. Example

Project: falloutsnip
Source File: DataSourceAdapter.cs
protected virtual void CreateColumnsFromSource()
        {
            if (CurrencyManager == null |/n ..... /n //View Source file for more details /n }

18. Example

Project: MvvmFx
Source File: FieldTypeEditor.cs
protected override void FillListBox(ListBox listBox, ITypeDescriptorContext context, object value)
        {
            var selectedField = (string) value;
            if (selectedField == null)
                selectedField = string.Empty;

            var dataSourceDescriptor = TypeDescriptor.GetProperties(context.Instance)["DataSource"];
            if (dataSourceDescriptor == null)
            {
                return;
            }
            var dataSource = dataSourceDescriptor.GetValue(context.Instance);
            if (dataSource != null)
            {
                var currencyManager = new BindingContext()[dataSource] as CurrencyManager;
                if (currencyManager != null)
                {
                    foreach (PropertyDescriptor descriptor in currencyManager.GetItemProperties())
                    {
                        int lastIndex = listBox.Items.Add(descriptor.Name);
                        if (string.Compare(descriptor.Name, selectedField) == 0)
                        {
                            listBox.SelectedIndex = lastIndex;
                        }
                    }
                }
            }
        }

19. Example

Project: MvvmFx
Source File: FieldTypeEditor.cs
protected override void FillListBox(ListBox listBox, ITypeDescriptorContext context, object value)
        {
            var selectedField = (string) value;
            if (selectedField == null)
                selectedField = string.Empty;

            var dataSourceDescriptor = TypeDescriptor.GetProperties(context.Instance)["DataSource"];
            if (dataSourceDescriptor == null)
            {
                return;
            }
            var dataSource = dataSourceDescriptor.GetValue(context.Instance);
            if (dataSource != null)
            {
                var currencyManager = new BindingContext()[dataSource] as CurrencyManager;
                if (currencyManager != null)
                {
                    foreach (PropertyDescriptor descriptor in currencyManager.GetItemProperties())
                    {
                        int lastIndex = listBox.Items.Add(descriptor.Name);
                        if (string.Compare(descriptor.Name, selectedField) == 0)
                        {
                            listBox.SelectedIndex = lastIndex;
                        }
                    }
                }
            }
        }

20. Example

Project: MvvmFx
Source File: FieldTypeEditor.cs
protected override void FillListBox(ListBox listBox, ITypeDescriptorContext context, object value)
        {
            var selectedField = (string) value;
            if (selectedField == null)
                selectedField = string.Empty;

            var dataSourceDescriptor = TypeDescriptor.GetProperties(context.Instance)["DataSource"];
            if (dataSourceDescriptor == null)
            {
                return;
            }
            var dataSource = dataSourceDescriptor.GetValue(context.Instance);
            if (dataSource != null)
            {
                var currencyManager = new BindingContext()[dataSource] as CurrencyManager;
                if (currencyManager != null)
                {
                    foreach (PropertyDescriptor descriptor in currencyManager.GetItemProperties())
                    {
                        int lastIndex = listBox.Items.Add(descriptor.Name);
                        if (string.Compare(descriptor.Name, selectedField) == 0)
                        {
                            listBox.SelectedIndex = lastIndex;
                        }
                    }
                }
            }
        }

21. Example

Project: MvvmFx
Source File: FieldTypeEditor.cs
protected override void FillListBox(ListBox listBox, ITypeDescriptorContext context, object value)
        {
            var selectedField = (string) value;
            if (selectedField == null)
                selectedField = string.Empty;

            var dataSourceDescriptor = TypeDescriptor.GetProperties(context.Instance)["DataSource"];
            if (dataSourceDescriptor == null)
            {
                return;
            }
            var dataSource = dataSourceDescriptor.GetValue(context.Instance);
            if (dataSource != null)
            {
                var currencyManager = new BindingContext()[dataSource] as CurrencyManager;
                if (currencyManager != null)
                {
                    foreach (PropertyDescriptor descriptor in currencyManager.GetItemProperties())
                    {
                        int lastIndex = listBox.Items.Add(descriptor.Name);
                        if (string.Compare(descriptor.Name, selectedField) == 0)
                        {
                            listBox.SelectedIndex = lastIndex;
                        }
                    }
                }
            }
        }

22. Example

Project: ATF
Source File: DataBoundListView.cs
private void BuildListColumns()
        {
            // remember column widths
            Dictionary<string, int> columnWidths = new Dictionary<string, int>();
            foreach (ColumnHeader column in Columns)
                columnWidths[column.Text] = column.Width;

            Columns.Clear();
            if (m_currencyManager == null)
                return;

            m_adjustingColumnWidths = true;

            m_propertyDescriptors = m_currencyManager.GetItemProperties();
            foreach (PropertyDescriptor pd in m_propertyDescriptors)
            {
                ColumnHeader column = new ColumnHeader();
                column.Name = pd.Name;
                column.Text = pd.DisplayName;
                if (columnWidths.ContainsKey(column.Text))
                    column.Width = columnWidths[column.Text];
                Columns.Add(column);
            }

            if (AutoSize)
                ResizeToContent();
            m_adjustingColumnWidths = false;
        }

23. Example

Project: spartacus-csharp
Source File: Spartacus.ThirdParty.MultiColumnCombobox.cs
private void InitializeColumns()
        {
            if (!Convert.ToBoolean(_ColumnNameString.Leng/n ..... /n //View Source file for more details /n }

24. Example

Project: MapViewer
Source File: DataSourceAdapter.cs
protected virtual void CreateColumnsFromSource() {
            if (this.CurrencyManager == null)
                return;

            // Don't generate any columns in design mode. If we do, the user will see them,
            // but the Designer won't know about them and won't persist them, which is very confusing
            if (this.ListView.IsDesignMode)
                return;

            // Don't create columns if we've been told not to
            if (!this.AutoGenerateColumns)
                return;

            // Use a Generator to create columns
            Generator generator = Generator.Instance as Generator ?? new Generator();

            PropertyDescriptorCollection properties = this.CurrencyManager.GetItemProperties();
            if (properties.Count == 0)
                return;

            bool wereColumnsAdded = false;
            foreach (PropertyDescriptor property in properties) {

                if (!this.ShouldCreateColumn(property))
                    continue;

                // Create a column
                OLVColumn column = generator.MakeColumnFromPropertyDescriptor(property);
                this.ConfigureColumn(column, property);

                // Add it to our list
                this.ListView.AllColumns.Add(column);
                wereColumnsAdded = true;
            }

            if (wereColumnsAdded)
                generator.PostCreateColumns(this.ListView);
        }

25. Example

Project: MvvmFx
Source File: BoundListView.cs
private ListViewItem GetListViewItem(int index)
        {
            var row = _listManager.List[index];
            var propColl = _listManager.GetItemProperties();
            var items = new ArrayList();

            // Fill value for each column
            foreach (ColumnHeader column in Columns)
            {
                var prop = propColl.Find(column.Name, false);
                if (prop != null)
                {
                    var value = prop.GetValue(row);
                    if (value != null)
                        items.Add(value.ToString());
                    else
                        items.Add(string.Empty);
                }
            }
            var item = new ListViewItem((string[]) items.ToArray(typeof (string)));
            item.Tag = row;
            return item;
        }

26. Example

Project: MvvmFx
Source File: BoundListView.cs
private ListViewItem GetListViewItem(int index)
        {
            var row = _listManager.List[index];
            var propColl = _listManager.GetItemProperties();
            var items = new ArrayList();

            // Fill value for each column
            foreach (ColumnHeader column in Columns)
            {
                var prop = propColl.Find(column.Name, false);
                if (prop != null)
                {
                    var value = prop.GetValue(row);
                    if (value != null)
                        items.Add(value.ToString());
                    else
                        items.Add(string.Empty);
                }
            }
            var item = new ListViewItem((string[]) items.ToArray(typeof (string)));
            item.Tag = row;
            return item;
        }

27. Example

Project: MvvmFx
Source File: BoundListView.cs
private ListViewItem GetListViewItem(int index)
        {
            var row = _listManager.List[index];
            var propColl = _listManager.GetItemProperties();
            var items = new ArrayList();

            // Fill value for each column
            foreach (ColumnHeader column in Columns)
            {
                var prop = propColl.Find(column.Name, false);
                if (prop != null)
                {
                    var value = prop.GetValue(row);
                    if (value != null)
                        items.Add(value.ToString());
                    else
                        items.Add(string.Empty);
                }
            }
            var item = new ListViewItem((string[]) items.ToArray(typeof (string)));
            item.Tag = row;
            return item;
        }

28. Example

Project: MvvmFx
Source File: BoundListView.cs
private ListViewItem GetListViewItem(int index)
        {
            var row = _listManager.List[index];
            var propColl = _listManager.GetItemProperties();
            var items = new ArrayList();

            // Fill value for each column
            foreach (ColumnHeader column in Columns)
            {
                var prop = propColl.Find(column.Name, false);
                if (prop != null)
                {
                    var value = prop.GetValue(row);
                    if (value != null)
                        items.Add(value.ToString());
                    else
                        items.Add(string.Empty);
                }
            }
            var item = new ListViewItem((string[]) items.ToArray(typeof (string)));
            item.Tag = row;
            return item;
        }

29. Example

Project: ATF
Source File: DataBoundListView.cs
private ListViewItem ListViewItemFromDataSource(int index)
        {
            PropertyDescriptorCollection pds = m_currencyManager.GetItemProperties();
            ArrayList items = new ArrayList();
            object dataItem = m_currencyManager.List[index];      

            foreach (ColumnHeader column in Columns)
            {
                //PropertyDescriptor pd = pds.Find(column.Text, false);
                PropertyDescriptor pd = null;
                foreach (PropertyDescriptor member in pds)
                {
                    if (member.DisplayName == column.Text)
                    {
                        pd = member;
                        break;
                    }
                }
                if (pd != null)
                {
                    items.Add(pd.GetValue(dataItem).ToString());
                }
            }
            return new ListViewItem((string[])items.ToArray(typeof(string)), GroupingDataItem(dataItem));
        }

30. Example

Project: MvvmFx
Source File: BoundListView.cs
protected override void OnAfterLabelEdit(LabelEditEventArgs e)
        {
            if (e.Label == null)
            {
                // If you press ESC while editing.
                e.CancelEdit = true;
                return;
            }

#if WINFORMS
            var index = e.Item;
#else
            var index = e.Item.Index;
#endif

            if (_listManager.List.Count > index)
            {
                var row = _listManager.List[index];
                // In a ListView you are only able to edit the first Column.
                var col = _listManager.GetItemProperties().Find(Columns[0].Text, false);
                try
                {
                    if (row != null && col != null)
                        col.SetValue(row, e.Label);
                    _listManager.EndCurrentEdit();
                    base.OnAfterLabelEdit(e);
                }
                catch (Exception ex)
                {
                    // If you try to enter strings in number-columns, too long strings or something
                    // else wich is not allowed by the DataSource.
                    MessageBox.Show(Resources.EditFailed + ": " + ex.Message, Resources.EditFailed, MessageBoxButtons.OK, MessageBoxIcon.Error);
                    _listManager.CancelCurrentEdit();
                    e.CancelEdit = true;
                }
            }
        }

31. Example

Project: MvvmFx
Source File: BoundListView.cs
protected override void OnAfterLabelEdit(LabelEditEventArgs e)
        {
            if (e.Label == null)
            {
                // If you press ESC while editing.
                e.CancelEdit = true;
                return;
            }

#if WINFORMS
            var index = e.Item;
#else
            var index = e.Item.Index;
#endif

            if (_listManager.List.Count > index)
            {
                var row = _listManager.List[index];
                // In a ListView you are only able to edit the first Column.
                var col = _listManager.GetItemProperties().Find(Columns[0].Text, false);
                try
                {
                    if (row != null && col != null)
                        col.SetValue(row, e.Label);
                    _listManager.EndCurrentEdit();
                    base.OnAfterLabelEdit(e);
                }
                catch (Exception ex)
                {
                    // If you try to enter strings in number-columns, too long strings or something
                    // else wich is not allowed by the DataSource.
                    MessageBox.Show(Resources.EditFailed + ": " + ex.Message, Resources.EditFailed, MessageBoxButtons.OK, MessageBoxIcon.Error);
                    _listManager.CancelCurrentEdit();
                    e.CancelEdit = true;
                }
            }
        }

32. Example

Project: MvvmFx
Source File: BoundListView.cs
protected override void OnAfterLabelEdit(LabelEditEventArgs e)
        {
            if (e.Label == null)
            {
                // If you press ESC while editing.
                e.CancelEdit = true;
                return;
            }

#if WINFORMS
            var index = e.Item;
#else
            var index = e.Item.Index;
#endif

            if (_listManager.List.Count > index)
            {
                var row = _listManager.List[index];
                // In a ListView you are only able to edit the first Column.
                var col = _listManager.GetItemProperties().Find(Columns[0].Text, false);
                try
                {
                    if (row != null && col != null)
                        col.SetValue(row, e.Label);
                    _listManager.EndCurrentEdit();
                    base.OnAfterLabelEdit(e);
                }
                catch (Exception ex)
                {
                    // If you try to enter strings in number-columns, too long strings or something
                    // else wich is not allowed by the DataSource.
                    MessageBox.Show(Resources.EditFailed + ": " + ex.Message, Resources.EditFailed, MessageBoxButtons.OK, MessageBoxIcon.Error);
                    _listManager.CancelCurrentEdit();
                    e.CancelEdit = true;
                }
            }
        }

33. Example

Project: MvvmFx
Source File: BoundListView.cs
protected override void OnAfterLabelEdit(LabelEditEventArgs e)
        {
            if (e.Label == null)
            {
                // If you press ESC while editing.
                e.CancelEdit = true;
                return;
            }

#if WINFORMS
            var index = e.Item;
#else
            var index = e.Item.Index;
#endif

            if (_listManager.List.Count > index)
            {
                var row = _listManager.List[index];
                // In a ListView you are only able to edit the first Column.
                var col = _listManager.GetItemProperties().Find(Columns[0].Text, false);
                try
                {
                    if (row != null && col != null)
                        col.SetValue(row, e.Label);
                    _listManager.EndCurrentEdit();
                    base.OnAfterLabelEdit(e);
                }
                catch (Exception ex)
                {
                    // If you try to enter strings in number-columns, too long strings or something
                    // else wich is not allowed by the DataSource.
                    MessageBox.Show(Resources.EditFailed + ": " + ex.Message, Resources.EditFailed, MessageBoxButtons.OK, MessageBoxIcon.Error);
                    _listManager.CancelCurrentEdit();
                    e.CancelEdit = true;
                }
            }
        }