- [DEVEXPRESS] Hướng dẫn bật tính năng Scroll Pixcel in Touch trên GridView
- [DEVEXPRESS] Hướng dẫn sử dụng TileBar viết ứng dụng duyệt hình ảnh Winform
- [DEVEXPRESS] Tô màu border TextEdit trên Winform
- [C#] Lấy dữ liệu từ Console Write hiển thị lên textbox Winform
- [C#] Hiển thị Progress bar trên Window Console
- [C#] Di chuyển control Runtime và lưu layout trên winform
- [SQLSERVER] Sử dụng hàm NULL IF
- [C#] Chia sẽ source code mã đi tuần bằng giao diện Winform
- [C#] Flash Window in Taskbar Winform
- Download và Giải nén tập tin File sử dụng Powershell
- [C#] Hướng dẫn cách lấy thông tin đăng nhập tài khoản và mật khẩu web browser trên windows
- [VB.NET] CRUD Thêm xóa sửa tìm kiếm Realtime FireBase
- [C#] Hiển thị thông báo Toast Message trong lập trình Winform
- [C#] Cấu hình định dạng ngày tháng, thời gian trên Windows cho ứng dụng Winform
- [C#] Rút gọn đường dẫn link url với TinyURL API
- [C#] Hướng dẫn cách bo tròn winform with Radius
- [C#] Chia sẽ class BackGroundOverlay Show Modal cho Winform
- [C#] Hướng dẫn Flip Image Winform
- [C#] Invoke là gì? cách sử dụng phương thức Invoke()
- [C#] Hướng dẫn chia sẽ file, folder từ ứng dụng sang Zalo Chat
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!