12.07.2015 Views

MỤC LỤC - lib

MỤC LỤC - lib

MỤC LỤC - lib

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Bài Giảng Môn Lập Trình Website ASP.NetDim sHuong As String = ViewState("SortAscending")Dim sKy_hieu As String = IIf(sHuong = "false", " 6", " 5")Dim i%For i = 0 To dtgKhach_hang.Columns.Count - 1If sSap_xep = _dtgKhach_hang.Columns(i).SortExpression ThenDim cell As TableCell = e.Item.Cells(i)Dim lblKy_hieu As New LabellblKy_hieu.Text = sKy_hieulblKy_hieu.Font.Name = "webdings"lblKy_hieu.Font.Size = FontUnit.XSmallcell.Controls.Add(lblKy_hieu)End IfNextEnd IfEnd SubIV.3. Định dạng hình thức hiển thị cho dòng dữ liệu thỏa điềukiện trên DataGridTrong ví dụ sau, chúng ta thực hiện tô màu cho những khách hàng có tên bắt đầu bằng ký tựH.Private Sub dtgKhach_hang_ItemDataBound(…, e …) …If e.Item.ItemIndex < 0 Then Exit SubDim sTen_kh As StringsTen_kh = e.Item.DataItem("Ten_khach_hang")'Tiến hành kiểm tra điều kiện,'nếu thỏa thực hiện các xử lý định dạngIf sTen_kh.StartsWith("H") Thene.Item.BackColor = Color.LemonChiffone.Item.Cells(1).Font.Bold = TrueEnd IfEnd SubTô màu những khách hàng có tên bắt đầu bằng ký tự HIV.4. Tạo hiệu ứng chọn khi rê chuột qua các dòng dữ liệuPrivate Sub dtgKhach_hang_ItemDataBound(…, e …) …If e.Item.ItemIndex < 0 Then Exit Subwww.Beenvn.come.Item.Attributes("onMouseOver") = _"this.style.backgroundColor='#FFF8DC'"e.Item.Attributes("onMouseOut") = _Biên sọan: Dương Thành Phết Trang 134

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!