To complete the lessons in this chapter, you should be familiar with developing applications with Microsoft Visual Studio 2010 by using Microsoft Visual Basic or Microsoft Visual C#.In addition, you should be comfortable with all of the following: REAL WORLD: Mike Snell Not all applications require developers to write custom, abstracted data layers and reusable frameworks.问题一:我在使用Details View的过程中发现,每次进入Details View的新建或者编辑状态后,默认光标不会自动定位到Details View的第一个录入框,请问有什么办法可以解决?解 答:要使得光标自动定位到Details View编辑界面上第一个录入控件有一个简单的方法,只要在VS下打开页面的设计视图,然后切换到“源视图”,在 “form”标记内添加以下代码“defaultfocus="Details View1"”,保存后运行就会发现光标已经会自动定位到 Details View的第一个录入框了。问题二:Details View是根据标题文字的长短自动设置标题列的宽度的,如果我想自己来定义标题列的宽度,该如何实现?解 答:要实现你提到的功能,使用Details View的Header Style定义外观样式就可以了。和Grid View一样,Details View也 提供了大量的“******Style”属性供用户对Details View的外观进行自定义。只不过,很多刚刚接触Details View的人对各个 “******Style”属性具体对应的外观不甚了解。其实,有一个简单的方法可以帮助大家快速了解Details View的各个样式属性,大家只要把 Details View想像成Grid View逆向旋转90度,就比较容易理解各个样式属性定义的外观位置了。问题三:我希望Details View的标题能够随着编辑状态的变化而变化,例如编辑记录时显示“新建用户”或“编辑用户”、浏览记录时显示“查看用户”。解答:可以在Details View的Mode Changed事件中通过Current Mode属性的值得到Details View的当期状态,然后将Caption设置为相应的提示文字就可以了。具体实现代码如下: Select Case Details View1.

detailsview 1 itemupdating-50detailsview 1 itemupdating-33

NET data source controls, demonstrates how you can bind to data to allow users to interact with it, and presents the new Dynamic Data features of ASP.

NET that allow you to easily create websites for working with the CRUD operations of an entire data model that exists as either a Data Context (such as LINQ to SQL) or an Object Context (such as LINQ to Entities). NET provides several server controls that build on top of the features of Microsoft ADO. These controls simplify the development of data-driven websites.

Item Updating Dim is Updated As Boolean = False For i As Integer = 0 To e.

Details View Update Event Args) Handles Details View1.

They make it easier to build webpages that access, display, manipulate, and save data. You use these controls to configure access to data that you intend to use on a webpage.

Using these controls can provide development efficiency when you are building business applications that rely heavily on data. A data source can be a relational database, data stored inside of in-memory objects (such as a Data Set or an Entity Data Model), XML-based data, or data you retrieve via Microsoft Language-Integrated Query (LINQ).

Clicking on a link in the grid row will open a popup form that allows the data to be edited, clicking update will update the underlying data table and update the grid using AJAX.

We use stored procedures for data access, if you're not comfortable with that you'll want to change that.

(visible in Figure 13-5), to sort the data in the grid on that column.