- [DEVEXPRESS] Chia sẻ code các tạo report in nhiều hóa đơn trên XtraReport C#
- [POWER AUTOMATE] Hướng dẫn gởi tin nhắn zalo từ file Excel - No code
- [C#] Chia sẻ code lock và unlock user trong domain Window
- [SOFTWARE] Giới thiệu bộ phần mềm tính Kết Cấu Thép HatteSale, Mộng Đơn, Dầm, Sàn, Móng Cọc, Vách, Xà Gồ, Tính Tải Trọng
- [DEVEXPRESS] Vẽ Biểu Đồ Stock Chứng Khoán - Công Cụ Thiết Yếu Cho Nhà Đầu Tư trên Winform
- [C#] Hướng dẫn bảo mật ứng dụng 2FA (Multi-factor Authentication) trên Winform
- [C#] Hướng dẫn convert HTML code sang PDF File trên NetCore 7 Winform
- [C#] Hướng dẫn viết ứng dụng chat với Gemini AI Google Winform
- Hướng dẫn khóa file bằng nhiều process id, không cho xóa tập tin
- Hướng dẫn cách tạo Product Id cho ứng dụng phần mềm XXXXX-XXXXX-XXXXX-XXXXX
- [SQLSERVER] Hướng dẫn tạo script sql từ ứng dụng Sqlserver management Studio
- [C#] Hướng dẫn sử dụng thư viện AutoITx lấy id và password Ultraviewer trên winform
- [VB.NET] Hướng dẫn lấy thông tin tài khoản đăng nhập windows và khởi động lại ứng dụng ở chế độ Administrator
- [C#] Sử dụng thư viện Polly gửi lại request api khi request bị lỗi hay rớt mạng
- [DEVEXPRESS] Chia sẻ source code tạo báo cáo report in tem nhãn label trên C# winform
- [DEVEXPRESS] Hướng dẫn vẽ biểu đồ Bar Chart trên Winform
- [C#] Tạo form đăng nhập và đăng ký với hiệu ứng Sliding Animation Effect
- [C#] Hướng dẫn tạo thanh toán đơn hàng qua mã vạch VietQR sử dụng API PayOS hoàn toàn miễn phí
- [C#] Hướng dẫn ghi log ra RichTextBox giống Console trên Winform sử dụng thư viện Serilog
- [C#] Hướng dẫn cách tạo mã QR Code trên file Excel
Hướng dẫn sử dụng tooltip khi rê chuột vào cell của grid view devexpress
Hôm nay, mình xin hướng dẫn các bạn, cách sử dụng tooltip khi rê chuột vào từng cell của gridview Devexpress.
Giao diện, demo của chương trình tooltip:
Đầu tiên, các bạn thiết kế form như giao diện bên dưới.
Sau đó, các bạn kéo control tooltipcontroller vào, sau đó các bạn add tooltipcontroller cho gridview như hình bên dưới:
Dưới đây, là source code chương trình:
Imports DevExpress.XtraGrid.Views.Grid
Imports DevExpress.XtraGrid.Views.Grid.ViewInfo
Public Class Form1
Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load
'TODO: This line of code loads data into the 'SinhvienDataSet1.tbl_sinhvien' table. You can move, or remove it, as needed.
Me.Tbl_sinhvienTableAdapter.Fill(Me.SinhvienDataSet1.tbl_sinhvien)
'TODO: This line of code loads data into the 'SinhvienDataSet.tbl_sinhvien' table. You can move, or remove it, as needed.
End Sub
Private Sub ToolTipController1_GetActiveObjectInfo(sender As Object, e As DevExpress.Utils.ToolTipControllerGetActiveObjectInfoEventArgs) Handles ToolTipController1.GetActiveObjectInfo
If e.Info Is Nothing AndAlso e.SelectedControl Is GridControl1 Then
Dim view As GridView = TryCast(GridControl1.FocusedView, GridView)
Dim info As GridHitInfo = view.CalcHitInfo(e.ControlMousePosition)
If view Is Nothing Then
Return
End If
If info.InRowCell Then
If info.Column.Caption = "Tên sinh viên" Then
Dim text As String = ""
Dim fullname As String = view.GetRowCellValue(info.RowHandle, view.Columns("fullname")).ToString
Dim birthday As String = view.GetRowCellValue(info.RowHandle, view.Columns("birthday")).ToString
Dim vb As String = view.GetRowCellValue(info.RowHandle, view.Columns("vb")).ToString
Dim csharp As String = view.GetRowCellValue(info.RowHandle, view.Columns("CSHARP")).ToString
Dim php As String = view.GetRowCellValue(info.RowHandle, view.Columns("PHP")).ToString
Dim asp As String = view.GetRowCellValue(info.RowHandle, view.Columns("asp")).ToString
Dim sql As String = view.GetRowCellValue(info.RowHandle, view.Columns("SQLSERVER")).ToString
text += "Tên sinh viên: " & fullname & "
Ngày sinh: " & birthday & "
VB.NET: " & vb & "
CSHARP: " & csharp & "
PHP: " & php & "
ASP.NET: " & asp & "
SQLSERVER: " & sql
Dim cellKey As String = info.RowHandle.ToString() & " - " & info.Column.ToString()
e.Info = New DevExpress.Utils.ToolTipControlInfo(cellKey, text)
End If
End If
End If
End Sub
End Class
CHÚC CÁC BẠN THÀNH CÔNG!