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 0
/
MyGridViewInfo.vb
77 lines (74 loc) · 2.46 KB
/
MyGridViewInfo.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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
Imports Microsoft.VisualBasic
Imports System
Imports System.Collections.Generic
Imports System.Linq
Imports DevExpress.XtraGrid.Views.Grid.ViewInfo
Imports System.Drawing
Imports DevExpress.XtraGrid.Views.Grid
Namespace GridControlWithFindPanel
Public Class MyGridViewInfo
Inherits GridViewInfo
Public Sub New(ByVal gridView As GridView)
MyBase.New(gridView)
End Sub
Public Overrides Sub CalcRects(ByVal bounds As Rectangle, ByVal partital As Boolean)
Dim inTop As Boolean = (TryCast(Me.View, MyGridView)).ShowFindPanelOnTop
Dim r As Rectangle = Rectangle.Empty
Dim myBounds As Rectangle = bounds
If (Not inTop) Then
myBounds.Height = bounds.Height - (TryCast(Me.View, MyGridView)).FindPanelHeight
End If
ViewRects.Bounds = myBounds
ViewRects.Scroll = CalcScrollRect()
ViewRects.Client = CalcClientRect()
FilterPanel.Bounds = Rectangle.Empty
If (Not partital) Then
CalcRectsConstants()
End If
If View.OptionsView.ShowIndicator Then
ViewRects.IndicatorWidth = Math.Max(View.IndicatorWidth, ViewRects.MinIndicatorWidth)
End If
Dim minTop As Integer = ViewRects.Client.Top
Dim maxBottom As Integer = ViewRects.Client.Bottom
If View.OptionsView.ShowViewCaption Then
r = ViewRects.Client
r.Y = minTop
r.Height = CalcViewCaptionHeight(ViewRects.Client)
ViewRects.ViewCaption = r
minTop = ViewRects.ViewCaption.Bottom
End If
If inTop Then
minTop = UpdateFindControlVisibility(New Rectangle(ViewRects.Client.X, minTop, ViewRects.Client.Width, maxBottom - minTop), False).Y
Else
UpdateFindControlVisibility(New Rectangle(ViewRects.Client.X, ViewRects.Client.Bottom, ViewRects.Client.Width, maxBottom - minTop), False)
End If
If View.OptionsView.ShowGroupPanel Then
r = ViewRects.Client
r.Y = minTop
r.Height = CalcGroupPanelHeight()
ViewRects.GroupPanel = r
minTop = ViewRects.GroupPanel.Bottom
End If
minTop = CalcRectsColumnPanel(minTop)
If View.IsShowFilterPanel Then
r = ViewRects.Client
Dim fPanel As Integer = GetFilterPanelHeight()
r.Y = maxBottom - fPanel
r.Height = fPanel
FilterPanel.Bounds = r
maxBottom = r.Top
End If
If View.OptionsView.ShowFooter Then
r = ViewRects.Client
r.Height = GetFooterPanelHeight()
r.Y = maxBottom - r.Height
ViewRects.Footer = r
maxBottom = r.Top
End If
r = ViewRects.Client
r.Y = minTop
r.Height = maxBottom - minTop
ViewRects.Rows = r
End Sub
End Class
End Namespace