In OpenAccess ORM queries are composed using Language-Integrated Query (LINQ). All you need to do are the following steps:
- In Solution Explorer
find your .aspx
- Right-click on it and select View Designer
- Double-click on your button to add a method that caches the OnClick
event of the button.
- Inside that method create a new instance of the OpenAccess context
(within a using statement).
- Compose a LINQ statement
and save its result to an IQueariable<T>
- Attach the result as a data source of the RadGrid.
The next lines of code show an example on how that could be done:
sender, EventArgs e)
//Create an instance of the context
(EntitiesModel dbContext =
//Select rows from the database
IQueryable<Order> ordersByCustomer = dbContext.Orders.Where(
order => order.CustomerID ==
//Attach the result as a data source of the RadGrid
OrderGrid.DataSource = ordersByCustomer;
For further information about the CRUD operation you can check the CRUD Operations
section in the Developer’s Guide of our documentation.
the Telerik team
Follow @OpenAccessORM Twitter channel to be the first one to get the latest updates on new releases, tips and tricks and sneak peeks at our product labs!