There are several examples to enable Dynamic Data support on a gridview without using the full Dynamic Data scaffolding (global.asax + dynamicdata folder) such as on this video
I followed along with the example as shown in the video and I was able to get gridview to work correctly with dynamic support.
However, the same steps do not work with DynamicRadGrid. I get the error:
Here are steps I took:
1. In the Page_Init:
2. Made a MetaData Class:
3. Added a validation summry on the page
4. Add a dynamicradgrid on the page with DynamicColumn
Please advise if DynamicRadgrid is even designed to work in this scenario. Thanks
I followed along with the example as shown in the video and I was able to get gridview to work correctly with dynamic support.
However, the same steps do not work with DynamicRadGrid. I get the error:
Could not determine a MetaTable. A MetaTable could not be determined for the data source 'EntityDataSource1' and one could not be inferred from the request URL. Make sure that the table is mapped to the dats source, or that the data source is configured with a valid context type and table name, or that the request is part of a registered DynamicDataRoute.
Here are steps I took:
1. In the Page_Init:
RadGrid1.EnableDynamicData(typeof(Plan));
[MetadataType(typeof(PlanMD))]
public partial class Plan
{
public class PlanMD
{
[StringLength(50), Required]
public string Name { get; set; }
}
}
4. Add a dynamicradgrid on the page with DynamicColumn
<
dynamic:DynamicRadGrid
ID
=
"RadGrid1"
runat
=
"server"
AllowAutomaticInserts
=
"True"
AllowAutomaticUpdates
=
"True"
AllowPaging
=
"True"
AllowSorting
=
"True"
AutoGenerateColumns
=
"False"
AutoGenerateDeleteColumn
=
"True"
AutoGenerateEditColumn
=
"True"
DataSourceID
=
"EntityDataSource1"
GridLines
=
"None"
>
<
MasterTableView
AllowAutomaticInserts
=
"False"
CommandItemDisplay
=
"Top"
DataKeyNames
=
"Id"
DataSourceID
=
"EntityDataSource1"
>
<
CommandItemSettings
ExportToPdfText
=
"Export to Pdf"
></
CommandItemSettings
>
<
RowIndicatorColumn
>
<
HeaderStyle
Width
=
"20px"
></
HeaderStyle
>
</
RowIndicatorColumn
>
<
ExpandCollapseColumn
>
<
HeaderStyle
Width
=
"20px"
></
HeaderStyle
>
</
ExpandCollapseColumn
>
<
Columns
>
<
dynamic:DynamicGridBoundColumn
DataField
=
"Name"
HeaderText
=
"Name"
UniqueName
=
"Name"
>
</
dynamic:DynamicGridBoundColumn
>
</
Columns
>
</
MasterTableView
>
</
dynamic:DynamicRadGrid
>
Please advise if DynamicRadgrid is even designed to work in this scenario. Thanks