VirtualServerModeSource.RowType Property

Gets or sets the type of object whose public properties identify data-aware control columns.

Namespace: DevExpress.Data

Assembly: DevExpress.Data.v21.2.dll

Declaration

[DefaultValue(null)]
public Type RowType { get; set; }

Property Value

Type Default Description
Type

null

The row object’s type.

Remarks

Specify the RowType property at design time to populate the bound grid control with columns. For example, the sample Data class contains multiple child classes, one of them is Order.

public class Data
{
    public class Order
    {
        public Order(int _id, DateTime _orderDate, string _name, int _count)
        {
            ID = _id;
            OrderDate = _orderDate;
            ProductName = _name;
            OrderCount = _count;
        }
        public int ID { get; set;}
        public DateTime OrderDate { get; set; }
        public string ProductName { get; set; }
        public int OrderCount { get; set; }
    }
}

If you want a data-aware control to display Order entities, set the RowType property to the related type.

rowtype

virtualServerModeSource1.RowType = typeof(virtDS.Data.Order);

When you set this VirtualServerModeSource component as a data source for a Data Grid, the Grid generates columns for all data fields found in the class referenced by the RowType property.

columns

At runime, the control fires the AcquireInnerList event if the RowType property is not set. Handle this event to manually supply a list that will store rows fetched by VirtualServerModeSource’s events. If neither the AcquireInnerList event is handled nor the RowType property is set, the source is unable to retrieve column information and a data-aware control bound to this source is empty.

See Also