Bind Object to ASP.NET Controls Using the OpenAccessDataSource
You can use the OpenAccessDataSource control to bind objects to ASP.NET controls. This technique will reduce the code behind dramatically. For more information regarding how to bind controls using the data source you can refer to this topic - OpenAccessDataSource QuickStart Example.
Bind Objects to ASP.NET Controls Using the Code Behind
Telerik OpenAccess ORM enables you to bind object using the code behind method as well. You can easily do this by retrieving all the objects that you wish to bind and taking advantage of the .DataSource property of the control to which you wish to bind the result set. The following examples shows how to retrieve a single column from a data table and bind it to RadComboBox:
var result = from c in scope.Extent<OpenAccessData.Order>()
RadComboBox1.DataSource = result;
Dim result = From c In scope.Extent(Of OpenAccessData.Order)() _
Order By c.OrderID _
RadComboBox1.DataSource = result
This example shows how to bind a whole collection of fields which order ID matches some variable to a RadGrid.
var result = from c in scope.Extent<OpenAccessData.OrderDetail>() where c.OrderID == myValue select c;
RadGrid1.DataSource = result;
Dim result = From c In scope.Extent(Of OpenAccessData.OrderDetail)() _
Where c.OrderID = myValue _
RadGrid1.DataSource = result