ASPxGridBase.ForceDataRowType(Type) Method
Informs the grid control about the type of objects contained within its data source.
Namespace: DevExpress.Web
Assembly: DevExpress.Web.v24.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));
}
#Related GitHub Examples
The following code snippet (auto-collected from DevExpress Examples) contains a reference to the ForceDataRowType(Type) method.
Note
The algorithm used to collect these code examples remains a work in progress. Accordingly, the links and snippets below may produce inaccurate results. If you encounter an issue with code examples below, please use the feedback form on this page to report the issue.