TAILIEUCHUNG - asp net 2.0 all in one desk reference for Dummies PHẦN 7

Một vòng lặp Do là giống như một vòng lặp Trong khi, nhưng nó có tính linh hoạt hơn trong việc xác định chính xác khi nào các điều kiện báo hiệu sự kết thúc của vòng lặp được thử nghiệm. Vòng lặp Do thực sự có thể mất một trong bốn hình thức khác nhau: | Formatting the Display 533 1. Click the GridView in Design view. In the Properties window expand the AlternatingRowStyle property by double-clicking the AlternatingRowStyle property. 2. Set BackColor to LightGray. This will cause all even-numbered lines to have a light-gray background. 3. Under RowStyle expand the Font property by double-clicking the word Font that s under RowStyle. 4. For Name chose Tahoma. 5. For Size type 11px. That s good enough. Now try opening the form in the browser. Figure 3-3 shows what you get. Book VI Chapter 3 Displaying and Editing with the GridView Control Figure 3-3 This example of the GridView in the browser is a lot easier on the eyes. The Gridview control gives you a great deal of control with the formatting and style. Go ahead and browse through the Properties window to see what different styling options exist. Don t be afraid to modify different settings to see how the GridView changes appearance. Play with it until it looks just the way you want it 534 Editing and Deleting Data with a GridVieW Editing and Deleting Data With a GridVieW One of the cool things about the Gridview control is it lets you add editing capabilities to your Web page. With the Gridview control if you turn on such functionality your users can edit existing rows and delete rows of data. To try out my example in this section you will want to create a table and put some initial data in it. Here s the table I created CREATE TABLE member memberid int IDENTITY 1 1 PRIMARY KEY first_name varchar 20 last_name varchar 20 malefemale bit yearborn int In this CREATE TABLE statement you can see that I included a primary key. The primary key is required in order to make editing work. The reason is that when you re using a Gridview control to edit data the Gridview control needs to know how to update a row you re editing. The only way it can make sure it updates the correct row with your changes is to keep track of the primary key. Remember primary keys are unique thus a

TỪ KHÓA LIÊN QUAN
TAILIEUCHUNG - Chia sẻ tài liệu không giới hạn
Địa chỉ : 444 Hoang Hoa Tham, Hanoi, Viet Nam
Website : tailieuchung.com
Email : tailieuchung20@gmail.com
Tailieuchung.com là thư viện tài liệu trực tuyến, nơi chia sẽ trao đổi hàng triệu tài liệu như luận văn đồ án, sách, giáo trình, đề thi.
Chúng tôi không chịu trách nhiệm liên quan đến các vấn đề bản quyền nội dung tài liệu được thành viên tự nguyện đăng tải lên, nếu phát hiện thấy tài liệu xấu hoặc tài liệu có bản quyền xin hãy email cho chúng tôi.
Đã phát hiện trình chặn quảng cáo AdBlock
Trang web này phụ thuộc vào doanh thu từ số lần hiển thị quảng cáo để tồn tại. Vui lòng tắt trình chặn quảng cáo của bạn hoặc tạm dừng tính năng chặn quảng cáo cho trang web này.