Skip to content

Commit b062599

Browse files
DevExpressExampleBotDevExpressExampleBot
DevExpressExampleBot
authored and
DevExpressExampleBot
committed
Source auto update [skip ci]
1 parent 2b18d38 commit b062599

File tree

8 files changed

+277
-321
lines changed

8 files changed

+277
-321
lines changed

VB/Q273845.sln

+2-8
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
Microsoft Visual Studio Solution File, Format Version 12.00
1+
Microsoft Visual Studio Solution File, Format Version 12.00
22
# Visual Studio 15
33
VisualStudioVersion = 15.0.28010.2016
44
MinimumVisualStudioVersion = 10.0.40219.1
@@ -7,24 +7,18 @@ EndProject
77
Global
88
GlobalSection(SolutionConfigurationPlatforms) = preSolution
99
Debug|Any CPU = Debug|Any CPU
10-
Debug|x86 = Debug|x86
1110
Release|Any CPU = Release|Any CPU
12-
Release|x86 = Release|x86
1311
EndGlobalSection
1412
GlobalSection(ProjectConfigurationPlatforms) = postSolution
1513
{7824B57C-2545-4352-928B-96171E6BEF50}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
1614
{7824B57C-2545-4352-928B-96171E6BEF50}.Debug|Any CPU.Build.0 = Debug|Any CPU
17-
{7824B57C-2545-4352-928B-96171E6BEF50}.Debug|x86.ActiveCfg = Debug|x86
18-
{7824B57C-2545-4352-928B-96171E6BEF50}.Debug|x86.Build.0 = Debug|x86
1915
{7824B57C-2545-4352-928B-96171E6BEF50}.Release|Any CPU.ActiveCfg = Release|Any CPU
2016
{7824B57C-2545-4352-928B-96171E6BEF50}.Release|Any CPU.Build.0 = Release|Any CPU
21-
{7824B57C-2545-4352-928B-96171E6BEF50}.Release|x86.ActiveCfg = Release|x86
22-
{7824B57C-2545-4352-928B-96171E6BEF50}.Release|x86.Build.0 = Release|x86
2317
EndGlobalSection
2418
GlobalSection(SolutionProperties) = preSolution
2519
HideSolutionNode = FALSE
2620
EndGlobalSection
2721
GlobalSection(ExtensibilityGlobals) = postSolution
28-
SolutionGuid = {EF15013D-95D3-485B-A7C0-94AEF86F3723}
22+
SolutionGuid = {6EFEC0B6-EC46-4B05-9B87-9D2B0E275F38}
2923
EndGlobalSection
3024
EndGlobal

VB/Q273845/Form1.Designer.vb

+88-143
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

VB/Q273845/Form1.vb

+40-44
Original file line numberDiff line numberDiff line change
@@ -1,57 +1,53 @@
1-
Imports DevExpress.XtraGrid
1+
Imports DevExpress.XtraGrid
22
Imports DevExpress.XtraGrid.Views.Base
33
Imports DevExpress.XtraGrid.Views.Grid
44
Imports System
55
Imports System.Data
66
Imports System.Windows.Forms
77

88
Namespace Q273845
9-
Partial Public Class Form1
10-
Inherits Form
9+
Partial Public Class Form1
10+
Inherits Form
1111

12-
Public Sub New()
13-
InitializeComponent()
14-
End Sub
12+
Public Sub New()
13+
InitializeComponent()
14+
End Sub
1515

16-
Private Sub Form1_Load(ByVal sender As Object, ByVal e As EventArgs) Handles Me.Load
17-
productsBindingSource.DataSource = GetProductsDataTable()
18-
End Sub
16+
Private Sub Form1_Load(ByVal sender As Object, ByVal e As EventArgs) Handles Me.Load
17+
productsBindingSource.DataSource = GetProductsDataTable()
18+
End Sub
1919

20-
Private Function GetProductsDataTable() As DataTable
21-
Dim table As New DataTable()
22-
table.TableName = "Products"
23-
table.Columns.Add(New DataColumn("ProductName", GetType(String)))
24-
table.Columns.Add(New DataColumn("UnitsInStock", GetType(Integer)))
25-
table.Columns.Add(New DataColumn("UnitPrice", GetType(Double)))
26-
table.Columns.Add(New DataColumn("Category", GetType(String)))
27-
Dim random As New Random()
28-
For i As Integer = 0 To 19
29-
Dim index As Integer = i + 1
30-
table.Rows.Add("Product " & index, random.Next(1, 20), Math.Round(random.NextDouble() * 1000, 3), "Category " & i Mod 7)
31-
Next i
32-
Return table
33-
End Function
20+
Private Function GetProductsDataTable() As DataTable
21+
Dim table As DataTable = New DataTable()
22+
table.TableName = "Products"
23+
table.Columns.Add(New DataColumn("ProductName", GetType(String)))
24+
table.Columns.Add(New DataColumn("UnitsInStock", GetType(Integer)))
25+
table.Columns.Add(New DataColumn("UnitPrice", GetType(Double)))
26+
table.Columns.Add(New DataColumn("Category", GetType(String)))
27+
Dim random As Random = New Random()
28+
For i As Integer = 0 To 20 - 1
29+
Dim index As Integer = i + 1
30+
table.Rows.Add("Product " & index, random.[Next](1, 20), Math.Round(random.NextDouble() * 1000, 3), "Category " & i Mod 7)
31+
Next
32+
Return table
33+
End Function
3434

35-
Private Sub gridView1_CustomDrawFooterCell(ByVal sender As Object, ByVal e As FooterCellCustomDrawEventArgs) Handles gridView1.CustomDrawFooterCell
36-
If e.Column Is colPrice Then
37-
e.Info.DisplayText = (Convert.ToDecimal(colUnitPrice.SummaryItem.SummaryValue) * Convert.ToDecimal(colUnitsInStock.SummaryItem.SummaryValue)).ToString()
38-
End If
39-
End Sub
35+
Private Sub gridView1_CustomDrawFooterCell(ByVal sender As Object, ByVal e As FooterCellCustomDrawEventArgs) Handles gridView1.CustomDrawFooterCell
36+
If e.Column Is colPrice Then e.Info.DisplayText = (Convert.ToDecimal(colUnitPrice.SummaryItem.SummaryValue) * Convert.ToDecimal(colUnitsInStock.SummaryItem.SummaryValue)).ToString()
37+
End Sub
4038

41-
Private Sub gridView1_CustomDrawRowFooterCell(ByVal sender As Object, ByVal e As FooterCellCustomDrawEventArgs) Handles gridView1.CustomDrawRowFooterCell
42-
If e.Column Is colPrice Then
43-
Dim view As GridView = DirectCast(sender, GridView)
44-
e.Info.DisplayText = (Convert.ToDecimal(view.GetGroupSummaryValue(e.RowHandle, CType(view.GroupSummary("UnitPrice"), GridGroupSummaryItem))) * Convert.ToDecimal(view.GetGroupSummaryValue(e.RowHandle, CType(view.GroupSummary("UnitsInStock"), GridGroupSummaryItem)))).ToString()
45-
End If
46-
End Sub
39+
Private Sub gridView1_CustomDrawRowFooterCell(ByVal sender As Object, ByVal e As FooterCellCustomDrawEventArgs) Handles gridView1.CustomDrawRowFooterCell
40+
If e.Column Is colPrice Then
41+
Dim view As GridView = CType(sender, GridView)
42+
e.Info.DisplayText = (Convert.ToDecimal(view.GetGroupSummaryValue(e.RowHandle, CType(view.GroupSummary("UnitPrice"), GridGroupSummaryItem))) * Convert.ToDecimal(view.GetGroupSummaryValue(e.RowHandle, CType(view.GroupSummary("UnitsInStock"), GridGroupSummaryItem)))).ToString()
43+
End If
44+
End Sub
4745

48-
Private Sub gridView1_CustomUnboundColumnData(ByVal sender As Object, ByVal e As CustomColumnDataEventArgs) Handles gridView1.CustomUnboundColumnData
49-
Dim view As GridView = DirectCast(sender, GridView)
50-
If e.Column Is colPrice Then
51-
If e.IsGetData Then
52-
e.Value = Convert.ToDecimal(view.GetListSourceRowCellValue(e.ListSourceRowIndex, colUnitPrice)) * Convert.ToInt32(view.GetListSourceRowCellValue(e.ListSourceRowIndex, colUnitsInStock))
53-
End If
54-
End If
55-
End Sub
56-
End Class
57-
End Namespace
46+
Private Sub gridView1_CustomUnboundColumnData(ByVal sender As Object, ByVal e As CustomColumnDataEventArgs) Handles gridView1.CustomUnboundColumnData
47+
Dim view As GridView = CType(sender, GridView)
48+
If e.Column Is colPrice Then
49+
If e.IsGetData Then e.Value = Convert.ToDecimal(view.GetListSourceRowCellValue(e.ListSourceRowIndex, colUnitPrice)) * Convert.ToInt32(view.GetListSourceRowCellValue(e.ListSourceRowIndex, colUnitsInStock))
50+
End If
51+
End Sub
52+
End Class
53+
End Namespace

VB/Q273845/My Project/AssemblyInfo.vb

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
Imports System.Reflection
1+
Imports Microsoft.VisualBasic
2+
Imports System.Reflection
23
Imports System.Runtime.CompilerServices
34
Imports System.Runtime.InteropServices
45

0 commit comments

Comments
 (0)