control/DataGridViewMultiColumnComboBoxColumn.vb

(开头部分) 15KB

这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。

''' <summary>
''' 多栏comboBox列
''' 要求数据源为DataTable或者集合成员实现了IList接口
''' </summary>
Public Class DataGridViewMultiColumnComboBoxColumn
    Inherits DataGridViewComboBoxColumn

    Private m_ColumnWidths As String '栏目宽度字串:100;150;200等
    Private m_ColumnTitles As String '栏目标题字串:Name;Code;Sexy等
    Private m_ColumnNames As String '栏目成员名称:Name;Code;Sexy等,如果是类,则是类中属性,如果是table,则是字段名称
    Private m_ColumnIndexs As String '栏目成员所在索引IList接口实现;如0;1;3等
    Private m_SelectedValue2 As Object '所选行的第二个返回值。由第二个返回索引指定,此属性和下面属性配合使用,在EditingControl的selectedItem中赋值
    Private m_SelectedIndex2 As Int32 '所选行的第二个返回值索引。

    Private m_SelectedIndex As Int32 '保存editingControl选择的索引

    Public Delegate Sub HotKeyCallBack()
    Shared m_DelegateCallBack As HotKeyCallBack

    Public Sub New()
        'MyBase.New(New DataGridViewMultiColumnComboBoxCell)
        Me.CellTemplate = New DataGridViewMultiColumnComboBoxCell()
        m_SelectedIndex2 = -1
        Me.DisplayStyle = DataGridViewComboBoxDisplayStyle.Nothing

        'Debug.Print("New, cellTemplate = ")

    End Sub

    'Public Overrides 

    'CellTemplate
    Public Overrides Property CellTemplate As DataGridViewCell
        Get
            Return MyBase.CellTemplate
        End Get
        Set(value As DataGridViewCell)
            '确保value是datagridviewmulticolumncomboboxcell类
            If (value IsNot Nothing) AndAlso
                Not value.GetType().IsAssignableFrom(GetType(DataGridViewMultiColumnComboBoxCell)) _
                Then
                Throw New InvalidCastException("Must be a DataGridViewMultiColumnComboBoxCell")
            End If
            MyBase.CellTemplate = value
        End Set
    End Property

    <System.ComponentModel.Browsable(True), System.ComponentModel.Description("各栏的宽度值,以分号分隔。")>
    Public Property ColumnWidths As String
        Get
            Return m_ColumnWidths
        End Get
        Set(value As String)
            m_ColumnWidths = value
        End Set
    End Property

    <System.ComponentModel.Browsable(True), System.ComponentModel.Description("各栏的标题,以分号分隔。")>
    Public Property ColumnTitles As String
        Get
后面还有 388 行代码,解锁后查看完整代码

24 小时内免费解锁 3 个项目,之后 1 积分/个。 规则说明

AI 解读

登录后可用,每次 10 积分,解读结果公开显示在下面。

还没有人解读过这个文件。