- [DEVEXPRESS] Chia sẻ source code cách tạo biểu đồ sơ đồ tổ chức công ty Org Chart trên Winform C#
- [C#] Hướng dẫn tạo Auto Number trên Datagridview winform
- [DATABASE] Hướng dẫn tạo Procedure String Split in Mysql
- [C#] Thiết lập dấu (,) hay dấu (.) ở định dạng số đúng với định dạng số Việt Nam
- [C#] Chia sẻ source code Game Spin Lucky Wheel
- [C#] Hướng dẫn Encode and Decode HTML
- Danh sách tài khoản ChatGPT miễn phí - Hướng dẫn tạo tài khoản Chat Open AI GPT tại Việt Nam
- [C#] Hướng dẫn thay đổi giao diện ứng dụng Winform theo giao diện của Windows
- [VB.NET] Hiệu ứng Acrylic, Mica, Tabbed Blur Effect trên Winform
- [DEVEXPRESS] Hướng dẫn sử dụng HTML Template trên Combobox Edit
- [C#] Chia sẻ source code Orange Rain in Winform
- [DEVEXPRESS] Hướng dẫn sử dụng HTML Template trên XtraMessageBox Winform Devexpress 22.2.3
- [DEVEXPRESS] Hướng dẫn sử dụng HTML and CSS Code Viewer trên Winform
- [C#] Number Effect Counter up and down in winform
- [C#] Hướng dẫn Supend and Resume Process ID in Winform
- [C#] Hiển thị line number trên Richtextbox Winform
- [C#] Fake Blue Screen BSOD in winform
- [C#] Chia sẽ code demo sử dụng Async Parallel Foreach and For in Winform
- [C#] Sử dụng ActionBlock run X task at time winform
- [C#] Hướng dẫn sử dụng Property Grid để lưu và tải lại thông tin cấu hình user trên winform
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!