This repository has been archived by the owner on Sep 11, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Form1.vb
52 lines (50 loc) · 1.89 KB
/
Form1.vb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
Imports DevExpress.XtraEditors
Imports DevExpress.XtraGrid.Views.Base
Imports DevExpress.XtraGrid.Views.Grid.ViewInfo
Imports System
Imports System.Collections.Generic
Imports System.Linq
Imports System.Windows.Forms
Namespace dxExample
Partial Public Class Form1
Inherits Form
Public Sub New()
'
InitializeComponent()
gridView1.Columns("Status").GroupFormat.FormatType = DevExpress.Utils.FormatType.Numeric
gridView1.Columns("Status").GroupFormat.FormatString = "n3"
End Sub
Private Sub Form1_Load(ByVal sender As Object, ByVal e As EventArgs) Handles MyBase.Load
InitGridControl()
End Sub
Private Sub InitGridControl()
DataHelper.InitData(dataTable1)
End Sub
Private Sub gridView1_CustomDrawGroupRow(ByVal sender As Object, ByVal e As RowObjectCustomDrawEventArgs) Handles gridView1.CustomDrawGroupRow
DrawGroupRow(e)
End Sub
Private Sub DrawGroupRow(ByVal e As RowObjectCustomDrawEventArgs)
Dim info = TryCast(e.Info, GridGroupRowInfo)
If Not(info.Column.FieldName = "ID") Then
Return
End If
GroupRowPaintHelper.CustomDrawSubjectColumnGroupRow(e, gridView1, gridControl1.LookAndFeel, imageList1)
e.Handled = True
End Sub
Private Sub gridView1_CustomColumnDisplayText(ByVal sender As Object, ByVal e As CustomColumnDisplayTextEventArgs) Handles gridView1.CustomColumnDisplayText
If e.Column.FieldName = "Subject" Then
e.DisplayText = GetCustomColumnDisplayText(e.Value.ToString(), e.ListSourceRowIndex)
End If
End Sub
Private Function GetCustomColumnDisplayText(ByVal groupValueText As String, ByVal imgIndex As Integer) As String
Dim imgName As String
Try
imgName = imageCollection1.Images.InnerImages(imgIndex).Name
Catch
imgName = imageCollection1.Images.InnerImages(0).Name
End Try
Dim groupText = String.Format("<image={0}> {1}", imgName, groupValueText)
Return groupText
End Function
End Class
End Namespace