如何让自定义DataGridViewCells Control 的自定义属性保存值的方法

    技术2022-05-11  8

    http://msdn.microsoft.com/zh-cn/library/system.windows.forms.datagridviewcell.clone.aspx

     

    把下述方法放到Inherits DataGridViewTextBoxCell 的类下面

     

    Private bindingSourceValue As BindingSource Public Property BindingSource() As BindingSource Get Return bindingSourceValue End Get Set(ByVal value As BindingSource) bindingSourceValue = value End Set End Property Public Overloads Overrides Function Clone() As Object Dim cell As DataGridViewMultiColumnComboboxCell = _ TryCast(MyBase.Clone(), DataGridViewMultiColumnComboboxCell) cell.bindingSourceValue = Me.bindingSourceValue Return cell End Function

     

     


    最新回复(0)