Events
This article lists the events specific for RadCardView.
-
AutoGeneratingDataFieldDescriptor: Occurs when a DataFieldDescriptor is autogenerating. A descriptor is generated for each public property of the card's data item. The event can be used to customize or cancel the creation of data fields. The event arguments are of type
CardViewAutoGeneratingDataFieldDescriptorEventArgswhich expose the following members:- DataFieldDescriptor: Gets the associated data field descriptor object.
- ItemPropertyInfo: Gets the associated item property info.
Example 1: AutoGeneratingDataFieldDescriptor event handler
C#private void RadCardView_AutoGeneratingDataFieldDescriptor(object sender, CardViewAutoGeneratingDataFieldDescriptorEventArgs e) { bool isCanceled = e.Cancel; CardDataFieldDescriptor dataFieldDescritor = e.DataFieldDescriptor; ItemPropertyInfo propertyInfo = e.ItemPropertyInfo; } -
CardDataFieldPreparedEditor: Occurs when the editor control of a card's data field is prepared, just before the editing of the field starts. The event arguments are of type
CardDataFieldPreparedEditorEventArgswhich expose the following members:- FrameworkElement: Gets the control rerpesenting the editor of the data field.
- DataField: Gets the associated
DataFormDataFieldobject.
Example 2: CardDataFieldPreparedEditor event handler
C#private void RadCardView_CardDataFieldPreparedEditor(object sender, Telerik.Windows.Controls.Data.CardView.CardDataFieldPreparedEditorEventArgs e) { RadCardViewItem card = e.CardViewItem; DataFormDataField dataField = e.DataField; FrameworkElement editor = e.Editor; } -
SelectionChanged: Occurs when the selected card is changed. The event arguments are of type
SelectionChangedEventArgswhich expose the following members:- AddedItems: Gets a collection containing the newly selected card.
- RemovedItems: Gets a collection containing the previously selected card.
Example 3: SelectionChanged event handler
C#private void RadCardView_SelectionChanged(object sender, System.Windows.Controls.SelectionChangedEventArgs e) { IList addedItems = e.AddedItems; IList removedItems = e.RemovedItems; }
Editing
-
CardBeginningEdit: Occurs just before an edit operation is started. The event can be used to cancel the editing by setting the event arguments Cancel property to
true. The event arguments are of typeCardViewItemCancelEventArgswhich expose the following members:- CardViewItem: Gets the associated
RadCardViewItemobject.
Example 4: CardBeginningEdit event handler
C#private void RadCardView_CardBeginningEdit(object sender, Telerik.Windows.Controls.Data.CardView.CardViewItemCancelEventArgs e) { bool isCanceled = e.Cancel; RadCardViewItem card = e.CardViewItem; } - CardViewItem: Gets the associated
-
CardEditEnding: Occurs just before an edit operation is finished. The event arguments are of type
CardDataFieldCancelEventArgswhich expose the following members:- CardViewItem: Gets the associated
RadCardViewItemobject. - DataField: Gets the associated
DataFormDataFieldobject.
Example 5: CardEditEnding event handler
C#private void RadCardView_CardEditEnding(object sender, Telerik.Windows.Controls.Data.CardView.CardViewEditEndingEventArgs e) { bool isCanceled = e.Cancel; RadCardViewItem card = e.CardViewItem; EditAction editAction = e.EditAction; } - CardViewItem: Gets the associated
-
CardEditEnded: Occurs when an edit operation is finished. The event arguments are of type
CardViewEditEndedEventArgswhich expose the following members:- CardViewItem: Gets the associated
RadCardViewItemobject. - EditAction: Gets the edit action - Cancel or Commit.
Example 6: CardEditEnded event handler
C#private void RadCardView_CardEditEnded(object sender, CardViewEditEndedEventArgs e) { RadCardViewItem card = e.CardViewItem; EditAction editAction = e.EditAction; } - CardViewItem: Gets the associated
-
CardDataFieldBeginningEdit: Occurs just before an edit operation is started for a data field. The event arguments are of type
CardDataFieldCancelEventArgswhich expose the following members:- CardViewItem: Gets the associated
RadCardViewItemobject. - DataField: Gets the associated
DataFormDataFieldobject.
Example 7: CardDataFieldBeginningEdit event handler
C#private void RadCardView_CardDataFieldBeginningEdit(object sender, Telerik.Windows.Controls.Data.CardView.CardDataFieldCancelEventArgs e) { bool isCanceled = e.Cancel; RadCardViewItem card = e.CardViewItem; DataFormDataField dataField = e.DataField; } - CardViewItem: Gets the associated
-
CardDataFieldEditEnded: Occurs when an edit operation is finished for a data field. The event arguments are of type
CardDataFieldEditEndedEventArgswhich expose the following members:- CardViewItem: Gets the associated
RadCardViewItemobject. - EditAction: Gets the edit action - Cancel or Commit.
- NewValue: Gets the edited value.
- OldValue: Gets the previous value.
Example 8: CardDataFieldEditEnded event handler
C#private void RadCardView_CardDataFieldEditEnded(object sender, Telerik.Windows.Controls.Data.CardView.CardDataFieldEditEndedEventArgs e) { RadCardViewItem card = e.CardViewItem; DataFormDataField dataField = e.DataField; EditAction editAction = e.EditAction; object oldValue = e.OldValue; object newValue = e.NewValue; } - CardViewItem: Gets the associated
Validation
-
CardValidating: Occurs when a card is being validated. The event arguments are of type
CardViewItemCancelEventArgswhich expose the following members:- CardViewItem: Gets the associated
RadCardViewItemobject.
Example 9: CardValidating event handler
C#private void RadCardView_CardValidating(object sender, Telerik.Windows.Controls.Data.CardView.CardViewItemCancelEventArgs e) { bool isCanceled = e.Cancel; RadCardViewItem card = e.CardViewItem; } - CardViewItem: Gets the associated
-
CardDataFieldValidating: Occurs when a data field starts data validating. The event arguments are of type
CardDataFieldValidatingEventArgswhich expose the following members:- IsValid: Gets the current validating state.
- ValidationResults: Gets a collection with the validation results.
- CardViewItem: Gets the associated
RadCardViewItemobject. - DataField: Gets the associated
DataFormDataFieldobject.
Example 10: CardDataFieldValidating event handler
C#private void RadCardView_CardDataFieldValidating(object sender, Telerik.Windows.Controls.Data.CardView.CardDataFieldValidatingEventArgs e) { bool isValid = e.IsValid; RadCardViewItem card = e.CardViewItem; DataFormDataField dataField = e.DataField; IEnumerable<ValidationResult> results = e.ValidationResults; } -
CardDataFieldValidated: Occurs when data field is being validated. The event arguments are of type
CardDataFieldEditEndedEventArgswhich expose the following members:- ValidationResults: Gets a collection with the validation results.
- CardViewItem: Gets the associated
RadCardViewItemobject. - DataField: Gets the associated
DataFormDataFieldobject.
Example 11: CardDataFieldValidated event handler
C#private void RadCardView_CardDataFieldValidated(object sender, Telerik.Windows.Controls.Data.CardView.CardDataFieldValidatedEventArgs e) { RadCardViewItem card = e.CardViewItem; DataFormDataField dataField = e.DataField; IEnumerable<ValidationResult> results = e.ValidationResults; }
Filtering
-
FieldFilterEditorCreated: Occurs when a field filter editor is created. The event arguments are of type
CardViewFilterEditorCreatedEventArgswhich expose the following members:- CardDataFieldFilterDescriptor: This property gets the corresponding
CardDataFieldFilterDescriptorobject. - Editor: Gets the control rerpesenting the editor of the data field.
Example 12: FieldFilterEditorCreated event handler
C#private void RadCardView_FieldFilterEditorCreated(object sender, Telerik.Windows.Controls.Data.CardView.CardViewFilterEditorCreatedEventArgs e) { FrameworkElement editor = e.Editor; CardDataFieldDescriptor dataFieldDescritor = e.CardDataFieldDescriptor; } - CardDataFieldFilterDescriptor: This property gets the corresponding
-
Filtering: Occurs before the filtering operation takes effect. The event can be used to cancel the filtering by setting the event arguments Cancel property to
true. The event arguments are of typeCardViewFilteringEventArgswhich expose the following members:- Added: This property gets the added
IFilterDescriptorobject. - Removed: This property gets the removed
IFilterDescriptorobject. - CardDataFieldFilterDescriptor: This property gets the corresponding
CardDataFieldFilterDescriptorobject.
Example 13: Filtering event handler
C#private void RadCardView_Filtering(object sender, Telerik.Windows.Controls.Data.CardView.CardViewFilteringEventArgs e) { bool isCanceled = e.Cancel; IEnumerable<IFilterDescriptor> addedDescriptors = e.Added; IEnumerable<IFilterDescriptor> removedDescriptors = e.Removed; ICardDataFieldFilterDescriptor dataFieldFilterDescritor = e.CardDataFieldFilterDescriptor; } - Added: This property gets the added
-
Filtered: Occurs after the filtering operation is executed. The event arguments are of type
CardViewFilteredEventArgswhich expose the following members:- Added: This property gets the added
IFilterDescriptorobject. - Removed: This property gets the removed
IFilterDescriptorobject. - CardDataFieldFilterDescriptor: This property gets the corresponding
CardDataFieldFilterDescriptorobject.
Example 14: Filtered event handler
C#private void RadCardView_Filtered(object sender, CardViewFilteredEventArgs e) { IEnumerable<IFilterDescriptor> addedDescriptors = e.Added; IEnumerable<IFilterDescriptor> removedDescriptors = e.Removed; ICardDataFieldFilterDescriptor dataFieldFilterDescritor = e.CardDataFieldFilterDescriptor; } - Added: This property gets the added
-
FilterOperatorsLoading: Occurs before the filter operators are loaded. The event can be used to remove some of the default operators or change the currently selected one. The event arguments are of type
FilterOperatorsLoadingEventArgswhich expose the following members:- AvailableOperators: This property gets all available operators that will be displayed by default. You can remove operators from the collection in order to hide them from the UI.
- DefaultOperator1: This property gets the first
FilterOperatorobject. - DefaultOperator2: This property gets the second
FilterOperatorobject. - CardDataFieldFilterDescriptor: This property gets the corresponding
CardDataFieldFilterDescriptorobject.
Example 15: FilterOperatorsLoading event handler
C#private void RadCardView_FilterOperatorsLoading(object sender, FilterOperatorsLoadingEventArgs e) { RemoveOnlyCollection<FilterOperator> availableOperators = e.AvailableOperators; CardDataFieldDescriptor dataFieldDescritor = e.CardDataFieldDescriptor; FilterOperator? operator1 = e.DefaultOperator1; FilterOperator? operator2 = e.DefaultOperator2; } -
DistinctValuesLoading: Occurs before the distinct values of the associated data field descriptor are loaded. The event arguments are of type
CardViewDistinctValuesLoadingEventArgswhich expose the following members:- ItemsSource: Gets or sets the source collection containing the distinct values that will be loaded. This can be used to modify or replace the collection.
- CardDataFieldFilterDescriptor: This property gets the corresponding
CardDataFieldFilterDescriptorobject.
Example 16: DistinctValuesLoading event handler
C#private void RadCardView_DistinctValuesLoading(object sender, CardViewDistinctValuesLoadingEventArgs e) { bool isCanceled = e.Cancel; CardDataFieldDescriptor dataFieldDescritor = e.CardDataFieldDescriptor; IEnumerable distinctValuesSource = e.ItemsSource; }
Sorting
-
Sorting: Occurs before the sorting operation is executed. The event can be used to cancel the sorting by setting the event arguments Cancel property to
true. The event arguments are of typeCardViewSortingEventArgswhich expose the following members:- OldSortingState: Gets the old sorting direction.
- NewSortingState: Gets the new sorting direction.
- IsMultipleDataFieldDescriptorSorting: Indicates if the current sorting is applied over multiple data field descriptors.
- DataFieldFilterDescriptor: Gets the corresponding
CardDataFieldFilterDescriptorobject.
Example 17: Sorting event handler
C#private void RadCardView_Sorting(object sender, CardViewSortingEventArgs e) { bool isCanceled = e.Cancel; CardDataFieldDescriptor dataFieldDescritor = e.DataFieldDescriptor; bool isMultipleSorting = e.IsMultipleDataFieldDescriptorSorting; SortingState previousSortingState = e.OldSortingState; SortingState newSortingState = e.NewSortingState; } -
Sorted: Occurs after the sorting operation is executed. The event arguments are of type
CardViewSortedEventArgswhich expose the following members:- DataFieldFilterDescriptor: Gets the corresponding
CardDataFieldFilterDescriptorobject.
Example 18: Sorted event handler
C#private void RadCardView_Sorted(object sender, CardViewSortedEventArgs e) { CardDataFieldDescriptor dataFieldDescritor = e.DataFieldDescriptor; } - DataFieldFilterDescriptor: Gets the corresponding
Grouping
-
Grouping: Occurs before the grouping operation is executed. The event can be used to cancel the grouping action by setting the event arguments Cancel property to
true. The event arguments are of typeCardViewGroupingEventArgswhich expose the following members:- Action: Gets the
CardViewGroupingEventAction. - GroupDescriptor: Gets the corresponding
IGroupDescriptorobject. - Index: Gets the group descriptor's position.
Example 19: Grouping event handler
C#private void RadCardView_Grouping(object sender, CardViewGroupingEventArgs e) { bool isCanceled = e.Cancel; CardViewGroupingEventAction action = e.Action; IGroupDescriptor groupDescriptor = e.GroupDescriptor; int? groupDescriptorPosition = e.Index; } - Action: Gets the
-
Grouped: Occurs after the grouping operation is executed. The event arguments are of type
CardViewGroupedEventArgswhich expose the following members:- Action: Gets the
CardViewGroupingEventAction. - GroupDescriptor: Gets the corresponding
IGroupDescriptorobject.
Example 20: Grouped event handler
C#private void RadCardView_Grouped(object sender, CardViewGroupedEventArgs e) { CardViewGroupingEventAction action = e.Action; IGroupDescriptor groupDescriptor = e.GroupDescriptor; } - Action: Gets the