Data Bind to Dynamic Object with CLR and Dynamic Properties
This article describes how to implement DynamicObject with dynamic (DLR) and static (CLR) fields, and data bind it to RadGridView.
The following model shows a class that derives from DynamicObject and containing one CLR property called Id
. When the RadGridView auto-generates its columns, the TryGetMember method of the DynamicObject class will be used to fetch the values for each column. This said, you will need to implement some logic in the method in order to allow RadGridView to work with the data - both CLR (Common Language Runtime) and DLR (Dynamic Language Runtime).
Example 1: DynamicObject implementation
Example 2: Populating with data
Example 3: RadGridView definition

Another code example with dynamic data can be found in the Various Data Sources demo.