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

Displays a DropDown control for each item in the column. This allows you to edit for example lookup field(s) from data table(s).

Here is the mechanism which Telerik RadGrid uses to present values for GridDropDownColumn. Consider the snippet below:

<radg:GridDropDownColumn
UniqueName="LevelID"
ListDataMember="Level"
ListTextField="Description"
ListValueField="LevelID"
HeaderText="LevelID"
DataField="LevelID"
/>


As you can see, a requirement for the proper functioning of GridDropDownColumn is that all column values referenced by the DataField attribute match the column values referenced by the ListValueField attribute.
If there are values in the LevelID column of the LevelID table which do not have corresponding equal values in the LevelID column of the Level table, then the grid will display the default first value from the Description column as it will not "know" what is the correct field.

Definition

Namespace:Telerik.Web.UI

Assembly:Telerik.Web.UI.dll

Syntax:

C#
[SuppressMessage("Microsoft.Design", "CA1001:TypesThatOwnDisposableFieldsShouldBeDisposable")]
public class GridDropDownColumn : GridEditableColumn, IStateManager, IComparable, IGridEditableColumn, IGridDataColumn

Inheritance: objectGridColumnGridEditableColumnGridDropDownColumn

Implements: IComparableIGridDataColumnIGridEditableColumnIStateManager

Inherited Members GridEditableColumn.SetDefaultColumnEditor(IGridColumnEditor)GridEditableColumn.GetEditableColumn()GridEditableColumn.FillValues(IDictionary, GridEditableItem)GridEditableColumn.ShouldExtractValues(GridEditableItem)GridEditableColumn.ConvertValueIfEmpty(string)GridEditableColumn.GetActiveDataField()GridEditableColumn.ColumnEditorIDGridEditableColumn.MobileEditorGridEditableColumn.CurrentColumnEditorGridEditableColumn.InnerColumnEditorGridEditableColumn.ColumnEditorGridEditableColumn.ConvertEmptyStringToNullGridEditableColumn.UseNativeEditorsInMobileModeGridEditableColumn.DefaultInsertValueGridEditableColumn.ReadOnlyGridEditableColumn.InsertVisiblityModeGridEditableColumn.ForceExtractValueGridEditableColumn.AllowSortingGridEditableColumn.AllowFilteringGridColumn.Initialize()GridColumn.InitializeCell(TableCell, int, GridItem)GridColumn.SupportsFiltering()GridColumn.ShouldSerializeFilterImageUrl()GridColumn.ShouldSerializeSortAscImageUrl()GridColumn.ShouldSerializeSortDescImageUrl()GridColumn.RefreshCurrentFilterValue(GridFilteringItem, string)GridColumn.RefreshCurrentFilterValue(GridFilteringItem)GridColumn.SetCurrentFilterValueToControl(TableCell)GridColumn.GetCurrentFilterValueFromControl(TableCell)GridColumn.EvaluateFilterExpression(GridFilteringItem)GridColumn.EvaluateFilterExpression()GridColumn.FunctionTakesNoArguments(GridKnownFunction)GridColumn.SetupFilterControls(TableCell)GridColumn.GetFilterFunctionsList(GridFilterListOptions, ArrayList)GridColumn.PrepareCell(TableCell, GridItem)GridColumn.LoadViewState(object)GridColumn.OnColumnChanged()GridColumn.SaveViewState()GridColumn.TrackViewState()GridColumn.ResetCurrentFilterValue(GridFilteringItem)GridColumn.ResetCurrentFilterValue()GridColumn.IsUniqueName(string)GridColumn.GenerateUniqueNameBase(string)GridColumn.TrySetOnClientClickScript(Control, GridItem, string, params string[])GridColumn.UpdateUniqueNameIfDefault(string)GridColumn.IsBoundToFieldName(string)GridColumn.HeaderTooltipGridColumn.HeaderAbbrGridColumn.HeaderAxisGridColumn.SortedBackColorGridColumn.CurrentFilterValueGridColumn.AndCurrentFilterValueGridColumn.ColumnGroupNameGridColumn.SelectedGridColumn.SelectableGridColumn.CurrentFilterFunctionGridColumn.AndCurrentFilterFunctionGridColumn.FilterDelayGridColumn.ExportableGridColumn.EnableHeaderContextMenuGridColumn.ShowFilterIconGridColumn.FilterListOptionsGridColumn.AutoPostBackOnFilterGridColumn.FilterImageToolTipGridColumn.FilterControlToolTipGridColumn.EditorControlToolTipGridColumn.FilterImageUrlGridColumn.SortAscImageUrlGridColumn.SortDescImageUrlGridColumn.DataTypeNameGridColumn.ListOfFilterValuesGridColumn.FilterTemplateGridColumn.TableViewSpecificStateGridColumn.DesignModeGridColumn.FooterStyleGridColumn.FooterTextGridColumn.HeaderImageUrlGridColumn.HeaderStyleGridColumn.HeaderTextGridColumn.IsTrackingViewStateGridColumn.ItemStyleGridColumn.OwnerGridColumn.SortExpressionGridColumn.GroupByExpressionGridColumn.ViewStateGridColumn.ShowSortIconGridColumn.ShowNoSortIconGridColumn.VisibleGridColumn.DisplayGridColumn.OwnerIDGridColumn.OwnerGridIDGridColumn.ResizableGridColumn.ReorderableGridColumn.GroupableGridColumn.ColumnTypeGridColumn.HeaderButtonTypeGridColumn.OrderIndexGridColumn.IsDefaultUniqueNameGridColumn.EditFormColumnIndexGridColumn.UniqueNameGridColumn.EditFormHeaderTextFormatGridColumn.DataTypeGridColumn.FilterControlWidthGridColumn.FilterControlAltTextGridColumn.FilterCheckListWebServiceMethodGridColumn.FilterCheckListEnableLoadOnDemandobject.ToString()object.Equals(object)object.Equals(object, object)object.ReferenceEquals(object, object)object.GetHashCode()object.GetType()object.MemberwiseClone()...

Constructors

C#
public GridDropDownColumn()

Properties

Gets or sets a value indicating whether automatic load-on-demand is enabled for the RadComboBox editor of this column.

C#
public bool AllowAutomaticLoadOnDemand { get; set; }

Gets or sets a value indicating whether virtual scrolling is enabled for RadComboBox editor. Setting this property to true requires AllowAutomaticLoadOnDemand to be set to true

C#
public bool AllowVirtualScrolling { get; set; }

Gets a reference to the GridColumnValidationSettings object that allows you to set the properties associated with the columns' validation base on autogenerated validators.

C#
[PersistenceMode(PersistenceMode.InnerProperty)]
public GridColumnValidationSettings ColumnValidationSettings { get; }

The DataField property points to the column in the grid data-source containing values which will be compared at a later stage with the values available in the column, referenced by the %ListValueField:ListValueField% property.

C#
public string DataField { get; set; }

A string, specifying the ID of the datasource control, which will be used to populate the dropdown with data.

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

A string, specifying the ID of the datasource control, which will be used to populate the dropdown with data.

Gets or sets the type of the dropdown control associated with the column.

C#
public GridDropDownColumnControlType DropDownControlType { get; set; }
Property Value:

Returns a value from the GridDropDownColumnControlType enumeration; default value is RadComboBox.

A string, specifying the text to be displayed in normal mode, when there is no Data Source specified for the column. In edit mode, this value is rendered as a dropdown list item. When in edit mode, and there is a valid DataSource specified for the control, this value is appended as the first item of the dropdown box.

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

A string, specifying the text to be displayed in normal/edit mode, when there is no Data Source specified for the column.

A string value, representing the value, associated with the EmptyListItemText.

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

A string value, representing the value, associated with the EmptyListItemText.

A Boolean value, indicating whether the dropdown column will be bound to a default value/text when there is no data source specified, from which to fetch the data.

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

A Boolean value, specifying whether the dropdown column accepts EmptyListItemText and EmptyListItemValue strings.

C#
protected virtual DropDownList InnerList { get; }

A Boolean value, indicating whether a dropdown column is editable. If it is editable, it will be represented as an active dropdown box in edit mode.

C#
public override bool IsEditable { get; }
Property Value:

A Boolean value, indicating whether a dropdown column is editable.

Overrides: GridColumn.IsEditable

Gets or sets the number of Items the RadComboBox editor will load per Item request. This property requires EnableAutomaticLoadOnDemand to be set to true.

C#
public int ItemsPerRequest { get; set; }

Set this property to -1 to load all Items when AllowAutomaticLoadOnDemand is set to true and disable Virtual Scrolling/Show More Results. The default is -1.

The ListDataMember property points to the data table (part of the dataset used for grid data-source) which is the source for the GridDropDownColumn generation.

C#
public string ListDataMember { get; set; }

The ListTextField points to the column in the data table from which the grid will extract the values for the dropdown.

C#
public string ListTextField { get; set; }

Gets or sets the drop down control DataTextFormatString value.

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

The drop down control DataTextFormatString value.

The ListValueField points to the column in the data table which will be used as a pointer to retrieve the items for the dropdown in the GridDropDownColumn.

C#
public string ListValueField { get; set; }

Gets or sets a value indicating whether the RadComboBox editor displays a More Results box. Setting this property to true requires AllowAutomaticLoadOnDemand to be set to true.

C#
public bool ShowMoreResultsBox { get; set; }

Should override if sorting will be disabled

C#
protected override bool Sortable { get; }

Overrides: GridEditableColumn.Sortable

Methods

Creates a copy of the current column.

C#
public override GridColumn Clone()
Returns:

GridColumn

Overrides: GridColumn.Clone()

Note: When implementing/overriding this method be sure to call the base member or call CopyBaseProperties to be sure that all base properties will be copied accordingly

C#
protected override void ColumnEditorChange(IGridColumnEditor newValue)
Parameters:newValueIGridColumnEditor

Overrides: GridEditableColumn.ColumnEditorChange(IGridColumnEditor)

C#
protected override void CopyBaseProperties(GridColumn fromColumn)
Parameters:fromColumnGridColumn

Overrides: GridEditableColumn.CopyBaseProperties(GridColumn)

C#
protected override IGridColumnEditor CreateDefaultColumnEditor()
Returns:

IGridColumnEditor

Overrides: GridEditableColumn.CreateDefaultColumnEditor()

C#
protected override string GenerateUniqueName()
Returns:

string

Overrides: GridColumn.GenerateUniqueName()

This method should be used in case you develop your own column. It returns the full list of DataFields used by the column. GridTableView uses this to decide which DataFields from the specified DataSource will be inlcuded in case of GridTableView.RetrieveAllDataFields is set to false.

C#
public override IDictionary GetCustomPropertyDataFields(object dataItemInstance)
Parameters:dataItemInstanceobjectReturns:

IDictionary

Overrides: GridColumn.GetCustomPropertyDataFields(object)

Calculate the default Group-by expression based on the settings of the DataField (if available)

C#
public override string GetDefaultGroupByExpression()
Returns:

string

Overrides: GridColumn.GetDefaultGroupByExpression()

For example, if a column's DataField is ProductType the default group-by expression will be: 'ProductType Group By ProductType'

C#
protected override string GetFilterDataField()
Returns:

string

Overrides: GridColumn.GetFilterDataField()

C#
protected virtual string GetTextFromInnerList(string value)
Parameters:valuestringReturns:

string

C#
protected virtual void SetDropDownListDataSource(GridItem inItem)
Parameters:inItemGridItem