ASPxGridBase.ForceDataRowType(Type) Method
Informs the grid control about the type of objects contained within its data source.
Namespace: DevExpress.Web
Assembly: DevExpress.Web.v20.2.dll
NuGet Package: DevExpress.Web
Declaration
Parameters
Name | Type | Description |
---|---|---|
type | Type | The type of data source records. |
Remarks
If the grid’s data source is not empty on the first load, the grid automatically determines and saves the type of objects contained within its data source, so you do not have to force the type of objects contained within its data source.
If the grid’s data source is empty (e.g., because of an invalid filter expression or empty data base) on the first load, use the ForceDataRowType method to inform the ASPxGridView control about the types of its columns.
protected void ASPxGridView1_Init(object sender, EventArgs e) {
ASPxGridView1.ForceDataRowType(typeof(MyDataObject));
}
See Also