Data Access has been discontinued. Please refer to this page for more information.

Expression Editor

This article is relevant to entity models that utilize the deprecated Visual Studio integration of Telerik Data Access. The current documentation of the Data Access framework is available here.

The Expression Editor dialog enables you to set the Delete, GroupBy, Insert, OrderBy, OrderGroupsBy, Select, Update and Where expressions for the OpenAccessLinqDataSource control. You can add parameters that will be used in these expressions. For example, you could add parameters for Insert, Update, or Delete operations. When setting expressions for Where or OrderBy operations, you can let the OpenAccessLinqDataSource control automatically to generate the expression, or you can manually create the expression.

In this topic:

Starting the Expression Editor

You can access the Expression Editor by selecting the ellipsis button (...) in the Properties window for anyone of the following:

  • Delete - collection of parameters used during the Delete operation. These parameters are merged with the parameters provided by the data-bound control.
  • GroupBy - specifies the expression passed to the GroupBy operator during the Select query.
  • Insert - collection of parameters used during the Insert operation. These parameters are merged with the parameters provided by the data-bound control.
  • OrderBy - specifies the expression passed to the OrderBy operator during the Select query.
  • OrderGroupsBy - collection of parameters used in the projection during the Select query.
  • Select - collection of parameters used in the projection during the Select query.
  • Update - collection of parameters used during the Update operation. These parameters are merged with the parameters provided by the data-bound control.
  • Where - specifies the expression passed to the Where operator during the Select query.

Using the OpenAccessLinqDataSource Wizard

You can also access the Expression Editor for the Where and OrderBy expressions by using the Where and OrderBy tab pages in the Configure Data Selection Dialog. However, these views are enabled only if you have previously set the expression to a custom expression that cannot be supported through the standard dialog boxes. For example, if you have the OpenAccessLinqDataSource control declaration:

<telerik:OpenAccessLinqDataSource
   ID="OpenAccessLinqDataSource"
   runat="server"
   ContextTypeName="WebApplication.EntitiesModel"
   EntityTypeName=""
   ResourceSetName="Categories"
   Where="CategoryID || @CategoryID">
   <WhereParameters>
       <asp:Parameter DefaultValue="0" Name="CategoryID" Type="Int32" />
   </WhereParameters>
</telerik:OpenAccessLinqDataSource>

If you re-run the OpenAccessLinqDataSource Wizard, the Expression Editor will be enabled for the Where tab page.

The user interface for the Expression Editor may vary, depending on which expression you set.

Where/OrderBy Expression Editor

The image below shows you the user interface for the Expression Editor when you set Where or OrderBy expressions.

  • Automatically generate the Where/OrderBy expression based on the provided parameters - specifies whether the OpenAccessLinqDataSource control automatically generates the Where or OrderBy expressions based on the provided parameters. The generated expression includes the parameters that are defined in the WhereParameters collection or the OrderByParameters collection.
  • Where/OrderBy Expression - enables you to manually create the Where, OrderBy, GroupBy, or Select expression. For the Where and OrderBy Expression Editor, when the Automatically generate the Where/OrderBy expression based on the provided parameters option is selected, this element is disabled.
  • Parameters - displays existing parameters and lets you add new parameters or delete existing. The table shows the name of the parameter and the syntax that is used to retrieve the parameter value. When the Parameter Source and Name are specified, click the Add Parameter button to add a new parameter.
  • Parameter Source - specifies which source to use for a parameter. The choices are None, Control, Cookie, Form, Profile, QueryString, Session and RouteData. For more information, please refer to the Where Settings topic.

Select/OrderGroupsBy Expression Editor

The image below shows you the user interface for the Expression Editor when you set Select or OrderGroupsBy expressions.

Insert/Update/Delete Expression Editor

The image below shows you the user interface for the Expression Editor when you set Insert, Update or Delete expressions.