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

Represents one table of data.

In case of flat grid structure, i.e. no hierarchy levels, this object is the MasterTableView itself.

In case of hierarchical structure, the topmost GridTableView is the MasterTableView. All inner (child) tables are refered as DetailTables. Each table that has children tables has a collection called DetailTables where you can access these tables.

Definition

Namespace:Telerik.Web.UI

Assembly:Telerik.Web.UI.dll

Syntax:

C#
public class GridTableView : GridTableViewBase, IComponent, IDisposable, IParserAccessor, IUrlResolutionService, IDataBindingsAccessor, IControlBuilderAccessor, IControlDesignerAccessor, IExpressionsAccessor, IAttributeAccessor, INamingContainer

Inheritance: objectControlWebControlBaseDataBoundControlDataBoundControlCompositeDataBoundControlGridTableViewBaseGridTableView...

Implements: IAttributeAccessorIComponentIControlBuilderAccessorIControlDesignerAccessorIDataBindingsAccessorIDisposableIExpressionsAccessorINamingContainerIParserAccessorIUrlResolutionService...

Inherited Members GridTableViewBase.ControlStateGridTableViewBase.AddParsedSubObject(object)GridTableViewBase.Render(HtmlTextWriter)GridTableViewBase.CreateControlStyle()GridTableViewBase.TabIndexGridTableViewBase.OwnerGridGridTableViewBase.CellPaddingGridTableViewBase.CellSpacingGridTableViewBase.ControlsGridTableViewBase.DataKeysArrayGridTableViewBase.SelectedIndexChangedCompositeDataBoundControl.CreateChildControls()CompositeDataBoundControl.PerformDataBinding(IEnumerable)CompositeDataBoundControl.IsUsingModelBindersDataBoundControl.OnCreatingModelDataSource(CreatingModelDataSourceEventArgs)DataBoundControl.GetData()DataBoundControl.GetDataSource()DataBoundControl.MarkAsDataBound()DataBoundControl.OnPagePreLoad(object, EventArgs)DataBoundControl.ValidateDataSource(object)DataBoundControl.DataMemberDataBoundControl.ItemTypeDataBoundControl.DataSourceObjectDataBoundControl.SelectArgumentsDataBoundControl.CreatingModelDataSourceDataBoundControl.CallingDataMethodsBaseDataBoundControl.ConfirmInitState()BaseDataBoundControl.EnsureDataBound()BaseDataBoundControl.OnDataBound(EventArgs)BaseDataBoundControl.InitializedBaseDataBoundControl.IsBoundUsingDataSourceIDBaseDataBoundControl.IsDataBindingAutomaticBaseDataBoundControl.SupportsDisabledAttributeBaseDataBoundControl.RequiresDataBindingBaseDataBoundControl.DataBoundWebControl.AddAttributesToRender(HtmlTextWriter)WebControl.ApplyStyle(Style)WebControl.CopyBaseAttributes(WebControl)WebControl.MergeStyle(Style)WebControl.RenderBeginTag(HtmlTextWriter)WebControl.RenderEndTag(HtmlTextWriter)WebControl.RenderContents(HtmlTextWriter)WebControl.AccessKeyWebControl.AttributesWebControl.BackColorWebControl.BorderColorWebControl.BorderWidthWebControl.BorderStyleWebControl.ControlStyleWebControl.ControlStyleCreatedWebControl.CssClassWebControl.DisabledCssClassWebControl.StyleWebControl.EnabledWebControl.EnableThemingWebControl.FontWebControl.ForeColorWebControl.HasAttributesWebControl.HeightWebControl.IsEnabledWebControl.SkinIDWebControl.TagKeyWebControl.TagNameWebControl.ToolTipControl.ResolveAdapter()Control.HasEvents()Control.GetRouteUrl(object)Control.GetRouteUrl(string, object)Control.GetRouteUrl(RouteValueDictionary)Control.GetRouteUrl(string, RouteValueDictionary)Control.GetUniqueIDRelativeTo(Control)Control.ApplyStyleSheetSkin(Page)Control.OnDataBinding(EventArgs)Control.DataBind(bool)Control.DataBindChildren()Control.EnsureID()Control.ClearChildState()Control.ClearChildControlState()Control.ClearChildViewState()Control.ClearEffectiveClientIDMode()Control.ClearCachedClientID()Control.Focus()Control.MapPathSecure(string)Control.OpenFile(string)Control.BuildProfileTree(string, bool)Control.RenderChildren(HtmlTextWriter)Control.RenderControl(HtmlTextWriter)Control.RenderControl(HtmlTextWriter, ControlAdapter)Control.OnUnload(EventArgs)Control.Dispose()Control.RaiseBubbleEvent(object, EventArgs)Control.OnBubbleEvent(object, EventArgs)Control.AddedControl(Control, int)Control.CreateControlCollection()Control.ResolveUrl(string)Control.ResolveClientUrl(string)Control.FindControl(string)Control.FindControl(string, int)Control.GetDesignModeState()Control.HasControls()Control.IsLiteralContent()Control.EnsureChildControls()Control.RemovedControl(Control)Control.SetDesignModeState(IDictionary)Control.SetRenderMethodDelegate(RenderMethod)Control.ClientIDModeControl.ClientIDSeparatorControl.ContextControl.AdapterControl.DesignModeControl.EventsControl.IsChildControlStateClearedControl.EnableViewStateControl.ViewStateModeControl.IsViewStateEnabledControl.NamingContainerControl.IdSeparatorControl.LoadViewStateByIDControl.PageControl.RenderingCompatibilityControl.TemplateControlControl.ParentControl.TemplateSourceDirectoryControl.AppRelativeTemplateSourceDirectoryControl.SiteControl.VisibleControl.UniqueIDControl.HasChildViewStateControl.ValidateRequestModeControl.ViewStateControl.ViewStateIgnoresCaseControl.ChildControlsCreatedControl.IsTrackingViewStateControl.DisposedControl.DataBindingControl.InitControl.LoadControl.PreRenderControl.Unloadobject.ToString()object.Equals(object)object.Equals(object, object)object.ReferenceEquals(object, object)object.GetHashCode()object.GetType()object.MemberwiseClone()...

Constructors

Default contructor for GridTableView - generally used by Page serializer only.

C#
public GridTableView()

Constructs a new GridTableView and sets as its owner the RadGrid object. Sets the IsTrackingViewState property to the corresponding value of the boolean parameter.

C#
public GridTableView(RadGrid OwnerGrid, bool IsTrackingViewState)
Parameters:OwnerGridRadGrid

The owner RadGrid object

IsTrackingViewStatebool

Indicates whether RadGrid is saving changes to its view state.

Constructs a new GridTableView and sets as its owner the RadGrid object.

C#
public GridTableView(RadGrid OwnerGrid)
Parameters:OwnerGridRadGrid

Properties

Gets or sets values indicating DataFieldNames that should be sorted, grouped, etc and are not included as columns, in case the property RetrieveAllDataFields is false.

C#
[SuppressMessage("Microsoft.Performance", "CA1819:PropertiesShouldNotReturnArrays")]
[TypeConverter(typeof(GridStringArrayConverter))]
public virtual string[] AdditionalDataFieldNames { get; set; }
Property Value:

An array of DataFieldNames values that should be sorted, grouped, etc and are not included as columns.

Gets or sets a value indicating whether Telerik RadGrid will perform automatic deletes, i.e. using the DataSource controls functionality.

C#
public bool AllowAutomaticDeletes { get; set; }
Property Value:

true, if Telerik RadGrid will perform automatic deletes; otherwise, false. The default value is false.

Gets or sets a value indicating whether Telerik RadGrid will perform automatic inserts, i.e. using the DataSource controls functionality.

C#
public bool AllowAutomaticInserts { get; set; }
Property Value:

true, if the Telerik RadGrid will perform automatic inserts; otherwise, false. The default value is false.

Gets or sets a value indicating whether Telerik RadGrid will perform automatic updates, i.e. using the DataSource controls functionality.

C#
public bool AllowAutomaticUpdates { get; set; }
Property Value:

true, if Telerik RadGrid will perform automatic updates; otherwise, false. The default value is false.

Gets or sets if the custom paging feature is enabled.

C#
public virtual bool AllowCustomPaging { get; set; }
Property Value:

true, if the custom paging feature is enabled; otherwise, false. Default value is the value of AllowCustomPaging.

There are cases in which you may want to fetch only a fixed number of records and perform operations over this specified set of data. Telerik RadGrid allows such data manipulation through the custom paging mechanism integrated in the control. The main steps you need to undertake are:

  • Set AllowPaging = true and AllowCustomPaging = true for your grid instance
  • Implement code logic which to extract merely a fixed number of records from the grid source and present them in the grid structure
  • The total number of records in the grid source should be defined through the VirtualItemCount property of the MasterTableView/GridTableView instance. Thus the grid "understands" that the data source contains the specified number of records and it should fetch merely part of them at a time to execute requested operation.

Gets or sets if the custom sorting feature is enabled.

C#
public virtual bool AllowCustomSorting { get; set; }
Property Value:

true, if custom sorting feature is enabled; otherwise, false. The default value is false.

With custom sorting turned on, RadGrid will display as Sorting Icons, will maintain the SortExpressions collection and so on, but it will not actually sort the Data. You should perform the custom sorting in the SortCommand event handler. You can also use the GetSortString() method, which will return the sort expressions string in the same format as it wold be used by a DataView component.

Gets or sets a value indicating whether the filtering by column feature is enabled.

C#
public virtual bool AllowFilteringByColumn { get; set; }
Property Value:

true if the filtering by column feature is enabled; otherwise, false. Default value is the value of AllowFilteringByColumn.

When the value is true, GridTableView will display the filtering item, under the table's header item. The filtering can be controlled based on a column through column properties: FilterListOptions , CurrentFilterFunction, CurrentFilterValue. The column SupportsFiltering() method is used to determine if a column can be used with filtering. Generally, this function returns the value set to AllowFiltering for a specific column.

Gets or sets the value indicating wheather more than one column can be sorted in a single GridTableView. The order is the same as the sequence of expressions in SortExpressions.

C#
public bool AllowMultiColumnSorting { get; set; }
Property Value:

true, if more than one column can be sorted in a single GridTableView; otherwise, false. The default value is false.

Gets or sets the value indicated whether the no-sort state when changing sort order will be allowed.

C#
public bool AllowNaturalSort { get; set; }
Property Value:

true, if the no-sort state when changing sort order will be allowed; otherwise, false. The default value is true.

Gets or sets a value indicating whether the paging feature is enabled.

C#
public virtual bool AllowPaging { get; set; }
Property Value:

true if the paging feature is enabled; otherwise, false. The default is AllowPaging.

Instead of displaying all the records in the data source at the same time, the GridTableView control can automatically break the records up into pages. If the data source supports the paging capability, the GridTableView control can take advantage of that and provide built-in paging functionality. The paging feature can be used with any data source object that supports the System.Collections.ICollection interface or a data source that supports paging capability.

To enable the paging feature, set the AllowPaging property to true. By default, the GridTableView control displays 10 records on a page at a time. You can change the number of records displayed on a page by setting the PageSize property. To determine the total number of pages required to display the data source contents, use the PageCount property. You can determine the index of the currently displayed page by using the CurrentPageIndex property.

When paging is enabled, an additional row called the pager item is automatically displayed in the GridTableView control. The pager row contains controls that allow the user to navigate to the other pages. You can control the settings of the pager row (such as the pager display mode, the number of page links to display at a time, and the pager control's text labels) by using the PagerStyle properties. The pager row can be displayed at the top, bottom, or both the top and bottom of the control by setting the Position property. You can also select from one of six built-in pager display modes by setting the Mode property.

The GridTableView control also allows you to define a custom template for the pager row. For more information on creating a custom pager row template, see PagerTemplate.

The GridTableView control provides an event that you can use to perform a custom action when paging occurs.

EventDescription
PageIndexChanged Occurs when one of the pager buttons is clicked, but after the GridTableView control handles the paging operation. This event is commonly used when you need to perform a task after the user navigates to a different page in the control.

Gets or sets a value indicating whether the sorting feature is enabled.

C#
public virtual bool AllowSorting { get; set; }
Property Value:

true if the sorting feature is enabled; otherwise, false. The default is AllowSorting.

When a data source control that supports sorting is bound to the GridTableView control, the GridTableView control can take advantage of the data source control's capabilities and provide automatic sorting functionality.

To enable sorting, set the AllowSorting property to true. When sorting is enabled, the heading text for each column field with its SortExpressions property set is displayed as a link button.

Clicking the link button for a column causes the items in the GridTableView control to be sorted based on the sort expression. Typically, the sort expression is simply the name of the field displayed in the column, which causes the GridTableView control to sort with respect to that column. To sort by multiple fields, use a sort expression that contains a comma-separated list of field names. You can determine the sort expression that the GridTableView control is applying by using the SortExpressions property. Clicking a column's link button repeatedly toggles the sort direction between ascending and descending order.

Note that if you want to sort the grid by a column different than a GridBoundColumn, you should set also its SortExpression property to the desired data field name you want the column to be sorted by.

Gets a reference to the GridTableItemStyle object that allows you to set the appearance of alternating items in a GridTableView control.

C#
[PersistenceMode(PersistenceMode.InnerProperty)]
public virtual GridTableItemStyle AlternatingItemStyle { get; }
Property Value:

A reference to the GridTableItemStyle that represents the style of alternating data items in a GridTableView control. If style is not altered (is default) AlternatingItemStyle is used.

Use the AlternatingItemStyle property to control the appearance of alternating items in a GridTableView control. When this property is set, the items are displayed alternating between the ItemStyle settings and the AlternatingItemStyle settings. This property is read-only; however, you can set the properties of the GridTableItemStyle object it returns. The properties can be set declaratively using one of the following methods:

  • Place an attribute in the opening tag of the GridTableView control in the form Property-Subproperty, where Subproperty is a property of the GridTableItemStyle object (for example, AlternatingItemStyle-ForeColor).
  • Nest an <AlternatingItemStyle> element between the opening and closing tags of the GridTableView control.

The properties can also be set programmatically in the form Property.Subproperty (for example, AlternatingItemStyle.ForeColor). Common settings usually include a custom background color, foreground color, and font properties.

Gets or sets a value indicating whether Telerik RadGrid will automatically generate columns at runtime based on its DataSource.

C#
public virtual bool AutoGenerateColumns { get; set; }
Property Value:

A value indicating whether Telerik RadGrid will automatically generate columns at runtime based on its DataSource. The default value is the value of RadGrid's property AutoGenerateColumns.

Get an array of automatically generated columns. This array is available when AutoGenerateColumns is set to true. Autogenerated columns appear always after Columns when rendering.

C#
[SuppressMessage("Microsoft.Performance", "CA1819:PropertiesShouldNotReturnArrays")]
[Browsable(false)]
public GridColumn[] AutoGeneratedColumns { get; }
Property Value:

An array of automatically generated columns.

C#
[PersistenceMode(PersistenceMode.InnerProperty)]
public GridBatchEditingSettings BatchEditingSettings { get; }

Gets or sets a value indicating whether Telerik RadGrid should retrieve all data and ignore server paging in case of filtering or grouping.

C#
public virtual bool CanRetrieveAllData { get; set; }
Property Value:

true (default) if the retrieve all data feature is enabled; otherwise, false.

Gets or sets a string that specifies a brief description of a GridTableView. Related to Telerik RadGrid accessibility compliance.

C#
public virtual string Caption { get; set; }
Property Value:

A string that represents the text to render in an HTML caption element in a GridTableView control. The default value is an empty string ("").

Use the Caption property to specify the text to render in an HTML caption element in a GridTableView control. The text that you specify provides assistive technology devices with a description of the table that can be used to make the control more accessible.

Example:
cs-api-definition
The following example demonstrates how to style the Caption of a MasterTableView and detail GridTableView.

Get or set Path for the WebService that to be used for populating filter checklist with values.

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

Gets all items among the hierarchy of GridTableView items that are in edit mode. The edit items in a GridTableView are cleared when ParentItem collapses.

C#
[Browsable(false)]
public GridItemCollection ChildEditItems { get; }
Property Value:

A GridItemCollection of items that are in edit mode.

Gets all items among the hierarchy of GridTableView items that are selected. The selected items in a GridTableView are cleared when ParentItem collapses and the ParentItem becomes selected.

C#
[Browsable(false)]
public GridItemCollection ChildSelectedItems { get; }
Property Value:

A GridItemCollection of items among the hierarchy of GridTableView items that are selected.

This property is used to specify the field from the underlying datasource, which will populate the ClientDataKeyNames collection.
This collection can later be accessed on the client, to get the key value(s).

The following example demonstrates the extraction of the data key value for a given data table view object:


<ClientSettings>
<ClientEvents OnHierarchyExpanded="HierarchyExpanded" />
</ClientSettings>

<script type="text/javascript">
function HierarchyExpanded(sender, args)
{
var firstClientDataKeyName = args.get_tableView().get_clientDataKeyNames()[0];
alert("Item with " + firstClientDataKeyName + ":'" + args.getDataKeyValue(firstClientDataKeyName)
+ "' expanded.");
}
</script>

The logic is placed in the OnHierarchyExpanded client side event handler, which is triggered when the user expands a node
in a hierarchical grid, but can be used in any other event, given that a proper reference to the client table view object is obtained.

C#
[SuppressMessage("Microsoft.Performance", "CA1819:PropertiesShouldNotReturnArrays")]
[TypeConverter(typeof(GridStringArrayConverter))]
public virtual string[] ClientDataKeyNames { get; set; }

Gets the server control identifier generated by ASP.NET.

C#
public override string ClientID { get; }
Property Value:

The server control identifier generated by ASP.NET.

Overrides: Control.ClientID

Gets the column groups.

C#
[PersistenceMode(PersistenceMode.InnerProperty)]
public GridColumnGroupCollection ColumnGroups { get; }
Property Value:

Returns the column groups in a collection of type GridColumnGroupCollection.

Gets a collection of GridColumn objects that represent the column fields in a GridTableView control.

C#
[PersistenceMode(PersistenceMode.InnerProperty)]
public virtual GridColumnCollection Columns { get; }
Property Value:

A GridColumnCollection that contains all the column fields in the GridTableView control.

A column field represents a column in a GridTableView control. The Columns property (collection) is used to store all the explicitly declared column fields that get rendered in the GridTableView control. You can also use the Columns collection to programmatically manage the collection of column fields.

The column fields are displayed in the GridTableView control in the order that the column fields appear in the Columns collection.

To get a list of all columns rendered in the current instance use RenderColumns

Although you can programmatically add column fields to the Columns collection, it is easier to list the column fields declaratively in the GridTableView control and then use the Visible property of each column field to show or hide each column field.

If the Visible property of a column field is set to false, the column is not displayed in the GridTableView control and the data for the column does not make a round trip to the client. If you want the data for a column that is not visible to make a round trip, add the field name to the DataKeyNames property.

This property can be managed programmatically or by Property Builder (IDE designer).

C#
public List<GridTableView.PersistableColumnSetting> ColumnSettings { get; set; }

Gets or sets the default position of the GridCommandItem as defined by the GridCommandItemDisplay. The possible values are:

  • None - this is the default value - the command item will not be rendered
  • Top - the command item will be rendered on the top of the grid
  • Bottom - the command item will be rendered on the bottom of the grid
  • TopAndBottom - the command item will be rendered both on top and bottom of the grid.
C#
public GridCommandItemDisplay CommandItemDisplay { get; set; }
Property Value:

A GridCommandItemDisplay proprty which define the default position of the GridCommandItem.

Gets a set the options for GridTableView's command item.

C#
[PersistenceMode(PersistenceMode.InnerProperty)]
public GridCommandItemSettings CommandItemSettings { get; }
Property Value:

The options for GridTableView's command item.

Gets a referenct to the GridTableItemStyle object that allows you to set the appearance of the command item in a GridTableView control.

C#
[PersistenceMode(PersistenceMode.InnerProperty)]
public GridTableItemStyle CommandItemStyle { get; }
Property Value:

A reference to the GridTableItemStyle that represents the style of the command item.

Gets or sets the template that will be instantiated in the CommandItem. If this template is set, RadGrid will not create the default CommandItem controls.

C#
[TemplateContainer(typeof(GridItem))]
[Bindable(false)]
[Browsable(false)]
[PersistenceMode(PersistenceMode.InnerProperty)]
public ITemplate CommandItemTemplate { get; set; }
Property Value:

A System.Web.UI.ITemplate object that contains the custom content for the pager item. The default value is null, which indicates that this property is not set.

Gets or sets a value indicating the index of the currently active page in case paging is enabled (AllowPaging is true).

C#
[Bindable(true)]
[Browsable(false)]
public int CurrentPageIndex { get; set; }
Property Value:

The index of the currently active page in case paging is enabled.

Gets or sets a value that describes how RadGrid would respond if the CurrentPageIndex is invalid when data-binding.

C#
public GridResetPageIndexAction CurrentResetPageIndexAction { get; set; }
Property Value:

A member of the GridResetPageIndexAction enumeration which describes how RadGrid would respond if the CurrentPageIndex is invalid when data-binding. By default its value is SetPageIndexToFirst

This property is not persisted in the ViewState. By deafult the value is SetPageIndexToFirst.

Gets or sets an array of data-field names that will be used to populate the DataKeyValues collection, when the GridTableView control is databinding.

C#
[SuppressMessage("Microsoft.Performance", "CA1819:PropertiesShouldNotReturnArrays")]
[TypeConverter(typeof(GridStringArrayConverter))]
public virtual string[] DataKeyNames { get; set; }
Property Value:

An array that contains the names of the primary key fields for the items displayed in a GridTableView control.

Use the DataKeyNames property to specify the field or fields that represent the primary key of the data source.

Note: Values set to this property are case-sensitive! The field names should be coma-separated.

The data key names/values are stored in the ViewState so they are available at any moment after grid have been data-bound, after postbacks, etc. This collection is used when editing data, and for automatic relations when binding an hiararchical grid (see ParentTableRelation).

If the Visible property of a column field is set to false, the column is not displayed in the GridTableView control and the data for the column does not make a round trip to the client. If you want the data for a column that is not visible to make a round trip, add the field name to the DataKeyNames property.

Gets a collection of DataKeyValue objects that represent the data key value of the corresponding item (specified with its ItemIndex) and the DataKeyName (case-sensitive!). The DataKeyName should be one of the specified in the DataKeyNames array.

C#
[Browsable(false)]
public virtual GridDataKeyArray DataKeyValues { get; }
Property Value:

data key name/value pair

When the DataKeyNames property is set, the GridTableView control automatically creates a DataKeyValue object for each item in the control. The DataKeyValue object contains the values of the field or fields specified in the DataKeyNames property. The DataKeyValue objects are then added to the control's DataKeysValue collection. Use the DataKeysValue property to retrieve the DataKeyValue object for a specific data item in the GridTableView control.

Example:
cs-api-definition
protected void RadGrid1_ItemUpdated(object source, Telerik.Web.UI.GridUpdatedEventArgs e)
{
if (e.Exception != null)
{
e.KeepInEditMode = true;
e.ExceptionHandled = true;
Response.Write("Employee " + e.Item.OwnerTableView.DataKeyValues[e.Item.ItemIndex]["EmployeeID"] + " cannot be updated. Reason: " + e.Exception.Message);
}
else
{
Response.Write("Employee " + e.Item.OwnerTableView.DataKeyValues[e.Item.ItemIndex]["EmployeeID"] + " updated");
}
}

Gets or sets the object from which the data-bound control retrieves its list of data items.

C#
[Browsable(false)]
public override object DataSource { get; set; }
Property Value:

An object that represents the data source from which the GridTableView control retrieves its data. The default is a null reference (Nothing in Visual Basic).

Overrides: BaseDataBoundControl.DataSource

Generally the DataSource object references DataSource. Assign this property only if you need to change the default behavior or RadGrid.

RadGrid modifies this property when DataSource is assigned.

On postback the DataSource property settings are not persisted due to performance reasons. Note, however, that you can save the grid DataSource in a Session/Application/Cache variable and then retrieve it from there after postback invocation. Respectively, you can get the changes made in the data source in a dataset object and then operate with them.

This property cannot be set by themes or style sheet themes.

Gets the number of pages if paging is enabled.

C#
[Browsable(false)]
public int DataSourceCount { get; }
Property Value:

The number of pages if paging is enabled.

Gets or sets the ID of the DataSource control used for population of this GridTableView data items.

C#
public override string DataSourceID { get; set; }
Property Value:

The ID of a control that represents the data source from which the data-bound control retrieves its data. The default is String.Empty ("").

Overrides: DataBoundControl.DataSourceID

This property cannot be set by themes or style sheet themes.

Example:
C#
<p>[ASPX/ASCX]<br />
&lt;radG:RadGrid ID="RadGrid1" runat="server"
DataSourceID="SessionDataSource1"&gt;<br />
 ............<br />
&lt;/radG:RadGrid&gt;</p>

Gets or sets the name of the method to call in order to delete data

C#
public string DeleteMethod { get; set; }

DetailwItemTemplate is a template that will be instantiated as a part of each data item. Supports one-way databinding.

C#
[PersistenceMode(PersistenceMode.InnerProperty)]
[TemplateContainer(typeof(GridDetailTemplateItem), BindingDirection.OneWay)]
public virtual ITemplate DetailItemTemplate { get; set; }

Gets or sets the collection of detail table views for this GridTableView

C#
[PersistenceMode(PersistenceMode.InnerProperty)]
public GridTableViewCollection DetailTables { get; }
Property Value:

A collection of detail table views for this GridTableView.

Adding or removing objects to the DetailTables collection changes the hierarchical structure.

Use Rebind() after modifying the collection programmatically.

This collection can also be altered unsing the environment designer.

Gets or sets the text direction. This property is related to Telerik RadGrid support for Right-To-Left lanugages. It has two possible vales defined by GridTableTextDirection enumeration:

  • LTR - left-to-right text
  • RTL - right-to-left text
C#
public virtual GridTableTextDirection Dir { get; set; }

Gets a value defining the setting that will be applied when an Item is in edit mode and the EditMode property is set to EditForms.

C#
[PersistenceMode(PersistenceMode.InnerProperty)]
public GridEditFormSettings EditFormSettings { get; }
Example:
C#
<p><font face="Courier New">[ASPX/ASCX]</font></p>
<p><font face="Courier New">&lt;MasterTableView&gt;<br />
&lt;<font style="BACKGROUND-COLOR: #edb078" color="white">EditFormSettings</font>
CaptionFormatString='&lt;img src=<font class="string" color="black">"img/editRowBg.gif"</font> alt=<font class="string" color="black">""</font>
/&gt;</font><font face="Courier New"><font color="black"><font class="comment">'&gt;</font><br />
&lt;FormMainTableStyle GridLines=<font class="string">"None"</font>
CellSpacing=<font class="string">"0"</font>
CellPadding=<font class="string">"3"</font>
Width=<font class="string">"100%"</font>
CssClass=<font class="string">"none"</font>/&gt;<br />
&lt;FormTableStyle CssClass=<font class="string">"EditRow"</font>
CellSpacing=<font class="string">"0"</font>
BorderColor=<font class="string">"#c4c0b5"</font>
CellPadding=<font class="string">"2"</font>
Width=<font class="string">"100%"</font>/&gt;<br />
&lt;FormStyle Width=<font class="string">"100%"</font>
BackColor=<font class="string">"#ffffe1"</font></font>&gt;&lt;/FormStyle&gt;<br />
&lt;/<font style="BACKGROUND-COLOR: #edb078" color="white">EditFormSettings</font>&gt;</font></p>

Gets a reference to the >GridTableItemStyle object that allows you to set the appearance of the item selected for editing in a GridTableView control.

C#
[PersistenceMode(PersistenceMode.InnerProperty)]
public GridTableItemStyle EditItemStyle { get; }
Property Value:

A reference to the GridTableItemStyle that represents the style of the row being edited in a GridTableView control. If style is not altered (is default) EditItemStyle is used.

Use the EditItemStyle property to control the appearance of the item in edit mode. This property is read-only; however, you can set the properties of the GridTableItemStyle object it returns. The properties can be set declaratively using one of the following methods:

  • Place an attribute in the opening tag of the GridTableView control in the form Property-Subproperty, where Subproperty is a property of the GridTableItemStyle object (for example, EditItemStyle-ForeColor).
  • Nest an <EditItemStyle> element between the opening and closing tags of the GridTableView control.

The properties can also be set programmatically in the form Property.Subproperty (for example, EditItemStyle.ForeColor). Common settings usually include a custom background color, foreground color, and font properties.

Gets or sets the EditItemTemplate, which is rendered in the control in edit mode.

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

A value of type System.Web.UI.CompiledBindableTemplateBuilder

FormsGets or sets a value indicating how a GridItem will look in edit mode.

C#
public GridEditMode EditMode { get; set; }
Property Value:

A value indicating how a GridItem will look in edit mode. The default is EditForms.

There are two possible values defined by the GridEditMode enumeration:

  • InPlace
  • EditForms

To display the grid column editors inline when switching grid item in edit mode (see the screenshot below), you simply need to change the EditMode property to InPlace.

                <pre>
                                    <pre><code class="lang-csharp"><radg:RadGrid id="RadGrid1" runat="server"><MasterTableView AutoGenerateColumns="True" EditMode="InPlace" /></radg:RadGrid></code></pre>

A row in edit mode

To display the grid column editors in auto-generated form when switching grid item in edit mode (see the screenshot below), you simply need to change the MasterTableView EditMode property to EditForms.

                <pre>
                                    <pre><code class="lang-csharp"><radg:RadGrid id="RadGrid1" runat="server"><MasterTableView AutoGenerateColumns="True" EditMode="EditForms" /></radg:RadGrid></code></pre>
Edit in forms mode

Gets or sets a value indicating whether all columns settings will be persisted in the ViewState or not.

C#
public virtual bool EnableColumnsViewState { get; set; }
Property Value:

true if columns are kept in the view state; otherwise false. The default value is true.

Gets or sets a value indicating whether the groups expand/collapse all header buttons should be switched on.

C#
public virtual bool EnableGroupsExpandAll { get; set; }
Property Value:

A value indicating whether the groups expand/collapse all header buttons should be switched on.

Gets or sets a value indicating whether the option to set columns aggregates should appear in header context menu.

C#
public virtual bool EnableHeaderContextAggregatesMenu { get; set; }
Property Value:

true if the set columns aggregates option is enabled; otherwise, false. Default is false.

Gets or sets a value indicating whether the header context filter menu should be enabled.

C#
public virtual bool EnableHeaderContextFilterMenu { get; set; }
Property Value:

true if the header context filter menu feature is enabled; otherwise, false. Default value is the value of EnableHeaderContextFilterMenu.

Gets or sets a value indicating whether the header context menu should be enabled.

C#
public virtual bool EnableHeaderContextMenu { get; set; }
Property Value:

true if the header context menu feature is enabled; otherwise, false. Default value is the value of EnableHeaderContextMenu.

Gets or sets a value indicating whether the hierarchy expand/collapse all header buttons should be switched on.

C#
public virtual bool EnableHierarchyExpandAll { get; set; }
Property Value:

A value indicating whether the hierarchy expand/collapse all header buttons should be switched on.

Gets or sets a value indicating whether grouping will use LINQ queries.

C#
public virtual bool EnableLinqGrouping { get; set; }
Property Value:

A value indicating whether grouping will use LINQ queries.

Gets or sets a value indicating whether RadGrid will show NoRecordsTemplate instead of the corresponding GridTableView if there is no items to display.

C#
public bool EnableNoRecordsTemplate { get; set; }
Property Value:

true if NoRecordsTemplate usage is enabled; otherwise, false. The default value is true.

Gets or sets a value indicating if the text in the header of the GridTableView should be split on capital letter. True if header text should be split; otherwise, false. The default is true. This property is meaningful only when the GridTableView has AutoGenerateColumns = "true"

C#
public bool EnableSplitHeaderText { get; set; }

Gets a reference to the ExpandCollapseColumn object, allowing you to customize its settings.

C#
[Browsable(false)]
[PersistenceMode(PersistenceMode.InnerProperty)]
public GridExpandColumn ExpandCollapseColumn { get; set; }

The property setter does nothing and should not be used. It works around a bug in the VS.NET designer.

Gets or sets the filtering options for grid columns.

C#
public string FilterExpression { get; set; }

In the most common case, Telerik RadGrid checks all filtering options for each column, then prepares a filter expression and sets this property internally.

Note: You should be careful when setting this property as it may break the whole filtering functionality for your grid.

More info on the way, the expressions are created you can find here (external link to MSDN library).

Example:
cs-api-definition
If (Not Page.IsPostBack) Then
RadGrid1.MasterTableView.FilterExpression = "([Country] LIKE '&lt;see cref="Germany"/&gt;') "

Dim column As GridColumn = RadGrid1.MasterTableView.GetColumnSafe("Country")
column.CurrentFilterFunction = GridKnownFunction.Contains
column.CurrentFilterValue = "Germany"
End If

Gets a reference to the GridTableItemStyle object that allows you to set the appearance of the filter item in a GridTableView control.

C#
[PersistenceMode(PersistenceMode.InnerProperty)]
public GridTableItemStyle FilterItemStyle { get; }
Property Value:

A reference to the GridTableItemStyle that represents the style of the filter item.

Manage visual style of the footer item.

C#
[PersistenceMode(PersistenceMode.InnerProperty)]
public GridTableItemStyle FooterStyle { get; }
Property Value:

A reference to the GridTableItemStyle that represents the style of the footer item. If style is not altered (is default) FooterStyle is used.

Gets or sets a value specifying the frame table attribute.

C#
public virtual GridTableFrame Frame { get; set; }
Property Value:

A GridTableFrame value, specifying the frame table attribute.

The frame attribute for a table specifies which sides of the frame surrounding the table will be visible. Possible values:

  • void: No sides. This is the default value.
  • above: The top side only.
  • below: The bottom side only.
  • hsides: The top and bottom sides only.
  • vsides: The right and left sides only.
  • lhs: The left-hand side only.
  • rhs: The right-hand side only.
  • box: All four sides.
  • border: All four sides

Gets or sets a value indicating whether the border lines for grid cells will be displayed.

C#
public override GridLines GridLines { get; set; }
Property Value:

One of the GridLines values. The default is Both.

Overrides: GridTableViewBase.GridLines

Use the GridLines property to specify the gridline style for a GridTableView control. The following table lists the available styles.

StyleDescription
GridLines.NoneNo gridlines are displayed.
GridLines.HorizontalDisplays the horizontal gridlines only.
GridLines.VerticalDisplays the vertical gridlines only.
GridLines.BothDisplays both the horizontal and vertical gridlines.
Example:
cs-api-definition
RadGrid1.GridLines = GridLines.None

Adding GridGroupByExpression to this collection will cause the current table-view to display items sorted and devided in groups separated by GridGroupHeaderItems, that display common group and aggregate field values. See Expression on details of expressions syntax.

C#
[PersistenceMode(PersistenceMode.InnerProperty)]
public GridGroupByExpressionCollection GroupByExpressions { get; }
Property Value:

A GroupByExpressionCollection of values that will cause the current table-view to display items sorted and devided in groups separated by GridGroupHeaderItems, that display common group and aggregate field values.

Note that the correctness of the expressions in the collection is checked when DataBind occures. Then if an expression in not correct or a combination of expressions is erroneous a GridGroupByException would be thrown on DataBind(). This property's value is preserved in the ViewState.

Gets or sets the group footer ItemTemplate.

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

Manage visual style of the group header items.

C#
[PersistenceMode(PersistenceMode.InnerProperty)]
public virtual GridTableItemStyle GroupHeaderItemStyle { get; }
Property Value:

A reference to the GridTableItemStyle that represents the style of the group header items. If style is not altered (is default) GroupHeaderItemStyle is used.

Gets or sets the group header ItemTemplate.

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

Specifies where the grouping will be handled. There are two options:

  • Server-side - GridTableView.GroupLoadMode.Server
  • Client-side - GridTableView.GroupLoadMode.Client
C#
public GridGroupLoadMode GroupLoadMode { get; set; }

GridTableView.GroupLoadMode.Server

This is the default behavior. Groups are expanded after postback to the server for example:

                    <pre>
                                    <pre><code class="lang-csharp"><MasterTableView GroupLoadMode="Server"></code></pre>
GridTableView.GroupLoadMode.Client
Groups will be expanded client-side and no postback will be performed.
                        <pre>
                                        <pre><code class="lang-csharp"><MasterTableView GroupLoadMode="Client"></code></pre>
and set the client setting AllowGroupExpandCollapse to true:
                        <pre>
                                        <pre><code class="lang-csharp"><ClientSettings AllowGroupExpandCollapse="True"></code></pre>

Gets or sets a value indicating whether the groups will be expanded on grid load (true by default).

C#
public bool GroupsDefaultExpanded { get; set; }
Property Value:

true, if the groups will be expanded on grid load; otherwise, false. The default value is true.

Gets a value indicating if the GridTableView instance has children (Detail) tables.

C#
[Browsable(false)]
public bool HasDetailTables { get; }
Property Value:

true, if the GridTableView instance has children (Detail) tables; otherwise, false.

Gets value indicating whether the GridTableView will render multiple headers. Read only.

C#
public bool HasMultiHeaders { get; }
Property Value:

True if the table view has multiple headers, otherwise false.

Gets a reference to the GridTableItemStyle object that allows you to set the appearance of the header item in a GridTableView control.

C#
[PersistenceMode(PersistenceMode.InnerProperty)]
public GridTableItemStyle HeaderStyle { get; }
Property Value:

A reference to the GridTableItemStyle that represents the style of the header row in a GridTableView control. If style is not altered (is default) HeaderStyle is used.

Use the HeaderStyle property to control the appearance of the header item in a GridTableView control. This property is read-only; however, you can set the properties of the GridTableItemStyle object it returns. The properties can be set declaratively using one of the following methods:

  • Place an attribute in the opening tag of the GridTableView control in the form Property-Subproperty, where Subproperty is a property of the GridTableItemStyle object (for example, HeaderStyle-ForeColor).
  • Nest a <HeaderStyle> element between the opening and closing tags of the GridTableView control.

The properties can also be set programmatically in the form Property.Subproperty (for example, HeaderStyle.ForeColor). Common settings usually include a custom background color, foreground color, and font properties.

Gets or sets a value indicating whether the hierarchy will be expanded by default. The default value of the property is false.

C#
public bool HierarchyDefaultExpanded { get; set; }

The unique hierarchy index of the current table view, generated when it is binding.

C#
[Browsable(false)]
public string HierarchyIndex { get; }
Property Value:

The hierarchy index of the current table view.

Gets or sets a value indicating when the DataBind of the child GridTableView will occur when working in hierarchy mode. Accepts values from GridChildLoadMode enumeration. See the remars for details.

C#
public GridChildLoadMode HierarchyLoadMode { get; set; }
Property Value:

The default value is ServerOnDemand.

Changing this propery value impacts the performance the following way:

  • In ServerBind mode - Roundtrip to the database only when grid is bound. ViewState holds all detail tables data. Only detail table-views of the expanded items are rendered. Postback to the server to expand an item
  • In ServerOnDemand mode - Roundtrip to the database when grid is bound and when item is expanded. ViewState holds data for only visible Items (smallest possible). Only detail table-views of the expanded items are rendered. Postback to the server to expand an item.
  • In Client mode - Roundtrip to the database only when grid is bound. ViewState holds all detail tables data. All items are rendered - even is not visible (not expanded). NO postback to the server to expand an item - expand/collapse of hierarchy items is managed client-side.
    Note: In order to use client-side hierarchy expand, you will need to set also AllowExpandCollapse to true.

Gets or sets a value indicating the horizontal alignment of the grid table.

C#
public override HorizontalAlign HorizontalAlign { get; set; }
Property Value:

One of the HorizontalAlign values. The default is NotSet.

Overrides: GridTableViewBase.HorizontalAlign

Use the HorizontalAlign property to specify the horizontal alignment of a GridTableView control within the page. The following table lists the different horizontal alignment styles.

Alignment valueDescription
HorizontalAlign.NotSetThe horizontal alignment of the GridTableView control has not been set.
HorizontalAlign.LeftThe GridTableView control is left-aligned on the page.
HorizontalAlign.CenterThe GridTableView control is centered on the page.
HorizontalAlign.RightThe GridTableView control is right-aligned on the page.
HorizontalAlign.JustifyThe GridTableView control is aligned with both the left and right margins of the page.
Example:
cs-api-definition
RadGrid1.HorizontalAlign = HorizontalAlign.Right

Gets or sets the programmatic identifier assigned to the current GridTableView.

C#
[Browsable(false)]
public override string ID { get; set; }
Property Value:

The programmatic identifier assigned to the control.

Overrides: Control.ID

This property is set automatically by RadGrid object that owns this instance.

Gets or sets a value determining the position of the GridEditFormInsertItem.

C#
public GridInsertItemDisplay InsertItemDisplay { get; set; }
Property Value:

A value determining the position of the GridEditFormInsertItem.

Gets or sets on which page the GridTableView will go after item insertion.

C#
public GridInsertItemPageIndexAction InsertItemPageIndexAction { get; set; }

Gets or sets the name of the method to call in order to insert data

C#
public string InsertMethod { get; set; }

Gets or sets the Expanded value of the GridFilteringItem.

C#
public bool IsFilterItemExpanded { get; set; }
Property Value:

The Expanded value of the GridFilteringItem.

Gets or sets a value indicating if the GridTableView is currently in insert mode.

C#
[Browsable(false)]
public bool IsItemInserted { get; set; }
Property Value:

true, if the GridTableView is currently in insert mode; otherwise, false.

The ItemInserted property indicates if the GridTableView is currently in insert mode. After setting it you should call the Rebind() method. You can also use the InsertItem() method, that will also reposition the grid to show the last page, where the newly inserted item is generally displayed.

Gets a collection of GridDataItem objects that represent the data items in a GridDataItem control.

C#
[Browsable(false)]
public virtual GridDataItemCollection Items { get; }
Property Value:

A GridDataItemCollection that contains all the data items in a GridTableView control

The Items property (collection) is used to store the data items in a GridTableView control. The GridTableView control automatically populates the Items collection by creating a GridDataItem object for each record in the data source and then adding each object to the collection. This property is commonly used to access a specific item in the control or to iterate though the entire collection of items.

Indicates whether the items have been created, generally by data-binding.

C#
[Browsable(false)]
public bool ItemsCreated { get; }
Property Value:

true, if the items have beed created; otherwise, false.

Gets a collection of all data items of a grid table view and items that belong to child tables of the GridTableView if the hierarchy is expanded. The items are collected depth-first. The property Items actually referres to ItemsHierarchy of
MasterTableView. This property can be used to traverse all
DataItems items in the hiearchy of a GridTableView.

C#
[Browsable(false)]
public virtual GridDataItemCollection ItemsHierarchy { get; }
Property Value:

A GridDataItemCollection of all data items of a grid table view and items that belong to child tables of the GridTableView if the hierarchy is expanded.

Gets a reference to the GridTableItemStyle object that allows you to set the appearance of items in a GridTableView control.

C#
[PersistenceMode(PersistenceMode.InnerProperty)]
public virtual GridTableItemStyle ItemStyle { get; }
Property Value:

A reference to the GridTableItemStyle that represents the style of data items in a GridTableView control. If style is not altered (is default) ItemStyle is used.

Gets or sets the ItemTemplate, which is rendered in the control in normal (non-Edit) mode.

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

A value of type System.Web.UI.CompiledBindableTemplateBuilder

Gets a referenct to the GridTableItemStyle object that allows you to set the appearance of the multi header item in a >GridTableView control.

C#
[PersistenceMode(PersistenceMode.InnerProperty)]
public GridTableItemStyle MultiHeaderItemStyle { get; }
Property Value:

A reference to the GridTableItemStyle that represents the style of the multi header item.

Gets or sets the name of the GridTableView.

C#
public virtual string Name { get; set; }
Property Value:

The string representation of the Name of the GridTableView it is assigned to. The default is String.Empty ("").

The Name property can be used distinguish different GridTableView instances. Often used to set different settings for different views conditionally.

Example:
C#
<p>The following example demonstrates different action on</p>
<p>[ASPX/ASCX]</p>

&lt;script type="text/javascript" &gt;<br />
function OnRowDblClick(index)<br />
{<br />
 if(this.Name == "MasterTableView")<br />
 {<br />
 alert("Cliecked row with index " + index + " of the MasterTableView");<br />
 }<br />
 if(this.Name == "DetailTableView1")<br />
 {<br />
 alert("Clicked row with index " + index + " of the first detail table");<br />
 }<br />
 if(this.Name == "DetailTableView2")<br />
 {<br />
 alert("Clicked row with index " + index + " of the second detail table");<br />
 }<br />
}<br />
&lt;/script&gt;<br />
<br />
&lt;radG:RadGrid ID="RadGrid1" runat="server" &gt;<br />
 &lt;MasterTableView Name="MasterTableView"&gt;<br />
 &lt;DetailTables&gt;<br />
 &lt;radG:GridTableView Name="DetailTableView1" &gt;<br />
 &lt;/radG:GridTableView&gt;<br />
 &lt;radG:GridTableView Name="DetailTableView2"&gt;<br />
 &lt;/radG:GridTableView&gt;<br />
 &lt;/DetailTables&gt;<br />
 &lt;/MasterTableView&gt;<br />
 &lt;ClientSettings&gt;<br />
 &lt;ClientEvents OnRowDblClick="OnRowDblClick"&gt;&lt;/ClientEvents&gt;<br />
 &lt;/ClientSettings&gt;<br />
&lt;/radG:RadGrid&gt;

Gets a set of options for the GridTableView's data-bound nested view template.

C#
[PersistenceMode(PersistenceMode.InnerProperty)]
public GridNestedViewSettings NestedViewSettings { get; }

Gets or sets the ItemTemplate, which is rendered in the control in normal (non-Edit) mode.

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

A value of type System.Web.UI.CompiledBindableTemplateBuilder

Gets or sets the text that will be displayed in there is no NoRecordsTemplate defined and no records in the Detail tables.

C#
public string NoDetailRecordsText { get; set; }
Property Value:

The text to display in the empty data item. The default is an empty string (""), which indicates that this property is not set.

The empty data row is displayed in a GridTableView control when the data source that is bound to the control does not contain any records. Use the NoMasterRecordsText and NoDetailRecordsText property to specify the text to display in the empty data item. Alternatively, you can define your own custom user interface (UI) for the empty data item by setting the NoRecordsTemplate property instead of this property.

Gets or sets the text that will be displayed in there is no NoRecordsTemplate defined and no records in the MasterTableView.

C#
public string NoMasterRecordsText { get; set; }
Property Value:

The text to display in the empty data item. The default is an empty string ("") which indicates that this property is not set.

The empty data row is displayed in a GridTableView control when the data source that is bound to the control does not contain any records. Use the NoMasterRecordsText and NoDetailRecordsText property to specify the text to display in the empty data item. Alternatively, you can define your own custom user interface (UI) for the empty data item by setting the NoRecordsTemplate property instead of this property.

Gets or sets the template that will be displayed if a GridTableView control is bound to a data source that does not contain any records.

C#
[TemplateContainer(typeof(GridTableView))]
[Browsable(false)]
[Bindable(false)]
[PersistenceMode(PersistenceMode.InnerProperty)]
public ITemplate NoRecordsTemplate { get; set; }
Property Value:

A System.Web.UI.ITemplate that contains the custom content for the empty data row. The default value is a null reference (Nothing in Visual Basic), which indicates that this property is not set.

You can set the text that will appear in the NoRecordsTemplate through NoMasterRecordsText and NoDetailRecordsText properties.

By default if Items.Count equals 0, GridTableView will render no records message.

If NoRecordsTemplate and NoMasterRecordsText/NoDetailRecordsText are set, the NoRecordsTemplate property has priority.

Example:
cs-api-definition
RadGrid1.MasterTableView.NoRecordsTemplate = New NoRecordsTemplate()

Public Class NoRecordsTemplate
Implements ITemplate

Public Sub New()
End Sub

Public Sub InstantiateIn(ByVal container As System.Web.UI.Control) Implements System.Web.UI.ITemplate.InstantiateIn
Dim lbl As Label = New Label()
lbl.ID = "Label1"
lbl.Text = "Currently there are no items in this folder."
lbl.ForeColor = System.Drawing.Color.RoyalBlue
container.Controls.Add(lbl)
End Sub
End Class

Gets or sets a value indicating if the GridTableView should override the default DataSourceControl sorting with grid native sorting.

C#
public bool OverrideDataSourceControlSorting { get; set; }

You can set this to true in case of ObjectDataSource with IEnumerable data without implemented sorting.

Gets the ClientID of the RadGrid object that contains this instance.

C#
[Browsable(false)]
public virtual string OwnerID { get; }
Property Value:

The string representation of the ClientID object that contains the instance.

Gets the number of pages required to display the records of the data source in a GridTableView control.

C#
[Browsable(false)]
public int PageCount { get; }
Property Value:

The number of pages in a GridTableView control.

When the paging feature is enabled (by setting the AllowPaging property to true), use the PageCount property to determine the total number of pages required to display the records in the data source. This value is calculated by dividing the total number of records in the data source by the number of records displayed in a page (as specified by the PageSize property) and rounding up.

Gets a reference to the GridPagerStyle object that allows you to set the appearance of the pager item in a GridTableView control.

C#
[PersistenceMode(PersistenceMode.InnerProperty)]
public GridPagerStyle PagerStyle { get; }
Property Value:

A reference to the GridPagerStyle that represents the style of the pager item in a GridTableView control. If style is not altered (is default) PagerStyle is used.

Use the PagerStyle property to control the appearance of the pager item in a GridTableView control. The pager item is displayed when the paging feature is enabled (by setting the AllowPaging property to true) and contains the controls that allow the user to navigate to the different pages in the control. This property is read-only; however, you can set the properties of the GridPagerStyle object it returns. The properties can be set declaratively using one of the following methods:

  • Place an attribute in the opening tag of the GridTableView control in the form Property-Subproperty, where Subproperty is a property of the GridPagerStyle object (for example, PagerStyle-ForeColor).
  • Nest a <PagerStyle> element between the opening and closing tags of the GridTableView control.

The properties can also be set programmatically in the form Property.Subproperty (for example, PagerStyle.ForeColor). Common settings usually include a custom background color, foreground color, and font properties.

Gets or sets the custom content for the pager item in a GridTableView control.

C#
[TemplateContainer(typeof(GridItem))]
[Browsable(false)]
[Bindable(false)]
[PersistenceMode(PersistenceMode.InnerProperty)]
public ITemplate PagerTemplate { get; set; }
Property Value:

A System.Web.UI.ITemplate that contains the custom content for the pager item. The default value is null, which indicates that this property is not set.

If this template is set, RadGrid will not create the default pager controls.

Specify the maximum number of items that would appear in a page, when paging is enabled by AllowPaging or AllowCustomPaging property. Default value is the value of PageSize.

C#
public virtual int PageSize { get; set; }
Property Value:

The number of records to display on a single page. The default is 10.

Exceptions: ArgumentOutOfRangeException

The PageSize property is set to a value less than 1.

When the paging feature is enabled (by setting the AllowPaging property to true), use the PageSize property to specify the number of records to display on a single page.

Gets a Paging object that is the result of paging settings and runtime paging state of the grid.

C#
[Browsable(false)]
public GridPagingManager PagingManager { get; }
Property Value:

A >GridPagingManager object that corresponds to the Paging object.

Note that changes made to this object would not have effect on the structure of the grid.

Gets a reference to a GridItem that is a parent of this GridTableView, when this GridTableView represents a child table in a hierarchical structure.

C#
[Browsable(false)]
public GridDataItem ParentItem { get; }
Property Value:

A reference to the server control's parent control.

Whenever a page is requested, a hierarchy of server controls on that page is built. This property allows you to determine the parent control of the current server control in that hierarchy, and to program against it.

Gets or sets the collection of data-field pairs that describe the relations in a hierarchical grid.

C#
[PersistenceMode(PersistenceMode.InnerProperty)]
public GridTableViewRelation ParentTableRelation { get; }
Property Value:

A GridTableViewRelation collection of data-field pairs that describe the relations in a hierarchical grid.

If you have specified the relations RadGrid will automatically filter the child data-source when when binding detail-tables. The specified MasterKeyField in each GridRelationFields in this collection should be a Key that is specified in the parent table's DataKeyNames array. Each DetailKeyField specfied should also be included in this GridTableView's DataKeyNames array. MasterTableView does not need any ParentTableRelations.

Gets or sets a value indicating whether white-space characters inside the filter expression will be trimmed.

C#
public virtual bool PersistWhiteSpacesInFilter { get; set; }

When the value is true, it will not be trimmed and any white-space characters in it will be included in the filter expression.

Gets the rendering style of an ActiveItem.

C#
[Browsable(false)]
public GridTableItemStyle RenderActiveItemStyle { get; }
Property Value:

A reference to the GridTableItemStyle that represents the rendering style of an ActiveItem.

Gets the rendering style of the AlternatingItem.

C#
[Browsable(false)]
public GridTableItemStyle RenderAlternatingItemStyle { get; }
Property Value:

A reference to the GridTableItemStyle that represents the rendering style of the AlternatingItem. If AlternatingItemStyle is not specified the return value is OwnerGrid.AlternatingItemStyle.

Gets an array of all columns that are used when rendering the grid instance.

C#
[SuppressMessage("Microsoft.Performance", "CA1819:PropertiesShouldNotReturnArrays")]
[Browsable(false)]
[SuppressMessage("Microsoft.Performance", "CA1800:DoNotCastUnnecessarily")]
public GridColumn[] RenderColumns { get; }
Property Value:

An array of all columns that are used when rendering the grid instance.

Modifying the array would not affect rendering as it is regenerated before each data-bind. To modify the list of columns available use Columns property.

Gets the rendering style of a CommandItem.

C#
[Browsable(false)]
public GridTableItemStyle RenderCommandItemStyle { get; }
Property Value:

A reference to the GridTableItemStyle that represents the rendering style of a CommandItem. If CommandItemStyle is not specified the return value is OwnerGrid.CommandItemStyle.

Gets the rendering style of an edit Item.

C#
[Browsable(false)]
public GridTableItemStyle RenderEditItemStyle { get; }
Property Value:

A reference to the GridTableItemStyle that represents the rendering style of an edit item. If EditItemStyle is not specified the return value is OwnerGrid.EditItemStyle.

Gets the rendering style of a FilterItem.

C#
[Browsable(false)]
public GridTableItemStyle RenderFilterItemStyle { get; }
Property Value:

A reference to the GridTableItemStyle that represents the rendering style of a FilterItem. If FilterItemStyle is not specified the return value is OwnerGrid.FilterItemStyle

Gets the rendering style of an FooterItem.

C#
[Browsable(false)]
public GridTableItemStyle RenderFooterStyle { get; }
Property Value:

A reference to the GridTableItemStyle that represents the rendering style of an FooterItem. If FooterStyle is not specified the return value is OwnerGrid.FooterStyle.

Gets the rendering style of the group header items.

C#
[Browsable(false)]
public GridTableItemStyle RenderGroupHeaderItemStyle { get; }
Property Value:

A reference to the GridTableItemStyle that represents the rendering style of the group header items. If GroupHeaderItemStyle is not specified the return value is OwnerGrid.GroupHeaderItemStyle.

Gets the rendering style of a GridHeaderItem.

C#
[Browsable(false)]
public GridTableItemStyle RenderHeaderStyle { get; }
Property Value:

A reference to the GridTableItemStyle that represents the rendering style of the GridHeaderItem. If HeaderStyle is not specified the return value is OwnerGrid.HeaderStyle.

Gets the rendering style of an Item.

C#
[Browsable(false)]
public GridTableItemStyle RenderItemStyle { get; }
Property Value:

A reference to the GridTableItemStyle that represents the rendering style of the item. If ItemStyle is not specified the return value is OwnerGrid.ItemStyle.

Gets the rendering style of a MultiHeaderItem.

C#
[Browsable(false)]
public GridTableItemStyle RenderMultiHeaderItemStyle { get; }
Property Value:

A reference to the GridTableItemStyle that represents the rendering style of a MultiHeaderItem. If MultiHeaderItemStyle is not specified the return value is OwnerGrid.MultiHeaderItemStyle.

Gets the rendering style of the Pager item.

C#
[Browsable(false)]
public GridPagerStyle RenderPagerStyle { get; }
Property Value:

A reference to the GridTableItemStyle that represents the rendering style of the pager item. If PagerStyle is not specified the return value is OwnerGrid.PagerStyle.

Gets or sets a value indicating whether RadGrid will be built on PreRender unless it was built before that. This property is supposed for Telerik RadGrid internal usage, yet you can set it with care.

C#
[Browsable(false)]
public bool RequiresBinding { get; set; }
Property Value:

true, if the RadGrid will be built on PreRender; otherwise, false.

Gets a DataView object that represents the data sent to the GridTableView to be displayed.

C#
[Browsable(false)]
public DataView ResolvedDataSourceView { get; }
Property Value:

A result DataView object of all grid operations.

ResolvedDataSourceView is available only in ItemDataBound event handler i.e. when the grid is bound.

Gets or sets a value indicating if the Expanded property of both hierarchy and group items will be retained after a call to Rebind() or Rebind() method.

C#
public bool RetainExpandStateOnRebind { get; set; }

Gets or sets a value indicating whether the GridTableView will extract all bindable properties from the DataSource when binding, to perform operations like sorting, grouping, etc on DataFields that are not included in the column declarations.

C#
public bool RetrieveAllDataFields { get; set; }
Property Value:

true, if the GridTableView will extract all bindable properties from the DataSource when binding; otherwise, false. The default value is true.

You can also use the AdditionalDataFieldNames array to indicate RadGrid DataFieldNames that should be sorted, grouped, ect and are not included as columns.

Gets or sets a value indicating whether items' data type should be retrieved from supplied enumerable's first item.

C#
public virtual bool RetrieveDataTypeFromFirstItem { get; set; }
Property Value:

true if this function is enabled; otherwise, false. The default is false.

You should enable this property in scenarios in which the item type should not be retrieved from the enumerable's generic argument but from its first item's type. Such cases will be the use of various O/R Mappers where the enumerable is a entity base class and does not contains the actual object's properties.

Gets or sets a value indicating whether null values in the database will be retrieved as dbnull values.

C#
public bool RetrieveNullAsDBNull { get; set; }
Property Value:

true if the null values in the database will be retrieved as dbnull values; otherwise, false. The default is false.

Gets a reference to the RowIndicatorColumn object, allowing you to customize its settings.

C#
[Browsable(false)]
[PersistenceMode(PersistenceMode.InnerProperty)]
public GridRowIndicatorColumn RowIndicatorColumn { get; set; }

The property setter does nothing and should not be used. It works around a bug in the VS.NET designer.

Gets a reference to the Style object that allows you to set the appearance of the selected item GridTableView control.

C#
[Browsable(false)]
public Style SelectedItemStyle { get; }
Property Value:

A reference to the Style object that represents the style of the selected item in a GridTableView control. If style is not altered (is default) SelectedItemStyle is used.

Use the SelectedItemStyle property to control the appearance of the selected item in a GridTableView control. This property is read-only; however, you can set the properties of the Style object it returns. The properties can be set declaratively using one of the following methods:

  • Place an attribute in the opening tag of the GridTableView control in the form Property-Subproperty, where Subproperty is a property of the Style object (for example, SelectedItemStyle-ForeColor).
  • Nest a <SelectedRowStyle> element between the opening and closing tags of the GridTableView control.

The properties can also be set programmatically in the form Property.Subproperty (for example, SelectedItemStyle.ForeColor). Common settings usually include a custom background color, foreground color, and font properties.

Example:
cs-api-definition
RadGrid1.SelectedItemStyle.BackColor = System.Drawing.Color.Azure

Gets or sets the name of the method to call in order to read data

C#
public override string SelectMethod { get; set; }

Overrides: DataBoundControl.SelectMethod

Gets a set the options for GridTableView's self-hierarchy behavior.

C#
[PersistenceMode(PersistenceMode.InnerProperty)]
public GridSelfHierarchySettings SelfHierarchySettings { get; }
Property Value:

Options for GridTableView's self-hierarchy behavior.

Gets or sets a value indicating if the GridFooterItem will be shown in the current GridTableView.

C#
public bool ShowFooter { get; set; }
Property Value:

true, if the GridFooterItem will be shown in the current GridTableView; otherwise, false. The default value is false.

Gets or sets a value indicating if the GridGroupFooterItem will be shown in the current GridTableView.

C#
public bool ShowGroupFooter { get; set; }
Property Value:

true, if the GridGroupFooterItem will be shown in the current GridTableView; otherwise, false. The default value is true.

Gets or sets a value indicating if the GridHeaderItem will be shown in the current GridTableView.

C#
public bool ShowHeader { get; set; }
Property Value:

true, if the GridHeaderItem will be shown in the current GridTableView; otherwise, false. The default value is true.

If set to true (the default) GridNoRecordsItem is used to display no records template. This item is the only one displayed in the GridTableView in this case.

C#
public bool ShowHeadersWhenNoRecords { get; set; }

Gets a collection of sort expressions for this table view instance, associated with the column or columns being sorted.

C#
[PersistenceMode(PersistenceMode.InnerProperty)]
public GridSortExpressionCollection SortExpressions { get; }
Property Value:

The collection of sort expressions associated with the column or columns being sorted.

Modifying the SortExpressions collection will result in change of the order of appearance of items in the table view. If AllowMultiColumnSorting is set to false this collection can only contain one item. Adding other GridSortExpression in the collection in this case will cause existing expression to be deleted or if GridSortExpression with the same same FieldName exist its SortOrder will be changed.

This property's value is preserved in the ViewState.

Gets or sets a value indicating whether the Columns in the HeaderContextMenu will be sorted by default.

C#
public virtual bool SortHeaderContextMenuColumns { get; set; }
Property Value:

true if the sorting of the header context menu columns is enabled; otherwise, false. Default value is the value of SortHeaderContextMenuColumns.

Gets or sets the 'summary' attribute for the respective table.

C#
public virtual string Summary { get; set; }
Property Value:

A string representation of the 'summary' attribute for the respective table.

This attribute provides a summary of the table's purpose and structure for user agents rendering to non-visual media such as speech and Braille. This property is a part of Telerik RadGrid accessibility features.

Gets or sets a string that indicates whether the table layout is fixed.

C#
public virtual GridTableLayout TableLayout { get; set; }
Property Value:

A GridTableLayou value, indicating the table layout type. The default value is Fixed.

The value of the TableLayout property is a string that specifies or receives one of the following GridTableLayout enumeration values:

AutoDefault (except in some scenarios, e.g. when using static headers with grouping or hierarchy). Column width is set by the widest unbreakable content in the column cells.
Fixed Table and column widths are set either by the sum of the widths on the Columns objects or, if these are not specified, by the width of the first row of cells. If no width is specified for the table, it renders by default with width=100%.

Gets or sets the current time zone GridTableView is operating in

C#
public string TimeZoneID { get; set; }
Property Value:

The time zone ID.

Gets or sets the name of the method to call in order to update data

C#
public string UpdateMethod { get; set; }

Gets or sets a value indicating whether the GridTableView should use all retieved properties from the DataSource when binding, to perform operations like sorting, grouping, etc on DataFields that are not included in the column declarations.

C#
public bool UseAllDataFields { get; set; }
Property Value:

false, if the GridTableView will not use all bindable properties from the DataSource when binding; otherwise, true. The default value is false.

You can also use the AdditionalDataFieldNames array to indicate RadGrid DataFieldNames that should be sorted, grouped, ect and are not included as columns.

C#
[Browsable(true)]
[Bindable(true)]
public virtual int VirtualItemCount { get; set; }

Gets or sets the width of the Web server control.

C#
public override Unit Width { get; set; }
Property Value:

A Unit that represents the width of the control. The default is Empty.

Exceptions: ArgumentException

The width of the Web server control was set to a negative value.

Overrides: WebControl.Width

Methods

C#
protected void BuildDetailTablesFromDataSource(DataTable parentTable, GridTableView parentTableView)
Parameters:parentTableDataTableparentTableViewGridTableView

Removes all edit items that belong to the GridTableView instance.

C#
public void ClearEditItems()

Removes all selected items that belong to this GridTableView instance.

C#
public void ClearSelectedItems()
C#
protected override int CreateChildControls(IEnumerable dataSource, bool useDataSource)
Parameters:dataSourceIEnumerableuseDataSourceboolReturns:

int

Overrides: CompositeDataBoundControl.CreateChildControls(IEnumerable, bool)

Recreates all GridItems and chld controls, using the DataSource or the ViewState

C#
protected override void CreateControlHierarchy(bool useDataSource)
Parameters:useDataSourcebool

'True' means that DataBind() is executing. 'False' means that Viewtate has been just loaded after postback.

Overrides: GridTableViewBase.CreateControlHierarchy(bool)

C#
protected override DataSourceSelectArguments CreateDataSourceSelectArguments()
Returns:

DataSourceSelectArguments

Overrides: DataBoundControl.CreateDataSourceSelectArguments()

C#
protected void CreateMobileViews()

This method is used by RadGrid internally. Please do not use.

C#
protected virtual GridTableView CreateTableView(RadGrid owner, bool isTrackingViewState)
Parameters:ownerRadGridisTrackingViewStateboolReturns:

GridTableView

Binds the data source to the RadGrid instance.

C#
public override void DataBind()

Overrides: BaseDataBoundControl.DataBind()

Call this member to bind partially RadGrid. Before calling this method the DataSource property should be assigned or you can use Rebind() method instead. Use DataBind() or Rebind() member to bind all GridTableViews in RadGrid.

Exports the grid data in CSV format using the properties set in ExportSettings

C#
public void ExportToCSV()

Exports the grid data in Microsoft Excel format using the properties set in the ExportSettings.

C#
public void ExportToExcel()

Exports the grid data in PDF format using the properties set in the ExportSettings.

C#
public void ExportToPdf()

Exports the grid data in Microsoft Word format based on the selected ExportSettings.

C#
public void ExportToWord()

The passed IDictionary object (like Hashtable for example) will be filled with the names/values of the corresponding column data-fields and their values. Only instances of type GridEditableColumn support extracting values.

C#
public void ExtractValuesFromItem(IDictionary newValues, GridEditableItem editedItem)
Parameters:newValuesIDictionary

the dictionary that will be filled

editedItemGridEditableItem

the item to extract values from

C#
protected virtual void FilterDetailDataSource()

Finds the GridDataItem based on specified key name and key value.

C#
public GridDataItem FindItemByKeyValue(string keyName, object keyValue)
Parameters:keyNamestring

The key name.

keyValueobject

The key value.

Returns:

GridDataItem

Finds a collection of GridDataItem objects based on a IDictionary of key values.

C#
[SuppressMessage("Microsoft.Performance", "CA1800:DoNotCastUnnecessarily")]
public GridDataItem[] FindItemsByKeyValues(IDictionary dictionary)
Parameters:dictionaryIDictionary

The dictionary containing key values..

Returns:

GridDataItem[]

Generates the text representing the Export Output for Microsoft Excel XSLX format using the properties set in the ExportSettings.

C#
public string GenerateXlsxOutput()
Returns:

string

Generates a SpreadProcessing Workbook that can be exported to a number of formats such as XLSX, PDF and others. For more information, check https://docs.telerik.com/devtools/document-processing/libraries/radspreadprocessing/formats-and-conversion/general-information

C#
public object GenerateXlsxOutput<T>()
Returns:

object

Returns the column editor for the specified column for EditMode="Batch". Note that you should use GetBatchEditorContainer method for template columns which will return the panel container and then use a FindControl method to find your control.

C#
public IGridColumnEditor GetBatchColumnEditor(GridColumn column)
Parameters:columnGridColumn

The column for which the column editor will be returned.

Returns:

IGridColumnEditor

Returns the column editor associated with the column.

Returns the column editor from the specified column UniqueName for EditMode="Batch". Note that you should use GetBatchEditorContainer method for template columns which will return the panel container and then use a FindControl method to find your control.

C#
public IGridColumnEditor GetBatchColumnEditor(string columnUniqueName)
Parameters:columnUniqueNamestring

The column unique name for which the column editor will be returned.

Returns:

IGridColumnEditor

Returns the column editor associated with the column.

Returns the Panel that holds the controls initialized from a template or editor for EditMode="Batch".

C#
public Panel GetBatchEditorContainer(GridColumn column)
Parameters:columnGridColumn

The column for which the container will be returned.

Returns:

Panel

Returns the Panel container associated with the column.

Returns the Panel that holds the controls initialized from a template or editor for EditMode="Batch".

C#
public Panel GetBatchEditorContainer(string columnUniqueName)
Parameters:columnUniqueNamestring

The column unique name for which the column editor will be returned.

Returns:

Panel

Returns the Panel container associated with the column.

Returns a GridColumn based on its UniqueName.

C#
public GridColumn GetColumn(string columnUniqueName)
Parameters:columnUniqueNamestring

The UniqueName for the requested column.

Returns:

GridColumn

The GridColumn object related to the columnUniqueName.

Example:
C#
protected void RadGrid1_PreRender(object sender, System.EventArgs e)
{
RadGrid1.MasterTableView.GetColumn( "CustomerID" ).Visible = false;
}

Returns a GridColumn based on its UniqueName.

C#
public GridColumn GetColumnSafe(string columnUniqueName)
Parameters:columnUniqueNamestring

The UniqueName for the requested column.

Returns:

GridColumn

Returns the filter expression for the current table view object using the Entity SQL syntax. This would work only when EnableLinqExpressions property is enabled.

C#
public string GetEntitySqlFilterExpression()
Returns:

string

String value containing the ESQL filter expression

Obtains the GridTableHeaderCell in the header that corresponds to the column unique name passed as an argument.

C#
public GridTableHeaderCell GetHeaderCellByColumnUniqueName(string uniqueName)
Parameters:uniqueNamestring

The targeted column unique name

Returns:

GridTableHeaderCell

A GridTableHeaderCell representing the column header cell

Get the item that appears when grid is in Insert Mode.

C#
public virtual GridEditableItem GetInsertItem()
Returns:

GridEditableItem

A reference to the newly inserted item for the respective GridTableView.

There is scenarios in which you need to make some changes with/depending on the inserted item.

If you want to predifine some controls values on item insertion, you should use the ItemCommand server-side event to access it:

            [C#]
private void RadGrid1_ItemCommand(object source, Telerik.Web.UI.GridCommandEventArgs e)
{
if (e.CommandName == RadGrid.InitInsertCommandName)
{
e.Canceled = true;
e.Item.OwnerTableView.InsertItem();
GridEditableItem insertedItem = e.Item.OwnerTableView.GetInsertItem();
GridEditFormItem editFormItem = insertedItem as GridEditFormItem;

TextBox box = editFormItem.FindControl("txtEmployeeID") as TextBox;
box.Text = "11";
}
}
                    
[VB.NET]
            Private Sub RadGrid1_ItemCommand(ByVal source As Object, ByVal e As Telerik.Web.UI.GridCommandEventArgs) Handles RadGrid1.ItemCommand
If (e.CommandName = RadGrid.InitInsertCommandName) Then
e.Canceled = True
e.Item.OwnerTableView.InsertItem()
Dim insertedItem As GridEditableItem = e.Item.OwnerTableView.GetInsertItem()
Dim editFormItem As GridEditFormItem = CType(insertedItem, GridEditFormItem)

Dim box As TextBox = CType(MyUserControl.FindControl("insertedItem"), TextBox)
box.Text = "11"
End If
End Sub

If you want to get access to the newly added row and its values to update in a custom data source, you can use the InsertCommand event:

[C#]

                    protected void RadGrid1_InsertCommand(object source, GridCommandEventArgs e)  
{
GridDataInsertItem gridDataInsertItem =
(GridDataInsertItem)(RadGrid1.MasterTableView.GetInsertItem());
Hashtable ht = new Hashtable();
gridDataInsertItem.ExtractValues(ht);
//Loop through each "DictionaryEntry" in hash table and insert using key value
foreach (DictionaryEntry ent in ht)
{
//get the key values and insert to custom datasource.
}

}

[Visual Basic]

            Protected Sub RadGrid1_InsertCommand(ByVal source As Object, ByVal e As GridCommandEventArgs)
Dim gridDataInsertItem As GridDataInsertItem = CType(RadGrid1.MasterTableView.GetInsertItem,GridDataInsertItem)
Dim ht As Hashtable = New Hashtable
gridDataInsertItem.ExtractValues(ht)
'Loop through each "DictionaryEntry" in hash table and insert using key value
For Each ent As DictionaryEntry In ht
'get the key values and insert to custom datasource.
Next
End Sub

Returns a collection of GridItem objects based on their ItemType.

C#
public GridItem[] GetItems(params GridItemType[] includeItemTypes)
Parameters:includeItemTypesGridItemType[]

The ItemType, which will be used as a criteria for the collection.

Returns:

GridItem[]

A GridItems collection of objects based on their ItemType.

C#
protected virtual ITemplate GetNoRecordsTemplate()
Returns:

ITemplate

Gets the currently RadGrid selected items.

C#
public GridDataItem[] GetSelectedItems()
Returns:

GridDataItem[]

Returns an Array of GridDataItem objects representing the currently selected items.

C#
protected virtual object GetSPViewFieldValue<T>(T resultItem, string fieldName)
Parameters:resultItemTfieldNamestringReturns:

object

C#
protected virtual bool HandleDeleteCallback(int affectedRows, Exception ex, GridEditableItem item, bool suppressRebind)
Parameters:affectedRowsintexExceptionitemGridEditableItemsuppressRebindboolReturns:

bool

C#
protected virtual bool HandleInsertCallback(int affectedRows, Exception ex, GridEditableItem item, bool suppressRebind)
Parameters:affectedRowsintexExceptionitemGridEditableItemsuppressRebindboolReturns:

bool

C#
protected virtual bool HandleUpdateCallback(int affectedRows, Exception ex, GridEditableItem item, bool suppressRebind)
Parameters:affectedRowsintexExceptionitemGridEditableItemsuppressRebindboolReturns:

bool

Places the GridTableView in insert mode, allowing user to insert a new data-item values. The CurrentPageIndex will be set to display the last page. You can use also the IsItemInserted to place the GridTableView in insert mode.

C#
public virtual void InsertItem()

Places the GridTableView in insert mode, allowing the user to insert a new data-item values. The GridInsertItem created will be bound to values found in newValues dictionary; The CurrentPageIndex will be set to display the last page. You can use also the IsItemInserted to place the GridTableView in insert mode.

C#
public virtual void InsertItem(IDictionary newValues)
Parameters:newValuesIDictionary

Places the GridTableView in insert mode, allowing the user to insert a new data-item values. The GridInsertItem created will be bound to values of the newDataItem object. The CurrentPageIndex will be set to display the last page. You can use also the IsItemInserted property to place the GridTableView in insert mode.

C#
public virtual void InsertItem(object newDataItem)
Parameters:newDataItemobject
C#
protected override void LoadControlState(object savedState)
Parameters:savedStateobject

Overrides: GridTableViewBase.LoadControlState(object)

C#
protected override void LoadViewState(object savedState)
Parameters:savedStateobject

Overrides: GridTableViewBase.LoadViewState(object)

C#
protected override void OnDataPropertyChanged()

Overrides: DataBoundControl.OnDataPropertyChanged()

C#
protected override void OnDataSourceViewChanged(object sender, EventArgs e)
Parameters:senderobjecteEventArgs

Overrides: DataBoundControl.OnDataSourceViewChanged(object, EventArgs)

C#
protected override void OnInit(EventArgs e)
Parameters:eEventArgs

Overrides: GridTableViewBase.OnInit(EventArgs)

C#
protected override void OnLoad(EventArgs e)
Parameters:eEventArgs

Overrides: DataBoundControl.OnLoad(EventArgs)

C#
protected override void OnPreRender(EventArgs e)
Parameters:eEventArgs

Overrides: BaseDataBoundControl.OnPreRender(EventArgs)

Perform delete operation, using the DataSourceControl API. Please make sure you have specified the correct DataKeyNames for the GridTableView.

C#
public virtual void PerformDelete(GridEditableItem editedItem, bool suppressRebind)
Parameters:editedItemGridEditableItem

The item that should be deleted

suppressRebindbool

Set to true to stop error from binding

Perform asynchronous delete operation, using the DataSourceControl API the Rebinds the grid. Please make sure you have specified the correct DataKeyNames for the GridTableView. When the asynchronous operation calls back, RadGrid will fire ItemDeleted event.

C#
public void PerformDelete(GridEditableItem editedItem)
Parameters:editedItemGridEditableItem

The item that should be deleted

Perform asynchronous insert of the new item, diplayed by RadGrid when in edit mode, using the DataSourceControl API, then Rebind(). When the asynchronous operation calls back, RadGrid will fire ItemInserted event.

C#
public void PerformInsert()

Perform asynchronous insert operation, using the DataSource control API. When the asynchronous operation calls back, RadGrid will fire ItemInserted event.

C#
public virtual void PerformInsert(GridEditableItem editedItem, bool suppressRebind)
Parameters:editedItemGridEditableItem

the item to be inserted

suppressRebindbool

True to prevent from binding after the insert operartion completes.

Performs asynchronous insert operation, using the DataSourceControl API, then Rebinds. When the asynchronous operation calls back, RadGrid will fire ItemInserted event.

C#
public void PerformInsert(GridEditableItem editedItem)
Parameters:editedItemGridEditableItem

item to be inserted

C#
protected override void PerformSelect()

Overrides: DataBoundControl.PerformSelect()

Perform asynchronous update operation, using the DataSource control API. Please make sure you have specified the correct DataKeyNames for the GridTableView. When the asynchronous operation calls back, RadGrid will fire ItemUpdated event. The boolean property defines if RadGrid will Rebind() after the update.

C#
public virtual void PerformUpdate(GridEditableItem editedItem, bool suppressRebind)
Parameters:editedItemGridEditableItem

the item that is in edit mode and should be updated

suppressRebindbool

set to true to prevent grid from binding after the update operation completes

Perform asynchronous update operation, using the DataSource control API and the Rebind method. Please, make sure you have specified the correct DataKeyNames for the GridTableView. When the asynchronous operation calls back, RadGrid will fire ItemUpdated event.

C#
public void PerformUpdate(GridEditableItem editedItem)
Parameters:editedItemGridEditableItem

The following online example uses PerformUpdate method:

Edit on double-click

Applies all view changes to control hierarchy before rendering

C#
protected override void PrepareControlHierarchy()

Overrides: GridTableViewBase.PrepareControlHierarchy()

C#
protected virtual void PrepareDataSource()

Forces the Owner RadGrid to fire NeedDataSource event then calls DataBind().

C#
public void Rebind()

The Rebind method should be called every time a change to the RadGrid columns/items has been made.

C#
protected virtual void ResetAllowAutomaticDeletes()
C#
protected virtual void ResetAllowAutomaticInserts()
C#
protected virtual void ResetAllowAutomaticUpdates()
C#
protected virtual void ResetAllowCustomPaging()
C#
protected virtual void ResetAllowFilteringByColumn()
C#
protected virtual void ResetAllowPaging()
C#
protected virtual void ResetAllowSorting()
C#
protected virtual void ResetAutoGenerateColumns()
C#
protected virtual void ResetGridLines()
C#
protected virtual void ResetHorizontalAlign()
C#
protected virtual void ResetPageSize()
C#
protected virtual void ResetShowFooter()
C#
protected virtual void ResetShowHeader()
C#
protected virtual void ResetVirtualItemCount()
C#
protected override object SaveControlState()
Returns:

object

Overrides: GridTableViewBase.SaveControlState()

C#
protected override object SaveViewState()
Returns:

object

Overrides: GridTableViewBase.SaveViewState()

C#
protected virtual bool ShouldSerializeAllowAutomaticDeletes()
Returns:

bool

C#
protected virtual bool ShouldSerializeAllowAutomaticInserts()
Returns:

bool

C#
protected virtual bool ShouldSerializeAllowAutomaticUpdates()
Returns:

bool

C#
protected virtual bool ShouldSerializeAllowCustomPaging()
Returns:

bool

C#
protected virtual bool ShouldSerializeAllowFilteringByColumn()
Returns:

bool

C#
protected virtual bool ShouldSerializeAllowPaging()
Returns:

bool

C#
protected virtual bool ShouldSerializeAllowSorting()
Returns:

bool

C#
protected virtual bool ShouldSerializeAutoGenerateColumns()
Returns:

bool

C#
protected virtual bool ShouldSerializeEnableHeaderContextFilterMenu()
Returns:

bool

C#
protected virtual bool ShouldSerializeEnableHeaderContextMenu()
Returns:

bool

C#
protected virtual bool ShouldSerializeEnableHierarchyExpandAll()
Returns:

bool

C#
protected virtual bool ShouldSerializeGridLines()
Returns:

bool

C#
protected virtual bool ShouldSerializeHorizontalAlign()
Returns:

bool

C#
protected virtual bool ShouldSerializePageSize()
Returns:

bool

C#
protected virtual bool ShouldSerializeShowFooter()
Returns:

bool

C#
protected virtual bool ShouldSerializeShowHeader()
Returns:

bool

C#
protected virtual bool ShouldSerializeVirtualItemCount()
Returns:

bool

Swaps columns appearance position using the column instances.

C#
public void SwapColumns(GridColumn column1, GridColumn column2)
Parameters:column1GridColumn

The first column.

column2GridColumn

The second column.

Swaps columns appearance position using order indexes of the two columns.

C#
public void SwapColumns(int orderIndex1, int orderIndex2)
Parameters:orderIndex1int

first column order index

orderIndex2int

second column order index

You should have in mind that GridExpandColumn and RowIndicatorColumn are always in front of data columns so that's why you columns will start from index 2.

Swaps columns appearance position using the unique names of the two columns.

C#
public void SwapColumns(string columnName1, string columnName2)
Parameters:columnName1string

first column unique name

columnName2string

second column unique name

C#
protected override void TrackViewState()

Overrides: DataBoundControl.TrackViewState()

In this article
DefinitionConstructorsGridTableView()GridTableView(RadGrid, bool)GridTableView(RadGrid)PropertiesAdditionalDataFieldNamesAllowAutomaticDeletesAllowAutomaticInsertsAllowAutomaticUpdatesAllowCustomPagingAllowCustomSortingAllowFilteringByColumnAllowMultiColumnSortingAllowNaturalSortAllowPagingAllowSortingAlternatingItemStyleAutoGenerateColumnsAutoGeneratedColumnsBatchEditingSettingsCanRetrieveAllDataCaptionCheckListWebServicePathChildEditItemsChildSelectedItemsClientDataKeyNamesClientIDColumnGroupsColumnsColumnSettingsCommandItemDisplayCommandItemSettingsCommandItemStyleCommandItemTemplateCurrentPageIndexCurrentResetPageIndexActionDataKeyNamesDataKeyValuesDataSourceDataSourceCountDataSourceIDDeleteMethodDetailItemTemplateDetailTablesDirEditFormSettingsEditItemStyleEditItemTemplateEditModeEnableColumnsViewStateEnableGroupsExpandAllEnableHeaderContextAggregatesMenuEnableHeaderContextFilterMenuEnableHeaderContextMenuEnableHierarchyExpandAllEnableLinqGroupingEnableNoRecordsTemplateEnableSplitHeaderTextExpandCollapseColumnFilterExpressionFilterItemStyleFooterStyleFrameGridLinesGroupByExpressionsGroupFooterTemplateGroupHeaderItemStyleGroupHeaderTemplateGroupLoadModeGroupsDefaultExpandedHasDetailTablesHasMultiHeadersHeaderStyleHierarchyDefaultExpandedHierarchyIndexHierarchyLoadModeHorizontalAlignIDInsertItemDisplayInsertItemPageIndexActionInsertMethodIsFilterItemExpandedIsItemInsertedItemsItemsCreatedItemsHierarchyItemStyleItemTemplateMultiHeaderItemStyleNameNestedViewSettingsNestedViewTemplateNoDetailRecordsTextNoMasterRecordsTextNoRecordsTemplateOverrideDataSourceControlSortingOwnerIDPageCountPagerStylePagerTemplatePageSizePagingManagerParentItemParentTableRelationPersistWhiteSpacesInFilterRenderActiveItemStyleRenderAlternatingItemStyleRenderColumnsRenderCommandItemStyleRenderEditItemStyleRenderFilterItemStyleRenderFooterStyleRenderGroupHeaderItemStyleRenderHeaderStyleRenderItemStyleRenderMultiHeaderItemStyleRenderPagerStyleRequiresBindingResolvedDataSourceViewRetainExpandStateOnRebindRetrieveAllDataFieldsRetrieveDataTypeFromFirstItemRetrieveNullAsDBNullRowIndicatorColumnSelectedItemStyleSelectMethodSelfHierarchySettingsShowFooterShowGroupFooterShowHeaderShowHeadersWhenNoRecordsSortExpressionsSortHeaderContextMenuColumnsSummaryTableLayoutTimeZoneIDUpdateMethodUseAllDataFieldsVirtualItemCountWidthMethodsBuildDetailTablesFromDataSource(DataTable, GridTableView)ClearEditItems()ClearSelectedItems()CreateChildControls(IEnumerable, bool)CreateControlHierarchy(bool)CreateDataSourceSelectArguments()CreateMobileViews()CreateTableView(RadGrid, bool)DataBind()ExportToCSV()ExportToExcel()ExportToPdf()ExportToWord()ExtractValuesFromItem(IDictionary, GridEditableItem)FilterDetailDataSource()FindItemByKeyValue(string, object)FindItemsByKeyValues(IDictionary)GenerateXlsxOutput()GenerateXlsxOutput<T>()GetBatchColumnEditor(GridColumn)GetBatchColumnEditor(string)GetBatchEditorContainer(GridColumn)GetBatchEditorContainer(string)GetColumn(string)GetColumnSafe(string)GetEntitySqlFilterExpression()GetHeaderCellByColumnUniqueName(string)GetInsertItem()GetItems(params GridItemType[])GetNoRecordsTemplate()GetSelectedItems()GetSPViewFieldValue<T>(T, string)HandleDeleteCallback(int, Exception, GridEditableItem, bool)HandleInsertCallback(int, Exception, GridEditableItem, bool)HandleUpdateCallback(int, Exception, GridEditableItem, bool)InsertItem()InsertItem(IDictionary)InsertItem(object)LoadControlState(object)LoadViewState(object)OnDataPropertyChanged()OnDataSourceViewChanged(object, EventArgs)OnInit(EventArgs)OnLoad(EventArgs)OnPreRender(EventArgs)PerformDelete(GridEditableItem, bool)PerformDelete(GridEditableItem)PerformInsert()PerformInsert(GridEditableItem, bool)PerformInsert(GridEditableItem)PerformSelect()PerformUpdate(GridEditableItem, bool)PerformUpdate(GridEditableItem)PrepareControlHierarchy()PrepareDataSource()Rebind()ResetAllowAutomaticDeletes()ResetAllowAutomaticInserts()ResetAllowAutomaticUpdates()ResetAllowCustomPaging()ResetAllowFilteringByColumn()ResetAllowPaging()ResetAllowSorting()ResetAutoGenerateColumns()ResetGridLines()ResetHorizontalAlign()ResetPageSize()ResetShowFooter()ResetShowHeader()ResetVirtualItemCount()SaveControlState()SaveViewState()ShouldSerializeAllowAutomaticDeletes()ShouldSerializeAllowAutomaticInserts()ShouldSerializeAllowAutomaticUpdates()ShouldSerializeAllowCustomPaging()ShouldSerializeAllowFilteringByColumn()ShouldSerializeAllowPaging()ShouldSerializeAllowSorting()ShouldSerializeAutoGenerateColumns()ShouldSerializeEnableHeaderContextFilterMenu()ShouldSerializeEnableHeaderContextMenu()ShouldSerializeEnableHierarchyExpandAll()ShouldSerializeGridLines()ShouldSerializeHorizontalAlign()ShouldSerializePageSize()ShouldSerializeShowFooter()ShouldSerializeShowHeader()ShouldSerializeVirtualItemCount()SwapColumns(GridColumn, GridColumn)SwapColumns(int, int)SwapColumns(string, string)TrackViewState()
Not finding the help you need?
Contact Support