winform C/S开发程序求通过全选和反选按钮获取datagridview中checkbox值,谢谢!
求winform C/S开发程序通过全选和反选按钮获取datagridview中checkbox值,谢谢! --------------------编程问答-------------------- 全选时,把所有的ChenckBox的Check属性设为True就行了啊
相反设为False --------------------编程问答-------------------- http://bbs.csdn.net/topics/110007587 --------------------编程问答-------------------- ''' <summary>
''' 对DGV的CheckBox列填充值
''' </summary>
''' <param name="dgvDataGridView">DataGridView</param>
''' <param name="strFiled">列名称</param>
''' <param name="strType">T:True;F:False</param>
''' <remarks></remarks>
Public Sub FillAllInDgv(ByVal dgvDataGridView As DataGridView, ByVal strFiled As String, ByVal strType As String)
If (dgvDataGridView.RowCount > 0) Then
For i As Integer = 0 To dgvDataGridView.RowCount - 1
Select Case strType
Case "T"
dgvDataGridView.Rows(i).Cells(strFiled).Value = True
Case "F"
dgvDataGridView.Rows(i).Cells(strFiled).Value = False
End Select
Next
dgvDataGridView.EndEdit()
End If
End Sub
这样可以不?
补充:.NET技术 , VB.NET