Class SfSmartDataGrid
AI request/response plumbing for SfSmartDataGrid.
Inherited Members
Namespace: Syncfusion.UI.Xaml.SmartComponents
Assembly: Syncfusion.SfSmartComponents.Wpf.dll
Syntax
public class SfSmartDataGrid : SfDataGrid, IDisposable, INotifyDependencyPropertyChanged, IDetailsViewNotifier
Constructors
SfSmartDataGrid()
Initializes a new instance of the SfSmartDataGrid.
Declaration
public SfSmartDataGrid()
Fields
CurrentUserProperty
Identifies the current user dependency property.
Declaration
public static readonly DependencyProperty CurrentUserProperty
Field Value
| Type |
|---|
| System.Windows.DependencyProperty |
EnableSmartActionsProperty
Identifies the EnableSmartActions dependency property.
Declaration
public static readonly DependencyProperty EnableSmartActionsProperty
Field Value
| Type |
|---|
| System.Windows.DependencyProperty |
HighlightBrushProperty
Identifies the HighlightBrush dependency property.
Declaration
public static readonly DependencyProperty HighlightBrushProperty
Field Value
| Type |
|---|
| System.Windows.DependencyProperty |
PromptProperty
Identifies the Prompt dependency property.
Declaration
public static readonly DependencyProperty PromptProperty
Field Value
| Type |
|---|
| System.Windows.DependencyProperty |
SuggestionsProperty
Identifies the SuggestedPrompts dependency property.
Declaration
public static readonly DependencyProperty SuggestionsProperty
Field Value
| Type |
|---|
| System.Windows.DependencyProperty |
Properties
CurrentUser
Gets or sets the user identity associated with messages posted in this assist view.
Declaration
public Author CurrentUser { get; set; }
Property Value
| Type |
|---|
| Author |
EnableSmartActions
Gets or sets a value indicating whether AI-parsed actions (sort, filter, group, highlight, clear) should be applied to the grid.
Declaration
public bool EnableSmartActions { get; set; }
Property Value
| Type |
|---|
| System.Boolean |
HighlightBrush
Gets or sets the default highlight color used when highlight actions do not specify a color.
Declaration
public SolidColorBrush HighlightBrush { get; set; }
Property Value
| Type |
|---|
| System.Windows.Media.SolidColorBrush |
Remarks
When a highlight action omits a color, this brush is used as the fallback.
Prompt
Gets or sets the default prompt that will be posted to the AssistView when it first loads.
Declaration
public string Prompt { get; set; }
Property Value
| Type |
|---|
| System.String |
Remarks
If this property is set before the AssistView loads, the grid will automatically call ExecutePrompt(String).
Suggestions
Gets or sets the suggested prompts displayed in the assist view.These suggestions help users trigger frequently-used operations quickly.
Declaration
public IEnumerable<string> Suggestions { get; set; }
Property Value
| Type |
|---|
| System.Collections.Generic.IEnumerable<System.String> |
Methods
Dispose(Boolean)
Releases the resources used by the SfSmartDataGrid. Ensures event handlers, bindings, and styles are cleaned to avoid memory leaks.
Declaration
protected override void Dispose(bool disposing)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Boolean | disposing | True if called from Dispose; false if from finalizer. |
Overrides
ExecutePrompt(String)
Requests a response from the SfAIAssistView using the specified user text. This method is intended for scenarios where a programmatic trigger is required.
Declaration
public void ExecutePrompt(string prompt)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | prompt | The prompt to send to the SfAIAssistView. |
OnApplyTemplate()
Builds the visual tree for the SfSmartDataGrid when a new template is applied.
Declaration
public override void OnApplyTemplate()
Overrides
OnPreviewKeyDown(KeyEventArgs)
Handles System.Windows.UIElement.PreviewKeyDown before it is processed. If the AssistView is open, the event remains unhandled so the popup can receive keyboard input. Otherwise, the base implementation is invoked.
Declaration
protected override void OnPreviewKeyDown(KeyEventArgs e)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Windows.Input.KeyEventArgs | e | Key event arguments. |
Overrides
Remarks
This prevents the grid from intercepting keys that are intended for the AssistView editor when the panel is open.
Events
AssistViewRequest
Occurs when a user prompt is about to be sent to the AI service from the SfAIAssistView.
Set System.ComponentModel.CancelEventArgs.Cancel to true to cancel the request.
Declaration
public event EventHandler<AssistViewRequestEventArgs> AssistViewRequest
Event Type
| Type |
|---|
| System.EventHandler<AssistViewRequestEventArgs> |