MultiEditorRowPropertiesCollection.RemoveAt(Int32) Method
Removes a row item object from the MultiEditorRow.PropertiesCollection at the specified position.
Namespace: DevExpress.XtraVerticalGrid.Rows
Assembly: DevExpress.XtraVerticalGrid.v21.1.dll
NuGet Packages: DevExpress.Win.Design, DevExpress.Win.VerticalGrid
Declaration
Parameters
Name | Type | Description |
---|---|---|
index | Int32 | An integer value representing the index of the MultiEditorRowProperties object in the row item collection to remove. |
Remarks
Use the Remove method to remove a row item representing an individual row properties object for a multi-editor row from the row’s MultiEditorRow.PropertiesCollection at the specified position.
Elements following the removed element move up to occupy the vacated area. The indexes of the moved elements are updated.
Note that the VGridControlBase.RowChanged event occurs each time after a row item is successfully removed from the collection. The event parameter’s RowChangedEventArgs.ChangeType property representing the type of row processing performed returns the RowChangeTypeEnum.PropertiesDeleted value.
If you wish to remove a specifc row item from the collection, use the MultiEditorRowPropertiesCollection.Remove method. All row items can be removed from the collection by using the MultiEditorRowPropertiesCollection.Clear method.
You can use the MultiEditorRowPropertiesCollection.Add method to add new row item objects to the collection. Existing row items can be added to the collection with the help of the MultiEditorRowPropertiesCollection.AddRange method.
Example
The example below represents a function that uses the MultiEditorRowPropertiesCollection.RemoveAt
method and MultiEditorRowPropertiesCollection.Count property to remove the last row item from the MultiEditorRow.PropertiesCollection of a multi-editor row.
private bool RemoveLastRowItem(BaseRow row) {
// checking whether the passed row is of the multi editor type
if (row.XtraRowTypeID != 2) return false;
MultiEditorRowPropertiesCollection propsCollection =
(row as MultiEditorRow).PropertiesCollection;
// checking whether the collection of row items is not empty
if (propsCollection.Count == 0) return false;
// removing the last row item from the collection
propsCollection.RemoveAt(propsCollection.Count - 1);
return true;
}