Namespace BogartMis.Cls
Public Class gGrid
'設定表格控的列標題的別名
'說明:strItem字符串的格式為"01,02,03,04,05" 其中[01]這個字符串中不得包含特定符號
'特定符號: # / . - * 等
Public Overloads Sub setGridColCaption(ByVal g As DataTable, ByVal strItem As String)
Try
Dim myArray As String() = Split(strItem.Trim, ",")
Dim i As Integer
For i = To myArray.GetUpperBound()
g.Columns(i).ColumnName = myArray(i)
Next
Catch ex As Exception
End Try
End Sub Public Sub setAutoColumnsWidth(ByVal grid As C1.Win.C1TrueDBGrid.C1TrueDBGrid)
Try
With grid
Dim i As Integer
For i = To .Columns.Count -
If .Splits().DisplayColumns(i).Visible = True Then
.Splits().DisplayColumns(i).AutoSize()
End If
Next
End With
Catch ex As Exception
End Try
End Sub Public Sub setAutoColumnsWidth(ByVal grid As myDataGrid.myDatagrid)
Try
With grid
Dim i As Integer
For i = To .Columns.Count -
If .Splits().DisplayColumns(i).Visible = True Then
.Splits().DisplayColumns(i).AutoSize()
End If
Next
End With
Catch ex As Exception
End Try
End Sub Public Sub setReportStyle(ByVal grid As myDataGrid.myDatagrid)
Try
With grid
.AllowDelete = False
.AllowUpdate = False
.Splits().ExtendRightColumn = True
.MultiSelect = C1.Win.C1TrueDBGrid.MultiSelectEnum.Simple
.MarqueeStyle = C1.Win.C1TrueDBGrid.MarqueeEnum.HighlightRow
.BackColor = Color.WhiteSmoke
.EvenRowStyle.BackColor = Color.AliceBlue
.FilterBarStyle.BackColor = Color.PowderBlue
.FilterBar = True
.WindowLaguage = g.gLanguage
.Font = New System.Drawing.Font("Courier New", )
End With
Catch ex As Exception
End Try
End Sub Public Sub setEditStyle5(ByVal grid As myDataGrid.myDatagrid) ''Add by Bendy on 2011/04/11
Try
With grid
.AllowDelete = True
.AllowSort = True
.Splits().AlternatingRowStyle = True
.EmptyRows = False
.BorderStyle = BorderStyle.Fixed3D
.HeadingStyle.BackColor = Color.DarkSeaGreen
.HeadingStyle.Borders.BorderType = C1.Win.C1TrueDBGrid.BorderTypeEnum.Flat
.RowDivider.Style = C1.Win.C1TrueDBGrid.LineStyleEnum.Single
.EvenRowStyle.BackColor = Color.AliceBlue
.BackColor = Color.Linen
.RecordSelectorStyle.BackColor = Color.LightGray
.RecordSelectorStyle.Borders.BorderType = C1.Win.C1TrueDBGrid.BorderTypeEnum.Groove
.TabAcrossSplits = True
.TabAction = C1.Win.C1TrueDBGrid.TabActionEnum.GridNavigation
.AllowAddNew = True
.AllowUpdate = True
.MarqueeStyle = C1.Win.C1TrueDBGrid.MarqueeEnum.HighlightRowRaiseCell
.FooterStyle = .HeadingStyle
.FlatStyle = C1.Win.C1TrueDBGrid.FlatModeEnum.Flat
.EmptyRows = False
.Splits().ExtendRightColumn = True
.Splits().AlternatingRowStyle = True
.WindowLaguage = g.gLanguage
.Font = New System.Drawing.Font("Courier New", )
End With
Catch ex As Exception
End Try
End Sub
Public Sub setQueryStyle5(ByVal grid As myDataGrid.myDatagrid) ''Add by Bendy on 2011/04/11
Try
With grid
.AllowDelete = False
.AllowSort = True
.Splits().AlternatingRowStyle = True
.EmptyRows = False
.BorderStyle = BorderStyle.Fixed3D
.HeadingStyle.BackColor = Color.DarkSeaGreen
.HeadingStyle.Borders.BorderType = C1.Win.C1TrueDBGrid.BorderTypeEnum.Flat
.RowDivider.Style = C1.Win.C1TrueDBGrid.LineStyleEnum.Single
.EvenRowStyle.BackColor = Color.AliceBlue
.BackColor = Color.Linen
.RecordSelectorStyle.BackColor = Color.LightGray
.RecordSelectorStyle.Borders.BorderType = C1.Win.C1TrueDBGrid.BorderTypeEnum.Groove
.TabAcrossSplits = True
.TabAction = C1.Win.C1TrueDBGrid.TabActionEnum.GridNavigation
.AllowAddNew = False
.AllowUpdate = False
.MarqueeStyle = C1.Win.C1TrueDBGrid.MarqueeEnum.HighlightRowRaiseCell
.FooterStyle = .HeadingStyle
.FlatStyle = C1.Win.C1TrueDBGrid.FlatModeEnum.Flat
.EmptyRows = False
.Splits().ExtendRightColumn = True
.Splits().AlternatingRowStyle = True
.WindowLaguage = g.gLanguage
.Font = New System.Drawing.Font("Courier New", )
End With
Catch ex As Exception
End Try
End Sub Public Function getDataView(ByVal grid As C1.Win.C1TrueDBGrid.C1TrueDBGrid) As DataView
Try
Dim DataV As New DataView
If TypeOf grid.DataSource Is DataView Then
DataV = CType(grid.DataSource, DataView)
ElseIf TypeOf grid.DataSource Is DataSet Then
DataV = CType(grid.DataSource, DataSet).Tables().DefaultView
ElseIf TypeOf grid.DataSource Is DataTable Then
DataV = CType(grid.DataSource, DataTable).DefaultView
End If
Return DataV
Catch ex As Exception
System.Console.WriteLine(ex.ToString)
End Try
End Function Public Function getCurrData(ByVal grid As C1.Win.C1TrueDBGrid.C1TrueDBGrid) As DataTable
Try
Dim DataV As New DataView
If TypeOf grid.DataSource Is DataView Then
DataV = CType(grid.DataSource, DataView)
ElseIf TypeOf grid.DataSource Is DataSet Then
DataV = CType(grid.DataSource, DataSet).Tables().DefaultView
ElseIf TypeOf grid.DataSource Is DataTable Then
DataV = CType(grid.DataSource, DataTable).DefaultView
End If
Dim netRow As DataRowView
Dim newTable As DataTable = DataV.Table.Clone
For Each netRow In DataV
newTable.Rows.Add(netRow.Row.ItemArray)
Next
Return newTable
Catch ex As Exception
System.Console.WriteLine(ex.ToString)
End Try
End Function Public Sub setColumnCombo(ByVal DataColumn As C1.Win.C1TrueDBGrid.C1DataColumn, ByVal SQL As String, ByVal aConn As OleDb.OleDbConnection)
Try
With DataColumn.ValueItems
Dim netTable As DataTable = gData.GetDataTable(SQL, aConn)
Dim netRow As DataRow
For Each netRow In netTable.Rows
Dim item As New C1.Win.C1TrueDBGrid.ValueItem
item.Value = netRow.Item()
If netTable.Columns.Count > Then
item.DisplayValue = netRow.Item()
Else
item.DisplayValue = netRow.Item()
End If
.Values.Add(item)
Next
.Translate = True
.Presentation = C1.Win.C1TrueDBGrid.PresentationEnum.ComboBox
End With
Catch ex As Exception
System.Console.WriteLine(ex.ToString)
End Try
End Sub End Class End Namespace

Bogart gGrid.vb的更多相关文章

  1. Bogart BogartPublic.vb

    Imports System.Data.SqlClient Imports System.Data #Region "IBogartToolbar,請勿隨便更改" Interfac ...

  2. Bogart SysPwd.vb

    Module syspwd Public Const STR_MASK = "MyFunction" '加密用字串 '預定義密碼長度 Public GintCheckPwd As ...

  3. Bogart gSub.vb

    '--------------Job No 0900408 -------------- '--DIM PART ONE ONLINE Update Order Qty '''主要新加過程名 Refr ...

  4. Bogart gData.vb

    Imports System Imports System.Data Imports System.Data.OleDb Imports Microsoft.VisualBasic Imports S ...

  5. Bogart BogartAutoCode.vb

    Imports System.Data.SqlClient Imports System.Data Public Class BogartAutoCodeDataBase Private Conn A ...

  6. Bogart gFunction.vb

    Module gFunction '其它不是常用的方法及函數 #Region " 將指定的數據格式轉換為英文格式" Public Function EnglishFormat(By ...

  7. [转载]C#中MessageBox.Show用法以及VB.NET中MsgBox用法

    一.C#中MessageBox.Show用法 MessageBox.Show (String) 显示具有指定文本的消息框. 由 .NET Compact Framework 支持. MessageBo ...

  8. VB.NET设置控件和窗体的显示级别

    前言:在用VB.NET开发射频检测系统ADS时,当激活已存在的目标MDI子窗体时,被其他子窗体遮住了,导致目标MDI子窗体不能显示. 这个问题怎么解决呢?网上看到一篇帖子VB.NET设置控件和窗体的显 ...

  9. 用VB脚本批到导入字段到PowerDesigner

    在PowerDesigner使用脚本批量导入excel中记录的表结构信息,由于需要通过powerdesigner逆向工程创建一些sybase IQ的表,由于是接口数据,只有excel表,手动导入太耗时 ...

随机推荐

  1. [LeetCode&Python] Problem 832. Flipping an Image

    Given a binary matrix A, we want to flip the image horizontally, then invert it, and return the resu ...

  2. Laravel学习之旅(二)

    控制器 一.怎么编写控制器? 1.控制器文件存放路径:app\Http\Controllers: 2.命名规范如:TestController.php 3.完整的控制器例子如下: <?php n ...

  3. JQuery输入框获取/失去焦点行为

    //搜索框获取焦点清除内容 $(function() { $("input").focus(function() { //获取焦点,清空默认内容 $(this).css('colo ...

  4. [转]G++与GCC的区别

    转自http://www.52pojie.cn/thread-58109-1-1.html 误区一:gcc只能编译c代码,g++只能编译c++代码两者都可以,但是请注意:1.后缀为.c的,gcc把它当 ...

  5. test20180921 手机信号

    题意 分析 我们用形如(l, r, v) 的三元组描述一个区间,这个区间中从l 到r 每隔v 有一个信号站. 考虑一次construct 操作,会添加一个新的区间,并可能将一个已经存在的区间分裂为两个 ...

  6. day3 自动部署安装软件到其他的机器设备上

    PS:原理是在本机创建boot.sh指向每一台主机,使用脚本命令去执行,然后就会自动安装软件 PS:boot.sh里面放着1.免密登录 2.发送每台机器install.sh 这个install.sh中 ...

  7. stenciljs ionic 团队开发的方便web 组件框架

    stenciljs 是ionic 团队开发的方便组件话开发的js 框架,具体以下特点 简单,零配置,简单的api,typescript 支持 性能,压缩之后6Kb,支持ssr,以及强大的原生web c ...

  8. Android 第三方分享中遇到的问题以及解决方式

    版权声明:本文为博主原创文章,未经博主同意不得转载. https://blog.csdn.net/liuxian13183/article/details/36189343               ...

  9. 树莓派3代B型 Raspberry Pi Model 3 B 安装 centos7系统

    板子类型: Raspberry Pi Model 3 B 搭配 32G的SD卡: 下载支持树莓派版本的centos7系统 https://buildlogs.centos.org/centos/7/i ...

  10. 【python】class之类的内建函数