New to Telerik UI for ASP.NET AJAX? Start a free 30-day trial

Settings for the edit forms generated by a GridTableView for each item that is in edit mode and the EditMode is set to EditForms.

Set the type of the EditForm using EditFormType. If the type is AutoGenerated then the form will be autogenerated based on the columns of the corresponding table view. Note that only the columns that are editable wil be included. Those are the standatrd columns that have editing capabilities - such GridBoundColumn that has ReadOnly set to false. All the style properties apply only to the autogenerated edit form. See GridEditFormType for more details on the types of the edit forms.

Definition

Namespace:Telerik.Web.UI

Assembly:Telerik.Web.UI.dll

Syntax:

C#
[SuppressMessage("Microsoft.Design", "CA1001:TypesThatOwnDisposableFieldsShouldBeDisposable")]
[TypeConverter(typeof(ExpandableObjectConverter))]
public class GridEditFormSettings : IStateManager

Inheritance: objectGridEditFormSettings

Implements: IStateManager

Inherited Members object.ToString()object.Equals(object)object.Equals(object, object)object.ReferenceEquals(object, object)object.GetHashCode()object.GetType()object.MemberwiseClone()...

Constructors

C#
public GridEditFormSettings(GridTableView owner)
Parameters:ownerGridTableView

Properties

The caption for the table which holds all cells created from the grid column editors.

C#
public string AutoGeneratedColumnEditorsTableWrapperCaption { get; set; }

The summary attribute for the table which holds all cells created from the grid column editors.

C#
public string AutoGeneratedColumnEditorsTableWrapperSummary { get; set; }

Data field to incude in form's caption

C#
public virtual string CaptionDataField { get; set; }

Caption format string - {0} parameter must be included and would be repaced with DataField value

C#
public virtual string CaptionFormatString { get; set; }

Number of vertical columns to split all edit fields on the form when it is autogenerated. Each GridColumn has a EditFormColumnIndex to choose the column where the editor would appear.

C#
public int ColumnNumber { get; set; }

Set properties of the update-cancel buttons column that appears in an edit form

C#
[PersistenceMode(PersistenceMode.InnerProperty)]
public GridEditCommandColumn EditColumn { get; }

Specifies the type of the edit form. See GridEditFormType about details for the possible values and their meanings.

C#
public GridEditFormType EditFormType { get; set; }

Style of the table row that shows the caption of the form

C#
[PersistenceMode(PersistenceMode.InnerProperty)]
public TableItemStyle FormCaptionStyle { get; }

The caption for the table that wraps the whole GridEditFormItem.

C#
public string FormMainTableCaption { get; set; }

Style of the forms' main table element

C#
[PersistenceMode(PersistenceMode.InnerProperty)]
public TableStyle FormMainTableStyle { get; }

The summary attribute for the table that wraps the whole GridEditFormItem.

C#
public string FormMainTableSummary { get; set; }

Style of the forms's area (rendered as a DIV elemet)

C#
[PersistenceMode(PersistenceMode.InnerProperty)]
public Style FormStyle { get; }

Style of the alternating rows in the edit-form's table

C#
[PersistenceMode(PersistenceMode.InnerProperty)]
public TableItemStyle FormTableAlternatingItemStyle { get; }

Style of the footer row of the table, where the update-cancel buttons appear

C#
[PersistenceMode(PersistenceMode.InnerProperty)]
public TableItemStyle FormTableButtonRowStyle { get; }

Style of the normal rows in the edit-form's table

C#
[PersistenceMode(PersistenceMode.InnerProperty)]
public TableItemStyle FormTableItemStyle { get; }

Style of the forms' table element

C#
[PersistenceMode(PersistenceMode.InnerProperty)]
public TableStyle FormTableStyle { get; }

EditForm template - if EditFormType if EditFormType is of type Template.

C#
[Browsable(false)]
[PersistenceMode(PersistenceMode.InnerProperty)]
[TemplateContainer(typeof(GridItem), BindingDirection.TwoWay)]
public virtual ITemplate FormTemplate { get; set; }

Caption for the pop-up insert form

C#
public virtual string InsertCaption { get; set; }

Gets a reference to GridPopUpSettings class providing properties related to PopUp EditForm.

C#
[PersistenceMode(PersistenceMode.InnerProperty)]
public GridPopUpSettings PopUpSettings { get; }

Name (filename) of the UserControl if EditFormType is of type WebUserControl.

C#
public string UserControlName { get; set; }

You have two options regarding the implementation of the web user control depending on the desired mode of exchanging data between Telerik RadGrid and the UserControl instances. As the binding container of the edit form is a GridEditFormItem and UserControl is a binding container iteself too, in order to access data from the object currently the edit form is binding to the binding-expressions used in the UserControl should be implemented in a slightly different then the traditional way. Here is an example of declaration of a TextBox server control that should be bound to the Region property of the DataItem in RadGrid:

csharp
<asp:TextBox id="TextBox1" runat="server" Text='<%# DataBinder.Eval( Container, "Parent.BindingContainer.DataItem.Region") %>;' />

The container object is always the UserControl isself. That is why you should refer the parent object, which is actually a edit for table cell in the grid's GridEditFormItem. Then the BindingContainer would refer the binding GridEditFormItem instance.

If using this kind of expression seems in some way uncorfotable, you have another option. You user control should implement a property with name DataItem. The type of the propertry should be public and assignable from the type of the object that construct the data-source for RadGrid. For example if you bind to a DataSet then the DataItem can be declared as: c#:

csharp
private DataRowView _dataItem = null;

   public DataRowView DataItem
   {
       get
       {
           return this._dataItem;
       }
       set
       {
           this._dataItem = value;
       }
}

VB.NET

csharp
private _dataItem As DataRowView = Nothing

   Public Property DataItem As DataRowView
       Get
           Return Me._dataItem
       End Get
       Set (ByVal value As DataRowView)
           Me._dataItem = value
       End Set
End Property

DataItem can also be declared as of type object.

Then in the usercontrol code, an expression binding the text of a TextBox control to the Country property of the datasource item can be declared this way:

csharp
<asp:TextBox id="TextBox1" runat="server" Text='<%# DataBinder.Eval( Container, "DataItem.Country"  ) %>'>
</asp:TextBox>