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

Telerik.Web.UI.GridDropDownColumn

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

Remarks

Here is the mechanism which Telerik RadGrid uses to present values for GridDropDownColumn. Consider the snippet below:example <radg:GridDropDownColumnUniqueName="LevelID"ListDataMember="Level"ListTextField="Description"ListValueField="LevelID"HeaderText="LevelID"DataField="LevelID"/>As you can see, a requirement for the proper functioning of GridDropDownColumnis that all column valuesreferenced by the P:Telerik.Web.UI.GridDropDownColumn.DataField DataFieldattribute match the column values referenced by the P:Telerik.Web.UI.GridDropDownColumn.ListValueField ListValueFieldattribute.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.

Inheritance Hierarchy

  • System.Object
  • Telerik.Web.UI.GridColumn : IComparable, IStateManager
  • Telerik.Web.UI.GridEditableColumn : IGridDataColumn, IGridEditableColumn
  • Telerik.Web.UI.GridDropDownColumn

Properties

AllowAutomaticLoadOnDemand Boolean

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

AllowFiltering Boolean

Gets or sets whether the column data can be filtered.

AllowSorting Boolean

Gets or sets a whether the column data can be sorted.

AllowVirtualScrolling Boolean

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

AndCurrentFilterFunction GridKnownFunction

Gets or sets the current second filter condition function.

AndCurrentFilterValue String

Gets or sets a value of the currently applied second filter condition value.

AutoPostBackOnFilter Boolean

Gets or sets a value indicating whether the grid should automatically postback, when the value in the filter text-box changes, and the the focus moves to another element.

ColumnEditor IGridColumnEditor

Gets the column editor instance for this column.

ColumnEditorID String

Gets or sets the column editor ID that will be used when the column is displayed in edit mode.

ColumnType String

Gets the string representation of the type-name of this instance. The value is used by RadGrid to determine the type of the columns persisted into the ViewState, when recreating the grid after postback. The value is also used by the grid client-side object. This property is read only.

ColumnValidationSettings GridColumnValidationSettings

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

ConvertEmptyStringToNull Boolean

Convert the emty string to null when extracting values for inserting, updating, deleting

CurrentColumnEditor IGridColumnEditor

Get the current colum editor. If the column editor is not assigned at the moment the column will search for the ColumnEditorID on the page or should create its default column editor

CurrentFilterFunction GridKnownFunction

Gets or sets the current function used for filtering.

CurrentFilterValue String

Gets or sets a value of the currently applied filter.

DataField String

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.

DataSourceID String

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

DataType Type

Gets or sets (see the Remarks) the type of the data from the DataField as it was set in the DataSource.

Remarks

The DataType property supports the following base .NET Framework data types:BooleanByteCharDateTimeDecimalDoubleInt16Int32Int64SByteSingleStringTimeSpanUInt16UInt32UInt64

DataTypeName String

Gets the string representation of the DataType property of the column, needed for the client-side grid instance.

DefaultInsertValue String

Gets or sets a default value for the column when the row is in Insert mode

Display Boolean

Gets or sets a value indicating whether the cells corresponding to a column would be rendered with a 'display:none' style attribute (end-user-not-visible). To completely prevent cells from rendering, set the property to false, instead of the Display property.

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

EditFormColumnIndex Int32

Specifies the vertical collumn number where this column will appear when using EditForms editing mode and the form is autogenerated. See the remarks for details.

Remarks

A practicle example of using this property is to deterimine the number of columns rendered in the edit form. If there will be only one column in the rendered edit form, when we retrieve the value of this property for a column, as shown in the code below:protected void RadGrid1_PreRender(object sender, EventArgs e) {int columnIndex = RadGrid1.MasterTableView.Columns[3].EditFormColumnIndex; }it will be equal to 0, meaning the the column belongs to the first group of columns in the edit form.

EditFormHeaderTextFormat String

String that formats the HeaderText when the column is displayed in an edit form

EmptyListItemText String

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.

EmptyListItemValue String

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

EnableEmptyListItem Boolean

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.

EnableHeaderContextMenu Boolean

Determines if the header context menu will be displayed for the current column. This property works together with the EnableHeaderContextMenu property of the corresponding GridTableView. Default value is true.

Exportable Boolean

Determines whether the given column will be shown in the exported file

FilterCheckListEnableLoadOnDemand Boolean

Get or Set if the Filter Check List will load data on demand from server.

FilterCheckListWebServiceMethod String

Get or Set the Methood from CheckListWebServicePath Web Service defined in the TableView, that to be used for getting data for the filter check list

FilterControlAltText String

Gets or Sets the text value which should be added to alt attribute of the filter control

FilterControlToolTip String

Gets or sets the filter control ToolTip property value.

FilterControlWidth Unit

Use this property to set width to the filtering control (depending on the column type, this may be a normal textbox, RadNumericTextBox, RadDatePicker, etc.)

FilterDelay Nullable1`

Gets or sets the filter delay which determines after how many milliseconds a filtering will occur after a filter value have changed.

FilterImageToolTip String

Gets or sets the filter image tool tip.

FilterImageUrl String

Gets or sets a string representing the URL to the image used in the filtering box.

FilterListOptions GridFilterListOptions

Gets or sets the value indincating which of the filter functions should be available for that column. For more information see enumaration.

FilterTemplate ITemplate

Gets or sets the template, which will be rendered in the filter item cell of the column.

FooterStyle TableItemStyle

Style of the cell in the footer item of the grid, corresponding to the column.

FooterText String

Use the FooterText property to specify your own or determine the current text for the footer section of the column.

ForceExtractValue GridForceExtractValues

Force RadGrid to extract values from EditableColumns that are ReadOnly (or IsEditable is false).

Groupable Boolean

Gets or sets a value indicating whether you will be able to group Telerik RadGrid by that column. By default this property is true.

Remarks

See Telerik RadGrid manual for details about using grouping. If Groupable is false the column header cannot be dragged to the GroupPanel.

GroupByExpression String

The group-expression that should be used when grid is grouping-by this column. If not set explicitly, RadGrid will generate a group expression based on the DataField of the column (if available), using the method.The grouping can be turned on/off for columns like GridBoundColumn using property.For more information about the Group-By expressions and their syntax, see class.

HeaderAbbr String

Gets or sets the column cell 'abbr' attribute.

HeaderAxis String

Gets or sets the column cell 'axis' attribute.

HeaderButtonType GridHeaderButtonType

Gets or sets the button type of the button rendered in the header item, used for sorting. The possible values that this property accepts are:Telerik.Web.UI.GridHeaderButtonType.LinkButton Telerik.Web.UI.GridHeaderButtonType.PushButton Telerik.Web.UI.GridHeaderButtonType.TextButton

HeaderImageUrl String

Gets or sets the URL of an image in the cell in the header item of the grid current column. You can use a relative or an absolute URL.

HeaderStyle TableItemStyle

Style of the cell in the header item of the grid, corresponding to the column.

HeaderText String

Use the HeaderText property to specify your own or determine the current text for the header section of the column.

HeaderTooltip String

Gets or sets the header tooltip of the column.

InsertVisiblityMode GridColumnVisibilityMode

Gets or sets a value determining whether a editor will be displayed in the insert item. Inherited: The visibility is dependent on the value of the ReadOnly property. AlwaysVisible: The insert item is always visible AlwaysHidden: The insert item is always hidden

IsEditable Boolean

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.

IsEditable Boolean

This property is supposed for developers of new grid columns. It gets whether a column is currently ReadOnly. The ReadOnly property determines whether a column will be editable in edit mode. A column for which the ReadOnly property is true will not be present in the automatically generated edit form.

ItemsPerRequest Int32

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

Remarks

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.

ItemStyle TableItemStyle

Style of the cells, corresponding to the column.

ListDataMember String

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.

ListOfFilterValues String[]

Access the valus passed from the ListBox used for CheckList in the filter.

ListTextField String

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

ListTextFormatString String

Gets or sets the drop down control DataTextFormatString value.

ListValueField String

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.

OrderIndex Int32

Gets or sets the order index of column in the collection of . Use method for reordering the columns.

Remarks

We recommend using this property only for getting the order index for a specific column instead of setting it. Use method for reordering columns. Note that changing the column order index will change the order of the cells in the grid items, after the grid is rebound. The value of the property would not affect the order of the column in the collection.

Owner GridTableView

Gets the instance of the GridTableVeiw wich owns this column instance.

OwnerGridID GridTableView

Gets the value of the ClientID property of the RadGrid instance that owns this column. This property value is used by grid's client object

OwnerID GridTableView

Gets the value of the ClientID property of the GridTableView that owns this column. This property value is used by grid's client object

ReadOnly Boolean

Gets or sets the readonly status of the column. The column will be displayed in browser mode (unless its Visible property is false) but will not appear in the edit-form.

Reorderable Boolean

Gets or sets a value indicating whether the column can be reordered client-side.

Resizable Boolean

Gets or sets a value indicating whether the column can be resized client-side. You can use this property, by setting it to false, to disable resizing for a particular column, while preserving this functionality for all the other columns.

RowSpan Int32

For internal use. Gets or sets the row span of the grid column.

Selectable Boolean

Gets the value determining if the column is selectable.

Selected Boolean

Indicates whether all column cells have been selected

ShowFilterIcon Boolean

Gets or sets if the filter icon in the will be visible.

ShowMoreResultsBox Boolean

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.

ShowNoSortIcon Boolean

Get or Sets a value indicating whether a no sort icon should appear next to the header button, when a column is not sorted but can be sorted.

ShowSortIcon Boolean

Get or Sets a value indicating whether a sort icon should appear next to the header button, when a column is sorted.

Sortable Boolean

Should override if sorting will be disabled

SortAscImageUrl String

Gets or sets a string representing the URL to the image used for sorting in ascending mode.

SortDescImageUrl String

Gets or sets a string representing the URL to the image used for sorting in descending mode.

SortedBackColor Color

Gets or sets the color of a cell which is sorted.

SortExpression String

The string representing a filed-name from the DataSource that should be used when grid sorts by this column. For example: 'EmployeeName'

UniqueName String

Each column in Telerik RadGrid has an UniqueName property (string). This property is assigned automatically by the designer (or the first time you want to access the columns if they are built dynamically).

Remarks

You can also set it explicitly, if you prefer. However, the automatic generation handles most of the cases. For example a GridBoundColumn with DataField 'ContactName' would generate an UniqueName of 'ContactName'.Additionally, there may be occasions when you will want to set the UniqueName explicitly. You can do so simply by specifying the custom name that you want to choose:/radG:GridTemplateColumn

UseNativeEditorsInMobileMode Boolean

Gets or sets whether the column editor will be native when gird's RenderMode is set to Mobile

Visible Boolean

Gets or sets a value indicating if the column and all corresponding cells would be rendered.

Methods

Clone

Creates a copy of the current column.

Remarks

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

Returns

Telerik.Web.UI.GridColumn

Clone

Creates a copy of the current column.

Remarks

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

Returns

Telerik.Web.UI.GridColumn

EvaluateFilterExpression

Gets a string representing a filter expression, based on the settings of all columns that support filtering, with a syntax ready to be used by a DataView object

Returns

System.String

EvaluateFilterExpression

Evaluates the column filter expression based on the , , , propeties. It could be used to handle custom filtering and is internally used for determining FilterExpression value.

Returns

System.String

FillValues

Extracts the values from the editedItem and fills the names/values pairs for each data-field edited by the column in the newValues dictionary.

Parameters

newValues System.Collections.IDictionary

dictionary to fill. This param should not be null (Nothing in VB.NET)

editableItem Telerik.Web.UI.GridEditableItem

the GridEditableItem to extract values from

Returns

System.Void

GetActiveDataField

Returns the DataField that will be used for Filter and Sorting operations

Returns

System.String

GetCurrentFilterValueFromControl

Gets the value of the Text property of a textbox control found in the cell, used to set the value of the CurrentFilterValue property.

Parameters

cell System.Web.UI.WebControls.TableCell

Returns

System.String

GetCustomPropertyDataFields

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.

Parameters

dataItemInstance System.Object

Returns

System.Collections.IDictionary

GetCustomPropertyDataFields

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.

Returns

System.Collections.IDictionary

GetDefaultGroupByExpression

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

Remarks

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

Returns

System.String

GetDefaultGroupByExpression

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

Remarks

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

Returns

System.String

GetFilterFunctionsList

Gets a list of filter functions based on the settings of the property.

Parameters

options Telerik.Web.UI.GridFilterListOptions

sourceList System.Collections.ArrayList

Returns

System.Collections.ArrayList

GetSortExpression

By default returns the SortExpression of the column. If the SortExpression is not set explicitly, it would be calculated, based on the DataField of the column.

Returns

System.String

Initialize

The Initialize method is inherited by a derived GridColumn class. Is is used to reset a column of the derived type.

Remarks

This method is mainly used to reset properties common for all column types derived from GridColumn class.The Initialize method is usually called during data-binding, prior to the first row being bound.

Returns

System.Void

InitializeCell

After a call to this method the column should add the corresponding controls (text, labels, input controls) into the cell given, regarding the inItem type and column index.Note: This method is called within RadGrid and is not intended to be used directly from your code.

Returns

System.Void

IsBoundToFieldName

This method returns true if the column is bound to the specified field name.

Parameters

name System.String

The name of the DataField, which will be checked.

Returns

System.Boolean

PrepareCell

Prepares the cell of the item given, when grid is rendered.

Parameters

cell System.Web.UI.WebControls.TableCell

item Telerik.Web.UI.GridItem

Returns

System.Void

RefreshCurrentFilterValue

Modifies the CurrentFilterFunction and CurrentFilterValue properties according to the function given and the corresponding filter text-box control in the filtering item.

Returns

System.Void

RefreshCurrentFilterValue

Modifies the CurrentFilterValue property according to the corresponding selected item in the filter text-box control in the filtering item.

Returns

System.Void

ResetCurrentFilterValue

Resets the values of the and properties to their defaults.

Returns

System.Void

ResetCurrentFilterValue

Resets the values of the , , and properties to their defaults.

Returns

System.Void

SetCurrentFilterValueToControl

Sets the value of the property CurrentFilterValue as a text on the TextBox control found in the cell

Parameters

cell System.Web.UI.WebControls.TableCell

Returns

System.Void

SetupFilterControls

Instantiates the filter controls (text-box, image.) in the cell given

Parameters

cell System.Web.UI.WebControls.TableCell

Returns

System.Void

ShouldExtractValues

Get value based on the current IsEditable state, item edited state and ForceExtractValue setting.

Parameters

item Telerik.Web.UI.GridEditableItem

item to check to extract values from

Returns

System.Boolean

SupportsFiltering

This method should be used in case you develop your own column. It returns true if the column supports filtering.

Returns

System.Boolean

In this article