Danh mục

Using the Web Forms GridView Control

Số trang: 1      Loại file: pdf      Dung lượng: 21.45 KB      Lượt xem: 1      Lượt tải: 0    
Hoai.2512

Xem trước 1 trang đầu tiên của tài liệu này:

Thông tin tài liệu:

Sử dụng Web Forms GridView Control Khi bạn nhìn vào truy cập vào cơ sở dữ liệu trong các chương trước, bạn đã học được cách sử dụng Windows Các hình thức kiểm soát DataGridView. Web Forms có một điều khiển tương tự gọi là GridView.
Nội dung trích xuất từ tài liệu:
Using the Web Forms GridView Control Using the Web Forms GridView ControlWhen you looked at accessing databases in previous chapters, you learned how to use theWindows Forms DataGridView control. Web Forms have a similar control calledGridView. It has some differences because Microsoft designed it to be used in aMicrosoft ASP.NET environment, but the overall purpose is the same; to display and editrows retrieved from a data source. One difference is related to fetching and displayinglarge volumes of data. In a Web Forms application, it is very likely that the clientapplication (or the browser) will be remote from the database that is being used. It isimperative that you use network bandwidth wisely (this has been stated several timesalready, but it is very important and worth repeating), and you should not waste resourcesretrieving vast amounts of data that the user does not want to see. The Web FormsGridView control supports paging, which allows you to fetch data on demand as the userscrolls up and down through a DataSet.Like the Windows Forms DataGridView control, the Web Forms GridView control isdesigned to be used while it is disconnected from the database. You can create anSqlDataSource object to connect to a database, populate a DataSet, and then disconnectfrom the database. You can bind the DataSet in a SqlDataSource control to the GridViewcontrol. Unlike a Windows Forms GridView control, the information in a Web FormsGridView control is presented in a grid of read-only text (rendered as an HTML table inthe browser). However, properties of the Web Forms GridView control allow a user toenter edit mode, which changes a selected row into a set of text boxes that the user canuse to modify the data that is presented. You will use this technique in the exercises inthis chapter.

Tài liệu được xem nhiều: