Version

Style Property (AddNewBox)

Returns or sets a value that determines the AddNew box's display style.
Syntax
'Declaration
 
Public Property Style As AddNewBoxStyle
public AddNewBoxStyle Style {get; set;}
Remarks

This property specifies the display style of the AddNew box. When set to 0 (AddNewBoxStyleFull) the full AddNew Box will be displayed, with the arrangement of the buttons corresponding to the the hierarchical relationships of the bands in the grid. When the 1 (AddNewBoxStyleCompact) setting is used, the AddNew Box will be displayed using as little real estate as possible while still maintaining a visually acceptable appearance.

Note that in the compact view the AddNew buttons appear in the same horizontal row, regardless of the hierarchical structure. Buttons for sibling bands do not necessarily appear adjacent to one another; if a band has child bands, their AddNew buttons will appear immediately following that of their parent band.

Example
Following code configures the look of add-new-box in the ultragrid. Add-new-box allows easy adding of rows by clicking on add new buttons in it. Each add new button in add-new-box corresponds to a band in the ultragrid.

Imports Infragistics.Shared
Imports Infragistics.Win
Imports Infragistics.Win.UltraWinGrid

  Private Sub Button3_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles button3.Click

      ' Make the addnew box visible.
      Me.UltraGrid1.DisplayLayout.AddNewBox.Hidden = False

      ' Change the prompt on the add new box.
      Me.UltraGrid1.DisplayLayout.AddNewBox.Prompt = "Add a new row"

      ' Make the add new box compact to save space.
      Me.UltraGrid1.DisplayLayout.AddNewBox.Style = AddNewBoxStyle.Compact

      ' Set the back color of the add new box area and set the border style to etched.
      Me.UltraGrid1.DisplayLayout.AddNewBox.Appearance.BackColor = Color.White
      Me.UltraGrid1.DisplayLayout.AddNewBox.BorderStyle = UIElementBorderStyle.Etched

      ' Configure the way button connectors look
      Me.UltraGrid1.DisplayLayout.AddNewBox.ButtonConnectorStyle = UIElementBorderStyle.Etched
      Me.UltraGrid1.DisplayLayout.AddNewBox.ButtonConnectorColor = Color.Red

      ' Configure the way buttons look.
      ' Set the buttons' style to PopupSoft and set the appearance of the buttons.
      Me.UltraGrid1.DisplayLayout.AddNewBox.ButtonStyle = UIElementButtonStyle.PopupSoft
      Me.UltraGrid1.DisplayLayout.AddNewBox.ButtonAppearance.BackColor = Color.SkyBlue
      Me.UltraGrid1.DisplayLayout.AddNewBox.ButtonAppearance.BackColor2 = Color.Blue
      Me.UltraGrid1.DisplayLayout.AddNewBox.ButtonAppearance.BackGradientStyle = GradientStyle.Horizontal

      ' You can also customize the caption of the buttons that show up in the add-new-box.
      ' Each band has a button in the add-new-box. You can change the caption of these
      ' buttons by setting the AddButtonCaption property off the bands. You can also set
      ' the tool-tip text for those buttons as well by setting AddButtonToolTipText property.
      Me.UltraGrid1.DisplayLayout.Bands("Customers").AddButtonCaption = "New Customer"
      Me.UltraGrid1.DisplayLayout.Bands("Customers").AddButtonToolTipText = "Click to add a new Customers record."

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

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

	// Make the addnew box visible.
	this.ultraGrid1.DisplayLayout.AddNewBox.Hidden = false;

	// Change the prompt on the add new box.
	this.ultraGrid1.DisplayLayout.AddNewBox.Prompt = "Add a new row";
          
	// Make the add new box compact to save space.
	this.ultraGrid1.DisplayLayout.AddNewBox.Style = AddNewBoxStyle.Compact;
	
	// Set the back color of the add new box area and set the border style to etched.
	this.ultraGrid1.DisplayLayout.AddNewBox.Appearance.BackColor = Color.White;
	this.ultraGrid1.DisplayLayout.AddNewBox.BorderStyle = UIElementBorderStyle.Etched;

	// Configure the way button connectors look
	this.ultraGrid1.DisplayLayout.AddNewBox.ButtonConnectorStyle = UIElementBorderStyle.Etched;
	this.ultraGrid1.DisplayLayout.AddNewBox.ButtonConnectorColor = Color.Red;
	
	// Configure the way buttons look.
	// Set the buttons' style to PopupSoft and set the appearance of the buttons.
	this.ultraGrid1.DisplayLayout.AddNewBox.ButtonStyle = UIElementButtonStyle.PopupSoft;
	this.ultraGrid1.DisplayLayout.AddNewBox.ButtonAppearance.BackColor = Color.SkyBlue;
	this.ultraGrid1.DisplayLayout.AddNewBox.ButtonAppearance.BackColor2 = Color.Blue;
	this.ultraGrid1.DisplayLayout.AddNewBox.ButtonAppearance.BackGradientStyle = GradientStyle.Horizontal;

	// You can also customize the caption of the buttons that show up in the add-new-box.
	// Each band has a button in the add-new-box. You can change the caption of these
	// buttons by setting the AddButtonCaption property off the bands. You can also set
	// the tool-tip text for those buttons as well by setting AddButtonToolTipText property.
	this.ultraGrid1.DisplayLayout.Bands["Customers"].AddButtonCaption = "New Customer";
	this.ultraGrid1.DisplayLayout.Bands["Customers"].AddButtonToolTipText = "Click to add a new Customers record.";

}
Requirements

Target Platforms: Windows 10, Windows 8.1, Windows 8, Windows 7, Windows Server 2012, Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

See Also