バージョン

TemplateAddRowPrompt プロパティ

このプロパティは、追加行に表示するプロンプト テキストを指定します。デフォルトでは、プロンプトは表示されません。プロンプトは追加行がアクティブになると消えます (アクティブ状態でなくなると再び表示されます)。このテキストは複数のセルにまたがって表示されます。ただし、UltraGridBand.SpecialRowPromptField が有効な列キーに設定されている場合は、関連付けられたセルに表示されます。
シンタックス
'宣言
 
Public Property TemplateAddRowPrompt As String
public string TemplateAddRowPrompt {get; set;}
解説

このプロパティは、追加行に表示するプロンプト テキストを指定します。プロンプトは追加行がアクティブになると消えます (アクティブ状態でなくなると再び表示されます)。このテキストは、UltraGridBand.SpecialRowPromptField プロパティが有効な列キーに設定されている場合を除き、複数のセルにまたがって表示されます。

使用例
Imports Infragistics.Shared
Imports Infragistics.Win
Imports Infragistics.Win.UltraWinGrid


    Private Sub UltraGrid1_InitializeLayout(ByVal sender As Object, ByVal e As Infragistics.Win.UltraWinGrid.InitializeLayoutEventArgs) Handles UltraGrid1.InitializeLayout
        ' Setting the AllowAddNew to TemplateOnBottom, TemplateOnTop or TemplateOnTopWithTabRepeat
        ' turns on the add-row functionality.
        Me.UltraGrid1.DisplayLayout.Override.AllowAddNew = AllowAddNew.TemplateOnBottom

        ' You can use the TemplateAddRowAppearance to set the appearance of template add-rows.
        Me.UltraGrid1.DisplayLayout.Override.TemplateAddRowAppearance.BackColor = Color.Blue
        Me.UltraGrid1.DisplayLayout.Override.TemplateAddRowAppearance.ForeColor = Color.Yellow

        ' You can also use the TemplateAddCellRowAppearance to set the appearance of cells in
        ' the template add-rows.
        Me.UltraGrid1.DisplayLayout.Override.TemplateAddRowCellAppearance.BackColor = Color.Blue
        Me.UltraGrid1.DisplayLayout.Override.TemplateAddRowCellAppearance.ForeColor = Color.Yellow

        ' You can use the AddRowAppearance to set the appearance of add-row. A template add-row
        ' becomes an add-row when the user enters the edit mode and types something in a template
        ' add-row.
        Me.UltraGrid1.DisplayLayout.Override.AddRowAppearance.BackColor = Color.DarkRed
        Me.UltraGrid1.DisplayLayout.Override.AddRowAppearance.ForeColor = Color.Orange

        ' You can use the AddRowCellAppearance to set the appearance of cells in the add-rows.
        Me.UltraGrid1.DisplayLayout.Override.AddRowCellAppearance.BackColor = Color.DarkRed
        Me.UltraGrid1.DisplayLayout.Override.AddRowCellAppearance.ForeColor = Color.Orange

        ' You can also control the spacing before and after the template add-rows.
        Me.UltraGrid1.DisplayLayout.Override.TemplateAddRowSpacingBefore = 5
        Me.UltraGrid1.DisplayLayout.Override.TemplateAddRowSpacingAfter = 5

        ' You can also specify a different border style for template add-rows to distinguish
        ' them from the regular rows.
        Me.UltraGrid1.DisplayLayout.Override.BorderStyleTemplateAddRow = UIElementBorderStyle.Raised

        ' Use the DefaultCellValue property of the column to specify the default values that
        ' should be assigned to the add-row.
        Me.UltraGrid1.DisplayLayout.Bands(0).Columns(0).DefaultCellValue = "(Empty)"

        ' You can display a prompt in the add-row by setting the TemplateAddRowPrompt 
        ' proeprty. By default UltraGrid does not display any add-row prompt.
        e.Layout.Override.TemplateAddRowPrompt = "Click here to add a new record..."

        ' You can control the appearance of the prompt using the Override's
        ' TemplateAddRowPromptAppearance property. By default the prompt is
        ' transparent. You can make it non-transparent by setting the appearance'
        ' BackColorAlpha property or by setting the BackColor to a desired value.
        e.Layout.Override.TemplateAddRowPromptAppearance.ForeColor = Color.Maroon
        e.Layout.Override.TemplateAddRowPromptAppearance.FontData.Bold = DefaultableBoolean.True

        ' By default the prompt is displayed across multiple cells. You can confine
        ' the prompt a particular cell by setting the SpecialRowPromptField property
        ' of the band to the key of the column that you want to display the prompt in.
        e.Layout.Bands(0).SpecialRowPromptField = e.Layout.Bands(0).Columns(1).Key

    End Sub
using Infragistics.Shared;
using Infragistics.Win;
using Infragistics.Win.UltraWinGrid;
using System.Diagnostics;


		private void ultraGrid1_InitializeLayout(object sender, Infragistics.Win.UltraWinGrid.InitializeLayoutEventArgs e)
		{
			// Setting the AllowAddNew to TemplateOnBottom, TemplateOnTop or TemplateOnTopWithTabRepeat
			// turns on the add-row functionality.
			this.ultraGrid1.DisplayLayout.Override.AllowAddNew = AllowAddNew.TemplateOnBottom;
			
			// You can use the TemplateAddRowAppearance to set the appearance of template add-rows.
			this.ultraGrid1.DisplayLayout.Override.TemplateAddRowAppearance.BackColor = Color.Blue;
			this.ultraGrid1.DisplayLayout.Override.TemplateAddRowAppearance.ForeColor = Color.Yellow;

			// You can also use the TemplateAddCellRowAppearance to set the appearance of cells in
			// the template add-rows.
			this.ultraGrid1.DisplayLayout.Override.TemplateAddRowCellAppearance.BackColor = Color.Blue;
			this.ultraGrid1.DisplayLayout.Override.TemplateAddRowCellAppearance.ForeColor = Color.Yellow;

			// You can use the AddRowAppearance to set the appearance of add-row. A template add-row
			// becomes an add-row when the user enters the edit mode and types something in a template
			// add-row.
			this.ultraGrid1.DisplayLayout.Override.AddRowAppearance.BackColor = Color.DarkRed;
			this.ultraGrid1.DisplayLayout.Override.AddRowAppearance.ForeColor = Color.Orange;

			// You can use the AddRowCellAppearance to set the appearance of cells in the add-rows.
			this.ultraGrid1.DisplayLayout.Override.AddRowCellAppearance.BackColor = Color.DarkRed;
			this.ultraGrid1.DisplayLayout.Override.AddRowCellAppearance.ForeColor = Color.Orange;

			// You can also control the spacing before and after the template add-rows.
			this.ultraGrid1.DisplayLayout.Override.TemplateAddRowSpacingBefore = 5;
			this.ultraGrid1.DisplayLayout.Override.TemplateAddRowSpacingAfter  = 5;

			// You can also specify a different border style for template add-rows to distinguish
			// them from the regular rows.
			this.ultraGrid1.DisplayLayout.Override.BorderStyleTemplateAddRow = UIElementBorderStyle.Raised;

			// Use the DefaultCellValue property of the column to specify the default values that
			// should be assigned to the add-row.
			this.ultraGrid1.DisplayLayout.Bands[0].Columns[0].DefaultCellValue = "(Empty)";

			// You can display a prompt in the add-row by setting the TemplateAddRowPrompt 
			// proeprty. By default UltraGrid does not display any add-row prompt.
			e.Layout.Override.TemplateAddRowPrompt = "Click here to add a new record...";

			// You can control the appearance of the prompt using the Override's
			// TemplateAddRowPromptAppearance property. By default the prompt is
			// transparent. You can make it non-transparent by setting the appearance'
			// BackColorAlpha property or by setting the BackColor to a desired value.
			e.Layout.Override.TemplateAddRowPromptAppearance.ForeColor = Color.Maroon;
			e.Layout.Override.TemplateAddRowPromptAppearance.FontData.Bold = DefaultableBoolean.True;

			// By default the prompt is displayed across multiple cells. You can confine
			// the prompt a particular cell by setting the SpecialRowPromptField property
			// of the band to the key of the column that you want to display the prompt in.
			e.Layout.Bands[0].SpecialRowPromptField = e.Layout.Bands[0].Columns[1].Key;
		}
参照