Infragistics(R) NetAdvantage(R) Windows Forms
Editor Property
See Also  Example E-mail your feedback on this topic.
Infragistics.Win.UltraWinGrid Namespace > UltraGridColumn Class : Editor Property

Gets or sets the editor that this column will use for editing and displaying cells. By default or when it's assigned null it will get the editor from the EditorControl property.

Syntax

Visual Basic (Declaration) 
Public Property Editor As Infragistics.Win.EmbeddableEditorBase
C# 
public Infragistics.Win.EmbeddableEditorBase Editor {get; set;}

Example

Following code shows you how to set the Editor and EditorControl properties. You can set Editor or EditorContol property of a column to change the editor that the column uses to edit its cells. The difference is that Editor property takes an instance of EmbeddableEditorBase while EditorControl takes an instance of Control. With EditorControl, you can put one of the editor controls like UltraCurrencyEditor on the form and assign that to the column's EditorControl property. NOTE: The control assigned to EditorControl must implement IProvidesEmbeddableEditor interface othewise set of the EditorControl will throw an exception.

Visual BasicCopy Code
Imports Infragistics.Shared
Imports Infragistics.Win
Imports Infragistics.Win.UltraWinGrid

  Private Sub Button95_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles button95.Click

      ' Create an embeddable editor and assign it to OrderDate and ShipDate columns. The UltraGrid
      ' by default uses DateTimeEditor for editing and rendering date cells. You can change this
      ' by setting the Editor property to a different editor.
      Dim textEditor As EditorWithText = New EditorWithText()
      Me.UltraGrid1.DisplayLayout.Bands(1).Columns("OrderDate").Editor = textEditor
      Me.UltraGrid1.DisplayLayout.Bands(1).Columns("ShippedDate").Editor = textEditor

      ' You can also do the same by setting the EditorControl property. UltraCurrencyEditor1 member
      ' variable is UltraCurrencyEditor control put on the form through the designer.
      Me.UltraGrid1.DisplayLayout.Bands(2).Columns("Unit Price").EditorControl = Me.UltraCurrencyEditor1

  End Sub
C#Copy Code
using Infragistics.Shared;
using Infragistics.Win;
using Infragistics.Win.UltraWinGrid;
using System.Diagnostics;

private void button95_Click(object sender, System.EventArgs e)
{		

	// Create an embeddable editor and assign it to OrderDate and ShipDate columns. The UltraGrid
	// by default uses DateTimeEditor for editing and rendering date cells. You can change this
	// by setting the Editor property to a different editor.
	EditorWithText textEditor = new EditorWithText( );
	this.ultraGrid1.DisplayLayout.Bands[1].Columns["OrderDate"].Editor = textEditor;
	this.ultraGrid1.DisplayLayout.Bands[1].Columns["ShippedDate"].Editor = textEditor;

	// You can also do the same by setting the EditorControl property. UltraCurrencyEditor1 member
	// variable is UltraCurrencyEditor control put on the form through the designer.
	this.ultraGrid1.DisplayLayout.Bands[2].Columns["Unit Price"].EditorControl = this.ultraCurrencyEditor1;

}

See Also