Private Sub setdgdDokyuStyle()
Dim lv_DataTable_Program As New DataTable
Dim lv_DataView_Program As DataView
Dim lv_DataColumn_Check As New DataColumn("選択", GetType(Boolean)) '選択
Dim lv_DataColumn_Num As New DataColumn("内容", GetType(String)) '内容
Dim ts As New DataGridTableStyle
Dim tc As DataGridTextBoxColumn
Dim tb As DataGridBoolColumn
Dim style As New DataGridTableStyle
style.AllowSorting = False
style.MappingName = Me._datatableDetail.TableName
Dim count As Integer = CType(grdDispList.DataSource, DataView).Table.Columns.Count
Dim i As Integer
Dim colCap() As String = {"客户编码", "客户名称", "收款日期", "往来编号", "本次收款金额", "类型", "状态", "备注"}
Dim colWidth() As Integer = {70, 100, 70, 70, 70, 50, 70, 80}
For i = 0 To count - 1
Select Case i
Case 0
Dim c As New DataGridBoolColumn
c.MappingName = "Isselect"
c.HeaderText = "是否选入"
c.Width = 60
c.AllowNull = False
style.GridColumnStyles.Add(c)
Case 1, 2, 3, 4, 5, 6, 7, 8
Dim c As New DataGridTextBoxColumn
c.MappingName = CType(grdDispList.DataSource, DataView).Table.Columns(i - 1).ColumnName
c.HeaderText = colCap(i - 1)
c.NullText = ""
c.Width = colWidth(i - 1)
c.ReadOnly = True
style.GridColumnStyles.Add(c)
End Select
Next