Creates a new MultiEditorRow object with default settings.
You can use the methods and properties of the newly created row object to adjust it as your application needs dictate: you can specify its name, create a collection of row items (represented by MultiEditorRowProperties objects) for it, bind these items to data fields, specify their caption, editor type, etc. The created multi-editor row should be added to a row collection in order to be displayed. Row collections can be accessed via the VGridControlBase.Rows or the BaseRow.ChildRows property. These properties are represented by instances of the VGridRows object which provides methods to add and delete individual rows.
The example below demonstrates how to create a multi-editor row at runtime using the default constructor. The new multi-editor row is intended to represent and edit the values of two data fields (MPG City and MPG Highway) which contain information about the fuel efficiency of cars. For this purpose, two row items are created, adjusted and added to the row's MultiEditorRow.PropertiesCollection. Since both bound fields are of an identical data type, both row items will use the same editor of the SpinEdit type to display and edit their data.
In the end of the example code's execution, the multi-editor row containing two row items is added to the grid's VGridControlBase.Rows collection.
using DevExpress.XtraVerticalGrid.Rows; using DevExpress.XtraEditors.Repository; // creating a new multi-editor row instance MultiEditorRow newMultiEditorRow = new MultiEditorRow(); // assigning the name to the created multi-editor row newMultiEditorRow.Name = "multiEditorRow_MPG"; // creating the first row item, specifying its name and binding it to a data field MultiEditorRowProperties rowItem1 = newMultiEditorRow.PropertiesCollection.Add(); rowItem1.Caption = "MPG City"; rowItem1.FieldName = "MPG City"; // creating the second row item bound to a data field and specifying its name MultiEditorRowProperties rowItem2 = newMultiEditorRow.PropertiesCollection.Add("MPG Highway"); rowItem2.Caption = "MPG Highway"; // assigning the same editor for the created row items RepositoryItemSpinEdit riSpin = vGridControl1.RepositoryItems.Add("SpinEdit") as RepositoryItemSpinEdit; rowItem1.RowEdit = riSpin; rowItem2.RowEdit = riSpin; // appending the multi-editor row to a collection of top level grid rows vGridControl1.Rows.Add(newMultiEditorRow);