TAILIEUCHUNG - Filter and Sort Records Using the DataView Object

3,4 Filter và Phân loại Records Sử dụng đối tượng DataView Sau khi dữ liệu của bạn được nạp vào bảng dữ liệu, có thể bạn sẽ muốn có thể xem dữ liệu của bạn bằng cách sử dụng các bộ lọc khác nhau và sắp xếp đơn đặt hàng. Để làm điều này, bạn có thể sử dụng đối tượng DataView. | Filter and Sort Records Using the DataView Object After your data is loaded into the data table you will probably want to be able to view your data using different filters and sort orders. To do this you can use the DataView object. This How-To goes into detail and shows you how to take advantage of the DataView control to manipulate your data. Although you can put data into the DataGrid control and let the users sort data using the columns you want to display a ComboBox control and let users pick a field from the drop-drown list. How can you filter and sort records using the DataView object to present your data in different ways Technique This How-To displays a set of command buttons that display a letter and an extra command button that displays all records. A data adapter data table and data view are declared at the form level. The data adapter is created and the DataTable is filled when the form is loaded with all customers. Using a DataColumn object a combo box is filled by getting the names of each column that is in the data table. You can see this form in action in Figure . Figure . Selecting a letter here limits the data displayed in the DataGrid control. Using the command buttons a routine is called that creates a DataView object sets the RowFilter property and then assigns the data view to the DataSource property of a DataGrid control. Tip Although the RowFilter allows you to filter data based on a criteria such as CompanyName Like A you can set another property to display data based on the state of the row in which data occurs. The property is called RowStateFilter. You can set the RowStateFilter to one of the following DataViewRowState values in Table . Table . Label TextBox and ComboBox Control Property Settings Setting Description Added New rows CurrentRows Current rows including unchanged new and modified rows Deleted Deleted rows ModifiedCurrent A current version which is a modified version of original data see ModifiedOriginal .

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.