Figure 5After that, you need to check the Enable Delete, Enable Insert and Enable Update options in the Linq Data Source (see Figure 6).
Figure 6In order to bind the Grid View control to the Linq Data Source, you need to click on the smart tag of the Grid View control and add a reference to the Linq Data Source and enable the options for paging, editing and deleting (see Figure 7). NET control that implements the Data Source Control design pattern introduced with ASP. It is similar to the Object Data Source and Sql Data Source controls in that it can be used to declaratively bind other ASP. The main benefit of using the Linqdatasource control is that it leverages the flexibility that the ORM technologies provide.
Linq Data Source (as other data sources controls) is the interface to UI ASP. Getting started with the solution For this example, we're going to create a Web application to display a list of products.
Figure 13We're going to customize the column to have a dropdownlist control when in edit mode, where the available values in the dropdownlists are pulled from the product subcategories data source, and where we two-way databind the selected value to the Product's Product Subcategory ID foreign key.Figure 16And the link this new drop-down list (with the list of product subcategory) to the Product Subcategory ID field in this data source (see Figure 17).Figure 17The last step in the filtering operations is to enable the autopostback option in the drop-down list (see Figure 18).Select the Product Subcategory ID field in the Selected Fields list and the click on the Convert this field into a Template Field link (see Figure 9).Figure 9And finally click on the Edit Templates option of the Grid View smart tag and select the Product Subcategory ID field (see Figure 10).NET Framework 3.5 which enables to match relational data to objects in your business domail.You can use LINQ expressions to query, filter, update, insert and delete data.Product table within the Adventure Works from Server Explorer on to the Linq to SQL designer (see Figure 2).Figure 3Next step is drag and drop a Linq Data Source and a Grid View control from the toolbox onto the page. Click on the smart tag of the Linq Data Source control and select the Configure Data Source option.Then delete the Textbox control, and add drop-down list.Next step is to click on the smart tag of this new drop-down list and select the Choose a Data Source option.