GridViewComboBoxColumn provides an easy and fast way to display and edit lookup data. The key properties to set are : valueMemberPath, DisplayMemberPath and ItemsSource.
Definition
Namespace:Telerik.Windows.Controls
Assembly:Telerik.Windows.Controls.GridView.dll
Syntax:
public class GridViewComboBoxColumn : GridViewBoundColumnBase, INotifyPropertyChanged, IDataFieldDescriptor, IFieldDescriptor, IExportableColumn
Inheritance: objectGridViewColumnGridViewBoundColumnBaseGridViewComboBoxColumn
Implements:
Inherited Members
Constructors
public GridViewComboBoxColumn()
Fields
DisplayMemberPathProperty
DependencyProperty
Represents the DisplayMemberPath dependency property.
public static readonly DependencyProperty DisplayMemberPathProperty
EmptyTextProperty
DependencyProperty
Represents the EmptyText dependency property.
public static readonly DependencyProperty EmptyTextProperty
IsComboBoxEditableProperty
DependencyProperty
Represents the IsComboBoxEditable dependency property.
public static readonly DependencyProperty IsComboBoxEditableProperty
IsLightweightModeEnabledProperty
DependencyProperty
Represents the IsLightweightModeEnabled dependency property.
public static readonly DependencyProperty IsLightweightModeEnabledProperty
ItemsSourceProperty
DependencyProperty
Represents the ItemsSource dependency property.
public static readonly DependencyProperty ItemsSourceProperty
ItemTemplateProperty
DependencyProperty
Represents the ItemTemplate dependency property.
public static readonly DependencyProperty ItemTemplateProperty
SelectedValueMemberPathProperty
DependencyProperty
Represents the ValueMemberPath dependency property.
public static readonly DependencyProperty SelectedValueMemberPathProperty
Properties
Gets or sets the path to the property containing the data to display.
public string DisplayMemberPath { get; set; }
The display member path.
Gets or sets a string that should be displayed in the GridViewCell element when there is no selection in the GridViewComboBoxColumn. This is a dependency property.
public string EmptyText { get; set; }
Gets or sets a value indicating whether the user can edit text in the text box portion of the ComboBox editor.
public bool IsComboBoxEditable { get; set; }
Gets or sets a value indicating whether the LightweightMode of the ComboBoxColumn is enabled.
public bool IsLightweightModeEnabled { get; set; }
Gets or sets the the list of items used in the column to display lookup data. The ComboBox editor will also attach to this ItemsSource.
public IEnumerable ItemsSource { get; set; }
The items source.
ItemsSourceBinding
Binding
Gets or sets the Binding for the ComboBoxEditor ItemsSource. This is a dependency property.
public Binding ItemsSourceBinding { get; set; }
The default value is null
ItemTemplate
DataTemplate
Gets or sets the item template used to represent the selected item in cells.
public DataTemplate ItemTemplate { get; set; }
The item template.
LookupValueConverter
IValueConverter
Gets or sets the lookup value converter used to convert value member value to display value.
public IValueConverter LookupValueConverter { get; set; }
The lookup value converter.
Gets or sets the value member path.
public string SelectedValueMemberPath { get; set; }
The value member path.
Methods
Copy properties from source column.
public override void CopyPropertiesFrom(GridViewColumn source)
Overrides:
CreateCellEditElement(GridViewCell, object)
FrameworkElement
Creates the element for the cell in edit mode.
public override FrameworkElement CreateCellEditElement(GridViewCell cell, object dataItem)
FrameworkElement
Overrides:
CreateCellElement(GridViewCell, object)
FrameworkElement
Creates the element for the cell in view mode.
public override FrameworkElement CreateCellElement(GridViewCell cell, object dataItem)
FrameworkElement
Overrides:
This method is called for each selected cell to replace the cell content with data from the clipboard.
Prepares GridViewCell for edit.
protected override object PrepareCellForEdit(FrameworkElement editingElement, RoutedEventArgs editingEventArgs)
The editing element.
editingEventArgsRoutedEventArgsThe RoutedEventArgs instance containing the event data.
Returns:Overrides:
Refresh this column cells.
protected override void Refresh()
Overrides:
Sorts the distinct values.
protected override IQueryable SortDistinctValues(IQueryable source)
The unsorted distinct values.
Returns:The sorted distinct values.
Overrides: