InputManCell を継承して独自のセル型を作成できますか?

文書番号 : 29166     文書種別 : 技術情報     最終更新日 : 2010/05/19
文書を印刷する
対象製品
MultiRow for Windows Forms 6.0J
詳細
InputManCell および InputManCell のセル編集コントロールの両方が継承可能です。たとえば、InputMan の GcDate コントロールを継承して独自のコントロールを作成している場合、MultiRow では GcDateEditingControl を継承してこれを Cell.EditType プロパティから返します。

[Visual Basic]
Imports InputManCell = GrapeCity.Win.MultiRow.InputMan

Public Class MyDateEditingControl
  Inherits InputManCell.GcDateEditingControl

End Class

Public Class MyDateCell
  Inherits InputManCell.GcDateCell

  Public Sub New()
    MyBase.New()
  End Sub

  Public Sub New(ByVal autoGenerateFieldsAndSideButtons As Boolean)
    MyBase.New(autoGenerateFieldsAndSideButtons)
  End Sub

  Public Overrides ReadOnly Property EditType() As System.Type
    Get
      Return GetType(MyDateEditingControl)
    End Get
  End Property
End Class


[C#]
using InputManCell = GrapeCity.Win.MultiRow.InputMan;

ublic class MyDateEditingControl : InputManCell.GcDateEditingControl
{
}

public class MyDateCell : InputManCell.GcDateCell
{
  public MyDateCell() : base()
  {
  }

  public MyDateCell(bool autoGenerateFieldsAndSideButtons)
    : base(autoGenerateFieldsAndSideButtons)
  {

  }

  public override Type EditType
  {
    get
    {
      return typeof(MyDateEditingControl);
    }
  }
}


InputMan の GcDate コントロールを継承して独自のコントロールを Cell.EditType から返すには、このコントロールに IEditingControl インターフェイスを実装する必要があります。通常は、IEditingControl インターフェイスを実装済みの GcDateEditingControl などを使用することをお勧めします。

この文書は、以前は次のFAQ IDで公開されていました : 13224