Class TreeGridEvents<TValue>
Configures Tree Grid events.
Inheritance
Namespace: Syncfusion.Blazor.TreeGrid
Assembly: Syncfusion.Blazor.dll
Syntax
public class TreeGridEvents<TValue> : OwningComponentBase
Type Parameters
Name | Description |
---|---|
TValue | A type which provides schema for the tree grid events. |
Constructors
TreeGridEvents()
Declaration
public TreeGridEvents()
Properties
BeforeBatchAdd
An event that is raised before new records are added in batch mode.
Declaration
public EventCallback<object> BeforeBatchAdd { get; set; }
Property Value
Type | Description |
---|---|
Microsoft.AspNetCore.Components.EventCallback<System.Object> | An event callback function. |
Remarks
This event handler receives a object argument which provides the details of before batch add action.
Examples
<SfTreeGrid>
<TreeGridEvents BeforeBatchAdd="BeforeBatchAddHandler" TValue="BusinessObject"></TreeGridEvents>
</SfTreeGrid>
@code {
public void BeforeBatchAddHandler(object args)
{
}
}
BeforeBatchDelete
An event that is raised before the tree grid records are deleted in batch mode.
Declaration
public EventCallback<object> BeforeBatchDelete { get; set; }
Property Value
Type | Description |
---|---|
Microsoft.AspNetCore.Components.EventCallback<System.Object> | An event callback function. |
Remarks
This event handler receives a object argument which provides the details of before batch delete action.
Examples
<SfTreeGrid>
<TreeGridEvents BeforeBatchDelete="BeforeBatchDeleteHandler" TValue="BusinessObject"></TreeGridEvents>
</SfTreeGrid>
@code {
public void BeforeBatchDeleteHandler(object args)
{
}
}
BeforeBatchSave
An event that is raised before the modified records are saved in batch mode.
Declaration
public EventCallback<object> BeforeBatchSave { get; set; }
Property Value
Type | Description |
---|---|
Microsoft.AspNetCore.Components.EventCallback<System.Object> | An event callback function. |
Remarks
This event handler receives a object argument which provides the details of before batch save action.
Examples
<SfTreeGrid>
<TreeGridEvents BeforeBatchSave="BeforeBatchSaveHandler" TValue="BusinessObject"></TreeGridEvents>
</SfTreeGrid>
@code {
public void BeforeBatchSaveHandler(object args)
{
}
}
BeforeCellPaste
An event that is raised before pasting the copied cell value in a corresponding cells. You can cancel the paste on a particular cell by handling this event.
Declaration
public EventCallback<BeforeCellPasteEventArgs<TValue>> BeforeCellPaste { get; set; }
Property Value
Type | Description |
---|---|
Microsoft.AspNetCore.Components.EventCallback<BeforeCellPasteEventArgs<TValue>> | An event callback function. |
Remarks
This event handler receives a BeforeCellPasteEventArgs<T> object which provides the details for the before cell paste action. Paste event action can be cancelled by setting Cancel
property of BeforeCellPasteEventArgs<T> property.
Examples
<SfTreeGrid DataSource="@TreeData" @ref="TreeGrid" >
<TreeGridEvents TValue="BusinessObject" BeforeCellPaste="CellPaste"></TreeGridEvents>
</SfTreeGrid>
@code{
public async Task Paste(BeforeCellPasteEventArgs<BusinessObject> args)
{
if(ColumnIndex == 1 && RowIndex == 4){
//you can modified the content to be paste here.
args.CellValue = "Modified value";
}
}
BeforeCopyPaste
An event that is raised before copy or paste action in the Grid cells. You can cancel the copy or paste action by cancelling this event.
Declaration
public EventCallback<BeforeCopyPasteEventArgs> BeforeCopyPaste { get; set; }
Property Value
Type | Description |
---|---|
Microsoft.AspNetCore.Components.EventCallback<BeforeCopyPasteEventArgs> | An event callback function. |
Remarks
This event triggers before BeforeCellPaste event, so you can cancel copy or paste operation by using this event. Also, this event handler receives a BeforeCopyPasteEventArgs object which provides the details of before paste/copy action.
Examples
<SfTreeGrid DataSource="@TreeData" @ref="TreeGrid" >
<TreeGridEvents BeforeCopyPaste="CopyPaste"></TreeGridEvents>
</SfTreeGrid>
@code{
public async Task CopyPaste(BeforeCopyPasteEventArgs args)
{
//you can cancel the entire copy action here
if(args.Action == "Copy"){
args.Cancel = true;
}
//you can cancel the entire paste action here
if(args.Action == "Paste"){
args.Cancel = true;
}
}
BeforeRowEditing
Gets or sets the event callback that is raised before the editing action is performed in the tree grid.
Declaration
public EventCallback<OnRowEditStartEventArgs> BeforeRowEditing { get; set; }
Property Value
Type | Description |
---|---|
Microsoft.AspNetCore.Components.EventCallback<OnRowEditStartEventArgs> | An event call back function. |
Remarks
This event handler receives a OnRowEditStartEventArgs object, which provides details about the before edit action in the tree grid.
Examples
This example shows how to handle the BeforeRowEditing event:
<SfTreeGrid DataSource="@TreeData" Toolbar="@(new List<string>() { "Edit" })">
<TreeGridEditSettings AllowEditing="true" Mode="Syncfusion.Blazor.TreeGrid.EditMode.Row" />
<TreeGridEvents TValue="BusinessObject" BeforeRowEditing="BeforeRowEditingHandler"></TreeGridEvents>
........
</SfTreeGrid>
@code{
public async Task BeforeRowEditingHandler(OnRowEditStartEventArgs<BusinessObject> args)
{
args.PreventDataClone = true; // To prevent the data from being cloned.
}
Cancelled
Gets or sets the event callback that is raised after the cancel action is performed in the tree grid.
Declaration
public EventCallback<EditCanceledEventArgs<TValue>> Cancelled { get; set; }
Property Value
Type | Description |
---|---|
Microsoft.AspNetCore.Components.EventCallback<EditCanceledEventArgs<TValue>> | An event call back function. |
Remarks
This event handler receives a EditCanceledEventArgs<T> object, which provides details about the after cancel action in the tree grid.
Examples
This example shows how to handle the Cancelled event:
<SfTreeGrid DataSource="@TreeData" Toolbar="@(new List<string>() { "Cancel" })">
<TreeGridEditSettings AllowEditing="true" Mode="Syncfusion.Blazor.TreeGrid.EditMode.Row" />
<TreeGridEvents TValue="BusinessObject" Cancelled ="CancelledHandler"></TreeGridEvents>
........
</SfTreeGrid>
@code{
public async Task CancelledHandler(EditCanceledEventArgs<BusinessObject> args)
{
var data = args.Data; // Gets the data of the cancelled record.
}
Cancelling
Gets or sets the event callback that is raised before the cancel action is performed in the tree grid.
Declaration
public EventCallback<EditCancelingEventArgs<TValue>> Cancelling { get; set; }
Property Value
Type | Description |
---|---|
Microsoft.AspNetCore.Components.EventCallback<EditCancelingEventArgs<TValue>> | An event call back function. |
Remarks
This event handler receives a EditCancelingEventArgs<T> object, which provides details about the before cancel action in the tree grid.
Examples
This example shows how to handle the Cancelling event:
<SfTreeGrid DataSource="@TreeData" Toolbar="@(new List<string>() { "Cancel" })">
<TreeGridEditSettings AllowEditing="true" Mode="Syncfusion.Blazor.TreeGrid.EditMode.Row" />
<TreeGridEvents TValue="BusinessObject" Canceling ="CancellingHandler"></TreeGridEvents>
........
</SfTreeGrid>
@code{
public async Task CancelingHandler(EditCancelingEventArgs<BusinessObject> args)
{
if(args.PreviousData.TaskID == 2)
{
args.Cancel = true; // To cancel the cancel action for a specific record.
}
}
CellDeselected
An event that is raised after any cell deselection occurs.
Declaration
public EventCallback<CellDeselectEventArgs<TValue>> CellDeselected { get; set; }
Property Value
Type | Description |
---|---|
Microsoft.AspNetCore.Components.EventCallback<CellDeselectEventArgs<TValue>> | An event callback function. |
Remarks
This event handler receives a CellDeselectEventArgs<T> object through which you can able to get deselected cell and row details.
Examples
<SfTreeGrid>
<TreeGridSelectionSettings Mode=SelectionMode.Cell></TreeGridSelectionSettings>
<TreeGridEvents CellDeselected="CellDeselectedHandler" TValue="BusinessObject"></TreeGridEvents>
</SfTreeGrid>
@code {
public void CellDeselectedHandler(CellDeselectEventArgs<BusinessObject> args)
{
}
}
CellDeselecting
An event that is raised when any cell deselection occurs.
Declaration
public EventCallback<CellDeselectEventArgs<TValue>> CellDeselecting { get; set; }
Property Value
Type | Description |
---|---|
Microsoft.AspNetCore.Components.EventCallback<CellDeselectEventArgs<TValue>> | An event callback function. |
Remarks
This event handler receives a CellDeselectEventArgs<T> object through which you can be able to get the details of the cell to be deselected.
Examples
<SfTreeGrid>
<TreeGridSelectionSettings Mode=SelectionMode.Cell></TreeGridSelectionSettings>
<TreeGridEvents CellDeselecting="CellDeselectingHandler" TValue="BusinessObject"></TreeGridEvents>
</SfTreeGrid>
@code {
public void CellDeselectingHandler(CellDeselectEventArgs<BusinessObject> args)
{
}
}
CellSaved
An event that is raised after the modified cell value is saved.
Declaration
public EventCallback<CellSavedArgs<TValue>> CellSaved { get; set; }
Property Value
Type | Description |
---|---|
Microsoft.AspNetCore.Components.EventCallback<CellSavedArgs<TValue>> | An event callback function. |
Remarks
This event handler receives a CellSavedArgs<T> object through which you can get previous and current edited cell values.
Examples
<SfTreeGrid>
<TreeGridEvents CellSaved="CellSavedHandler" TValue="BusinessObject"></TreeGridEvents>
</SfTreeGrid>
@code {
public void CellSavedHandler(CellSavedArgs<BusinessObject> args)
{
}
}
CellSelected
An event that is raised after a cell is selected.
Declaration
public EventCallback<CellSelectEventArgs<TValue>> CellSelected { get; set; }
Property Value
Type | Description |
---|---|
Microsoft.AspNetCore.Components.EventCallback<CellSelectEventArgs<TValue>> | An event callback function. |
Remarks
This event handler receives a CellSelectEventArgs<T> object through which you can able to get the selected cell and row details.
Examples
<SfTreeGrid>
<TreeGridSelectionSettings Mode=SelectionMode.Cell></TreeGridSelectionSettings>
<TreeGridEvents CellSelected="CellSelectedHandler" TValue="BusinessObject"></TreeGridEvents>
</SfTreeGrid>
@code {
public void CellSelectedHandler(CellSelectEventArgs<BusinessObject> args)
{
}
}
CellSelecting
An event that is raised when any cell selection occurs.
Declaration
public EventCallback<CellSelectingEventArgs<TValue>> CellSelecting { get; set; }
Property Value
Type | Description |
---|---|
Microsoft.AspNetCore.Components.EventCallback<CellSelectingEventArgs<TValue>> | An event callback function. |
Remarks
This event handler receives a CellSelectingEventArgs<T> object through which you can get current selected cell and row details. Cell selection action can be cancelled using Cancel argument property.
Examples
<SfTreeGrid>
<TreeGridSelectionSettings Mode=SelectionMode.Cell></TreeGridSelectionSettings>
<TreeGridEvents CellSelecting="CellSelectingHandler" TValue="BusinessObject"></TreeGridEvents>
</SfTreeGrid>
@code {
public void CellSelectingHandler(CellSelectingEventArgs<BusinessObject> args)
{
}
}
CheckboxChange
An event that is raised when checkbox column state changed.
Declaration
public EventCallback<CheckBoxChangeEventArgs<TValue>> CheckboxChange { get; set; }
Property Value
Type | Description |
---|---|
Microsoft.AspNetCore.Components.EventCallback<CheckBoxChangeEventArgs<TValue>> | An event callback function. |
Remarks
This event handler receives a CheckBoxChangeEventArgs<T> object which provides the details of checkbox column state with the corresponding record and column details.
Examples
<SfTreeGrid>
<TreeGridEvents CheckboxChange="CheckboxChangeHandler" TValue="BusinessObject"></TreeGridEvents>
</SfTreeGrid>
@code {
public void CheckboxChangeHandler(CheckBoxChangeEventArgs<BusinessObject> args)
{
}
}
CheckboxFilterSearching
Gets or sets the event callback that is raised when values get filtered using search bar in Excel filter.
Declaration
public EventCallback<CheckboxFilterSearchingEventArgs> CheckboxFilterSearching { get; set; }
Property Value
Type | Description |
---|---|
Microsoft.AspNetCore.Components.EventCallback<CheckboxFilterSearchingEventArgs> | An event call back function. |
Remarks
This event handler receives a CheckboxFilterSearchingEventArgs object, which provides details about the values get filtered using search bar in excel filter in the tree grid.
Examples
This example shows how to handle the CheckboxFilterSearching event:
<SfTreeGrid DataSource="@TreeData" @ref="TreeGrid" AllowFiltering="true">
<TreeGridFilterSettings Type="Syncfusion.Blazor.TreeGrid.FilterType.Menu"></TreeGridFilterSettings>
<TreeGridEvents TValue="BusinessObject" CheckboxFilterSearching="CheckboxFilterSearchingHandler"></TreeGridEvents>
........
</SfTreeGrid>
@code{
public async Task CheckboxFilterSearchingHandler(CheckboxFilterSearchingEventArgs args)
{
}
Collapsed
An event that is raised after the tree grid parent row is collapsed.
Declaration
public EventCallback<RowCollapsedEventArgs<TValue>> Collapsed { get; set; }
Property Value
Type | Description |
---|---|
Microsoft.AspNetCore.Components.EventCallback<RowCollapsedEventArgs<TValue>> | An event callback function. |
Remarks
This event handler receives a RowCollapsedEventArgs<T> object which provides the details of parent and child rows.
Examples
<SfTreeGrid>
<TreeGridEvents Collapsed="CollapsedHandler" TValue="BusinessObject"></TreeGridEvents>
</SfTreeGrid>
@code {
public void CollapsedHandler(RowCollapsedEventArgs<BusinessObject> args)
{
}
}
Collapsing
An event that is raised while collapsing the tree grid parent row.
Declaration
public EventCallback<RowCollapsingEventArgs<TValue>> Collapsing { get; set; }
Property Value
Type | Description |
---|---|
Microsoft.AspNetCore.Components.EventCallback<RowCollapsingEventArgs<TValue>> | An event callback function. |
Remarks
This event handler receives a RowCollapsingEventArgs<T> object which provides the details of parent and child rows. Row collapse action can be cancelled using Cancel argument property.
Examples
<SfTreeGrid>
<TreeGridEvents Collapsing="CollapsingHandler" TValue="BusinessObject"></TreeGridEvents>
</SfTreeGrid>
@code {
public void CollapsingHandler(RowCollapsingEventArgs<BusinessObject> args)
{
}
}
ColumnMenuItemClicked
An event that is raised after clicking on column menu.
Declaration
public EventCallback<ColumnMenuClickEventArgs> ColumnMenuItemClicked { get; set; }
Property Value
Type | Description |
---|---|
Microsoft.AspNetCore.Components.EventCallback<ColumnMenuClickEventArgs> | An event callback function. |
Remarks
This event handler receives a ColumnMenuClickEventArgs object through which you can able to get the corresponding menu item and column details through event argument.
Examples
<SfTreeGrid ShowColumnMenu="true">
<TreeGridEvents ColumnMenuItemClicked="ColumnMenuItemClickedHandler" TValue="BusinessObject"></TreeGridEvents>
</SfTreeGrid>
@code {
public void ColumnMenuItemClickedHandler(ColumnMenuClickEventArgs args)
{
}
}
ColumnReordered
Gets or sets the event callback that is raised when columns are reorderd in the tree grid.
Declaration
public EventCallback<ColumnReorderedEventArgs> ColumnReordered { get; set; }
Property Value
Type | Description |
---|---|
Microsoft.AspNetCore.Components.EventCallback<ColumnReorderedEventArgs> | An event call back function. |
Remarks
This event handler receives a ColumnReorderedEventArgs object, which provides details about the columns reordered in the tree grid.
Examples
This example shows how to handle the ColumnReordered event:
<SfTreeGrid DataSource="@TreeData" @ref="TreeGrid" AllowReordering="true">
<TreeGridEvents TValue="BusinessObject" ColumnReordered="ColumnReorderedHandler"></TreeGridEvents>
........
</SfTreeGrid>
@code{
public async Task ColumnReorderedHandler(ColumnReorderedEventArgs args)
{
var toColumn = args.ToColumn; // To get the to columns list
}
ColumnReordering
Gets or sets the event callback that is raised when columns reordering action is performed in the tree grid.
Declaration
public EventCallback<ColumnReorderingEventArgs> ColumnReordering { get; set; }
Property Value
Type | Description |
---|---|
Microsoft.AspNetCore.Components.EventCallback<ColumnReorderingEventArgs> | An event call back function. |
Remarks
This event handler receives a ColumnReorderingEventArgs object, which provides details about the columns reordering action in the tree grid.
Examples
This example shows how to handle the ColumnReordering event:
<SfTreeGrid DataSource="@TreeData" @ref="TreeGrid" AllowReordering="true">
<TreeGridEvents TValue="BusinessObject" ColumnReordering="ColumnReorderingHandler"></TreeGridEvents>
........
</SfTreeGrid>
@code{
public async Task ColumnReorderingHandler(ColumnReorderingEventArgs args)
{
var fromColumn = args.FromColumn; // To get the from columns list
}
ColumnsStateChanged
Gets or sets the event callback that is raised when the tree grid's column visibility is changed.
Declaration
public EventCallback<ColumnVisibilityChangedEventArgs> ColumnsStateChanged { get; set; }
Property Value
Type | Description |
---|---|
Microsoft.AspNetCore.Components.EventCallback<ColumnVisibilityChangedEventArgs> | An event call back function. |
Remarks
This event handler receives a ColumnVisibilityChangedEventArgs object, which provides details about the columns and the action performed (show or hide) in the tree grid.
Examples
This example shows how to handle the ColumnsVisiblityChanged event:
<SfTreeGrid DataSource="@TreeData" @ref="TreeGrid" ShowColumnChooser="true" Toolbar="@( new List<string>() { "ColumnChooser"})">
<TreeGridEvents TValue="BusinessObject" ColumnsStateChanged ="ColumnsVisibilityChangedHandler"></TreeGridEvents>
........
</SfTreeGrid>
@code{
public async Task ColumnsVisibilityChangedHandler(ColumnVisibilityChangedEventArgs args)
{
}
ColumnsStateChanging
Gets or sets the event callback that is raised when the tree grid's column visibility is changing.
Declaration
public EventCallback<ColumnVisibilityChangingEventArgs> ColumnsStateChanging { get; set; }
Property Value
Type | Description |
---|---|
Microsoft.AspNetCore.Components.EventCallback<ColumnVisibilityChangingEventArgs> | An event call back function. |
Remarks
This event handler receives a ColumnVisibilityChangingEventArgs object, which provides details about the columns and the action performed (show or hide) in the tree grid.
Examples
This example shows how to handle the ColumnsStateChanging event:
<SfTreeGrid DataSource="@TreeData" @ref="TreeGrid" ShowColumnChooser="true" Toolbar="@( new List<string>() { "ColumnChooser"})">
<TreeGridEvents TValue="BusinessObject" ColumnsStateChanging="ColumnsVisibilityChangingHandler"></TreeGridEvents>
........
</SfTreeGrid>
@code{
public async Task ColumnsVisibilityChangingHandler(ColumnVisibilityChangingEventArgs args)
{
var vivibleColumns = args.VisibleColumns; // To get the visible columns list
}
CommandClicked
An event that is raised when command button is clicked in tree grid column.
Declaration
public EventCallback<CommandClickEventArgs<TValue>> CommandClicked { get; set; }
Property Value
Type | Description |
---|---|
Microsoft.AspNetCore.Components.EventCallback<CommandClickEventArgs<TValue>> | An event callback function. |
Remarks
This event handler receives a CommandClickEventArgs<T> object through which you can get the corresponding command column and row details.
Examples
<SfTreeGrid ShowColumnMenu="true">
<TreeGridEvents CommandClicked="OnCommandClicked" TValue="BusinessObject"></TreeGridEvents>
</SfTreeGrid>
@code {
public void OnCommandClicked(CommandClickEventArgs<BusinessObject> args)
{
}
}
ContextMenuItemClicked
An event that is raised after clicking an item on context menu.
Declaration
public EventCallback<ContextMenuClickEventArgs<TValue>> ContextMenuItemClicked { get; set; }
Property Value
Type | Description |
---|---|
Microsoft.AspNetCore.Components.EventCallback<ContextMenuClickEventArgs<TValue>> | An event callback function. |
Remarks
This event handler receives a ContextMenuClickEventArgs<T> object through which you can get the corresponding menu item, column and row details through event argument. Custom actions for custom context menu items can be performed here.
Examples
<SfTreeGrid ContextMenuItems="@(new List<object>() { "AutoFit", "AutoFitAll", "SortAscending", "SortDescending","Copy", "Edit",
"Delete", "Save", "Cancel","PdfExport", "ExcelExport", "CsvExport", "FirstPage", "PrevPage","LastPage", "NextPage"})" >
<TreeGridEvents ContextMenuItemClicked="ContextMenuItemClickedHandler" TValue="BusinessObject"></TreeGridEvents>
</SfTreeGrid>
@code {
public void ContextMenuItemClickedHandler(ContextMenuClickEventArgs args)
{
}
}
ContextMenuOpen
An event that is raised when context menu is opened.
Declaration
public EventCallback<ContextMenuOpenEventArgs<TValue>> ContextMenuOpen { get; set; }
Property Value
Type | Description |
---|---|
Microsoft.AspNetCore.Components.EventCallback<ContextMenuOpenEventArgs<TValue>> | An event callback function. |
Remarks
This event handler receives a ContextMenuOpenEventArgs<T> object through which you can get context menu instance through event argument so you can able to customize the context menu items.
Examples
<SfTreeGrid ContextMenuItems="@(new List<object>() { "AutoFit", "AutoFitAll", "SortAscending", "SortDescending","Copy", "Edit",
"Delete", "Save", "Cancel","PdfExport", "ExcelExport", "CsvExport", "FirstPage", "PrevPage","LastPage", "NextPage"})" >
<TreeGridEvents ContextMenuOpen="ContextMenuOpenHandler" TValue="BusinessObject"></TreeGridEvents>
</SfTreeGrid>
@code {
public void ContextMenuOpenHandler(ContextMenuOpenEventArgs<BusinessObject> args)
{
}
}
Created
An event that is raised when the component is created.
Declaration
public EventCallback<object> Created { get; set; }
Property Value
Type | Description |
---|---|
Microsoft.AspNetCore.Components.EventCallback<System.Object> | An event callback function. |
Remarks
This event handler receives a object which provides the details of created tree grid component.
Examples
<SfTreeGrid>
<TreeGridEvents Created="CreatedHandler" TValue="BusinessObject"></TreeGridEvents>
</SfTreeGrid>
@code {
public void CreatedHandler(object args)
{
}
}
DataBound
An event that is raised when data source is populated in the tree grid.
Declaration
public EventCallback<object> DataBound { get; set; }
Property Value
Type | Description |
---|---|
Microsoft.AspNetCore.Components.EventCallback<System.Object> | An event callback function. |
Remarks
This event handler receives a object which provides the current view data and its count.
Examples
<SfTreeGrid>
<TreeGridEvents DataBound="DataBoundHandler" TValue="BusinessObject"></TreeGridEvents>
</SfTreeGrid>
@code {
public void DataBoundHandler(object args)
{
}
}
Destroyed
An event that is raised when the tree grid component is destroyed.
Declaration
public EventCallback<object> Destroyed { get; set; }
Property Value
Type | Description |
---|---|
Microsoft.AspNetCore.Components.EventCallback<System.Object> | An event callback function. |
Remarks
This event handler receives a object which provides the details of the component.
Examples
<SfTreeGrid>
<TreeGridEvents Destroyed="DestroyHandler" TValue="BusinessObject"></TreeGridEvents>
</SfTreeGrid>
@code {
public void DestroyHandler(object args)
{
}
}
DetailDataBound
An event that is raised after detail row expands.
Declaration
public EventCallback<DetailDataBoundEventArgs<TValue>> DetailDataBound { get; set; }
Property Value
Type | Description |
---|---|
Microsoft.AspNetCore.Components.EventCallback<DetailDataBoundEventArgs<TValue>> | An event callback function. |
Remarks
This event handler receives a DetailDataBoundEventArgs<T> object which provides the details of the row.
Examples
<SfTreeGrid>
<TreeGridEvents DetailDataBound="DetailDataBoundHandler" TValue="Employee"></TreeGridEvents>
</SfTreeGrid>
@code {
public void DetailDataBoundHandler(DetailDataBoundEventArgs<Employee> args)
{
}
}
ExcelQueryCellInfoEvent
An even that is raised every time a data is entered into a cell of the excel sheet.
Declaration
public EventCallback<ExcelQueryCellInfoEventArgs<TValue>> ExcelQueryCellInfoEvent { get; set; }
Property Value
Type | Description |
---|---|
Microsoft.AspNetCore.Components.EventCallback<ExcelQueryCellInfoEventArgs<TValue>> | An event callback function. |
Remarks
This event handler receives a ExcelQueryCellInfoEventArgs<T> object which provides the details before the tree grid data is exported to the Excel file. It can be used to customize the tree grid content in Excel file.
Examples
<SfTreeGrid AllowExcelExport="true" Toolbar="@(new List<string>() { "Excel Export" })">
<TreeGridEvents ExcelQueryCellInfoEvent="ExcelQueryCellInfoHandler" TValue="BusinessObject"></TreeGridEvents>
</SfTreeGrid>
@code {
SfTreeGrid<BusinessObject> TreeGrid;
public async Task ToolbarClickHandler(Syncfusion.Blazor.Navigations.ClickEventArgs Args)
{
if (Args.Item.Text == "Excel Export")
{
await this.TreeGrid.ExcelExport();
}
}
public void RowSelectedHandler(RowSelectEventArgs<BusinessObject> args)
{
}
}
Expanded
An event that is raised after the tree grid parent row is expanded.
Declaration
public EventCallback<RowExpandedEventArgs<TValue>> Expanded { get; set; }
Property Value
Type | Description |
---|---|
Microsoft.AspNetCore.Components.EventCallback<RowExpandedEventArgs<TValue>> | An event callback function. |
Remarks
This event handler receives a RowExpandedEventArgs<T> object which provides the details of the parent and child rows.
Examples
<SfTreeGrid>
<TreeGridEvents Expanded="ExpandedHandler" TValue="BusinessObject"></TreeGridEvents>
</SfTreeGrid>
@code {
public void ExpandedHandler(RowExpandedEventArgs<BusinessObject> args)
{
}
}
Expanding
An event that is raised while expanding the tree grid parent row.
Declaration
public EventCallback<RowExpandingEventArgs<TValue>> Expanding { get; set; }
Property Value
Type | Description |
---|---|
Microsoft.AspNetCore.Components.EventCallback<RowExpandingEventArgs<TValue>> | An event callback function. |
Remarks
This event handler receives a RowExpandingEventArgs<T> object which provides the details of parent and child rows. Row expand action can be cancelled using Cancel argument property.
Examples
<SfTreeGrid>
<TreeGridEvents Expanding="ExpandingHandler" TValue="BusinessObject"></TreeGridEvents>
</SfTreeGrid>
@code {
public void ExpandingHandler(RowExpandingEventArgs<BusinessObject> args)
{
}
}
FilterDialogOpened
Gets or sets the event callback that is raised after the filter dialog opened in the tree grid.
Declaration
public EventCallback<FilterDialogOpenedEventArgs> FilterDialogOpened { get; set; }
Property Value
Type | Description |
---|---|
Microsoft.AspNetCore.Components.EventCallback<FilterDialogOpenedEventArgs> | An event call back function. |
Remarks
This event handler receives a FilterDialogOpenedEventArgs object, which provides details about the filter dialog opened in the tree grid.
Examples
This example shows how to handle the FilterDialogOpened event:
<SfTreeGrid DataSource="@TreeData" @ref="TreeGrid" AllowFiltering="true">
<TreeGridFilterSettings Type="Syncfusion.Blazor.TreeGrid.FilterType.Menu"></TreeGridFilterSettings>
<TreeGridEvents TValue="BusinessObject" FilterDialogOpened ="FilterDialogOpenedHandler"></TreeGridEvents>
........
</SfTreeGrid>
@code{
public async Task FilterDialogOpenedHandler(FilterDialogOpenedEventArgs args)
{
}
FilterDialogOpening
Gets or sets the event callback that is raised before the filter dialog is opened in the tree grid.
Declaration
public EventCallback<FilterDialogOpeningEventArgs> FilterDialogOpening { get; set; }
Property Value
Type | Description |
---|---|
Microsoft.AspNetCore.Components.EventCallback<FilterDialogOpeningEventArgs> | An event call back function. |
Remarks
This event handler receives a FilterDialogOpeningEventArgs object, which provides details about the filter dialog opening in the tree grid.
Examples
This example shows how to handle the FilterDialogOpening event:
<SfTreeGrid DataSource="@TreeData" @ref="TreeGrid" AllowFiltering="true">
<TreeGridFilterSettings Type="Syncfusion.Blazor.TreeGrid.FilterType.Menu"></TreeGridFilterSettings>
<TreeGridEvents TValue="BusinessObject" FilterDialogOpening ="FilterDialogOpeningHandler"></TreeGridEvents>
........
</SfTreeGrid>
@code{
public async Task FilterDialogOpeningHandler(FilterDialogOpeningEventArgs args)
{
}
Filtered
Gets or sets the event callback that is raised before the filtered action is performed in the tree grid.
Declaration
public EventCallback<FilteredEventArgs> Filtered { get; set; }
Property Value
Type | Description |
---|---|
Microsoft.AspNetCore.Components.EventCallback<FilteredEventArgs> | An event call back function. |
Remarks
This event handler receives a FilteredEventArgs object, which provides details about the filtered action in the tree grid.
Examples
This example shows how to handle the Filtered event:
<SfTreeGrid DataSource="@TreeData" @ref="TreeGrid" AllowFiltering="true">
<TreeGridEvents TValue="BusinessObject" Filtered="FilteredHandler"></TreeGridEvents>
........
</SfTreeGrid>
@code{
public async Task FilteredHandler(FilteredEventArgs args)
{
}
Filtering
Gets or sets the event callback that is raised before the filtering action is performed in the tree grid.
Declaration
public EventCallback<FilteringEventArgs> Filtering { get; set; }
Property Value
Type | Description |
---|---|
Microsoft.AspNetCore.Components.EventCallback<FilteringEventArgs> | An event call back function. |
Remarks
This event handler receives a FilteringEventArgs object, which provides details about the filtering action in the tree grid.
Examples
This example shows how to handle the Filtering event:
<SfTreeGrid DataSource="@TreeData" @ref="TreeGrid" AllowFiltering="true">
<TreeGridEvents TValue="BusinessObject" Filtering="FilteringHandler"></TreeGridEvents>
........
</SfTreeGrid>
@code{
public async Task FilteringHandler(FilteringEventArgs args)
{
}
FreezeLineMoved
Gets or sets an event callback that is raised after moved freeze line.
Declaration
public EventCallback<FreezeLineMovedEventArgs> FreezeLineMoved { get; set; }
Property Value
Type | Description |
---|---|
Microsoft.AspNetCore.Components.EventCallback<FreezeLineMovedEventArgs> | An event callback function. |
Remarks
This event handler receives a FreezeLineMovedEventArgs object which provides the details after frozen line moved.
Examples
<SfTreeGrid>
<TreeGridEvents FreezeLineMoved="FreezeLineMovedHandler" TValue="BusinessObject"></TreeGridEvents>
</SfTreeGrid>
@code {
public void FreezeLineMovedHandler(FreezeLineMoving args)
{
}
}
FreezeLineMoving
Gets or sets an event callback that is raised on moving freeze line.
Declaration
public EventCallback<FreezeLineMovingEventArgs> FreezeLineMoving { get; set; }
Property Value
Type | Description |
---|---|
Microsoft.AspNetCore.Components.EventCallback<FreezeLineMovingEventArgs> | An event callback function. |
Remarks
This event handler receives a FreezeLineMovingEventArgs object which provides the details when frozen line moving.
Examples
<SfTreeGrid>
<TreeGridEvents FreezeLineMoving="FreezeLineMovingHandler" TValue="BusinessObject"></TreeGridEvents>
</SfTreeGrid>
@code {
public void FreezeLineMovingHandler(FreezeLineMoving args)
{
}
}
HeaderCellInfo
An event that is raised everytime a header cell is rendered or refreshed in tree grid.
Declaration
public EventCallback<HeaderCellInfoEventArgs> HeaderCellInfo { get; set; }
Property Value
Type | Description |
---|---|
Microsoft.AspNetCore.Components.EventCallback<HeaderCellInfoEventArgs> | An event callback function. |
Remarks
This event handler receives a HeaderCellInfoEventArgs object which provides the details of header cells in the tree grid so that it can be customized.
Examples
<SfTreeGrid>
<TreeGridEvents HeaderCellInfo="HeaderCellInfoHandler" TValue="BusinessObject"></TreeGridEvents>
</SfTreeGrid>
@code {
public void HeaderCellInfoHandler(HeaderCellInfoEventArgs args)
{
}
}
IndentationChanged
Gets or sets the event callback raised after indent or outdent action is performed in the tree grid.
Declaration
public EventCallback<IndentationChangedEventArgs<TValue>> IndentationChanged { get; set; }
Property Value
Type | Description |
---|---|
Microsoft.AspNetCore.Components.EventCallback<IndentationChangedEventArgs<TValue>> | An event callback function. |
Remarks
The event handler receives a IndentationChangedEventArgs<T> object, which provides details about the indent or outdent action performed in the tree grid. Based on the 'RequestType' property of this event argument, the type of indentation (indent or outdent) can be determined.
Examples
This example shows how to handle the Indented event:
<SfTreeGrid>
<TreeGridEvents TValue="Orders" IndentationChanged="IndentationChangedHandler"></TreeGridEvents>
<!-- Other TreeGrid configurations -->
</SfTreeGrid>
@code{
public async Task IndentationChangedHandler (IndentationChangedEventArgs<TValue> args)
{
// Handle the indent or outdent action
}
IndentationChanging
Gets or sets the event callback that is raised before an indent or outdent action is performed in the tree grid.
Declaration
public EventCallback<IndentationChangingEventArgs<TValue>> IndentationChanging { get; set; }
Property Value
Type | Description |
---|---|
Microsoft.AspNetCore.Components.EventCallback<IndentationChangingEventArgs<TValue>> | An event callback function. |
Remarks
The event handler receives an IndentationChangingEventArgs<T> object, which provides details about the indent or outdent action being performed in the tree grid. Based on the 'RequestType' property of this event argument, the type of indentation (indent or outdent) can be determined.
Examples
This example shows how to handle the IndentationChanging event:
<SfTreeGrid DataSource="@Orders">
<TreeGridEvents TValue="Orders" IndentationChanging="IndentationChangingHandler"></TreeGridEvents>
<!-- Other TreeGrid configurations -->
</SfTreeGrid>
@code {
public async Task IndentationChangingHandler(IndentationChangingEventArgs<T> args)
{
// Handle the indent or outdent action
}
}
OnActionBegin
An event that is raised when the tree grid actions such as sorting, filtering, paging, and more begins.
Declaration
public EventCallback<ActionEventArgs<TValue>> OnActionBegin { get; set; }
Property Value
Type | Description |
---|---|
Microsoft.AspNetCore.Components.EventCallback<ActionEventArgs<TValue>> | An event callback function. |
Remarks
This event handler receives a ActionEventArgs<T> object which provides the details of current tree grid action.
Examples
<SfTreeGrid>
<TreeGridEvents OnActionBegin="ActionBeginHandler" TValue="BusinessObject"></TreeGridEvents>
</SfTreeGrid>
@code {
public void ActionBeginHandler(ActionEventArgs<BusinessObject> args)
{
}
}
OnActionComplete
An event that is raised when the tree grid actions such as sorting, filtering, paging and more are completed.
Declaration
public EventCallback<ActionEventArgs<TValue>> OnActionComplete { get; set; }
Property Value
Type | Description |
---|---|
Microsoft.AspNetCore.Components.EventCallback<ActionEventArgs<TValue>> | An event callback function. |
Remarks
This event handler receives a ActionEventArgs<T> object which provides the details of current tree grid action.
Examples
<SfTreeGrid>
<TreeGridEvents OnActionComplete="ActionCompleteHandler" TValue="BusinessObject"></TreeGridEvents>
</SfTreeGrid>
@code {
public void ActionCompleteHandler(ActionEventArgs<BusinessObject> args)
{
}
}
OnActionFailure
An event that is raised when any tree grid action failed to achieve the desired results.
Declaration
public EventCallback<FailureEventArgs> OnActionFailure { get; set; }
Property Value
Type | Description |
---|---|
Microsoft.AspNetCore.Components.EventCallback<FailureEventArgs> | An event callback function. |
Remarks
This event handler receives a FailureEventArgs object which provides details of the error in Tree Grid. Stack trace of exceptions, if any, can also be obtained here.
Examples
<SfTreeGrid>
<TreeGridEvents OnActionFailure="ActionFailureHandler" TValue="BusinessObject"></TreeGridEvents>
</SfTreeGrid>
@code {
public void ActionFailureHandler(FailureEventArgs args)
{
}
}
OnBatchAdd
An event that is raised when the tree grid records are added in the batch mode.
Declaration
public EventCallback<BeforeBatchAddArgs<TValue>> OnBatchAdd { get; set; }
Property Value
Type | Description |
---|---|
Microsoft.AspNetCore.Components.EventCallback<BeforeBatchAddArgs<TValue>> | An event callback function. |
Remarks
This event handler receives a BeforeBatchAddArgs<T> object. Based on this, you can customize the batch add operation.
Examples
<SfTreeGrid>
<TreeGridEvents OnBatchAdd="BatchAddHandler" TValue="BusinessObject"></TreeGridEvents>
</SfTreeGrid>
@code {
public void BatchAddHandler(BeforeBatchAddArgs<BusinessObject> args)
{
}
}
OnBatchDelete
An event that is raised When the tree grid records are deleted in the batch mode.
Declaration
public EventCallback<BeforeBatchDeleteArgs<TValue>> OnBatchDelete { get; set; }
Property Value
Type | Description |
---|---|
Microsoft.AspNetCore.Components.EventCallback<BeforeBatchDeleteArgs<TValue>> | An event callback function. |
Remarks
This event handler receives a BeforeBatchDeleteArgs<T> object. Based on this, you can get deleted records details or cancel the batch delete action.
Examples
<SfTreeGrid>
<TreeGridEvents OnBatchDelete="BatchDeleteHandler" TValue="BusinessObject"></TreeGridEvents>
</SfTreeGrid>
@code {
public void BatchDeleteHandler(BeforeBatchDeleteArgs<BusinessObject> args)
{
}
}
OnBatchSave
An event that is raised when the modified records are saved to data source in batch mode.
Declaration
public EventCallback<BeforeBatchSaveArgs<TValue>> OnBatchSave { get; set; }
Property Value
Type | Description |
---|---|
Microsoft.AspNetCore.Components.EventCallback<BeforeBatchSaveArgs<TValue>> | An event callback function. |
Remarks
This event handler receives a BeforeBatchSaveArgs<T> object which provides the details of the changed tree grid records.
Examples
<SfTreeGrid>
<TreeGridEvents OnBatchSave="BatchSaveHandler" TValue="BusinessObject"></TreeGridEvents>
</SfTreeGrid>
@code {
public void BatchSaveHandler(BeforeBatchSaveArgs<BusinessObject> args)
{
}
}
OnBeginEdit
An event that is raised when tree grid record is beginning to do edit operation.
Declaration
public EventCallback<BeginEditArgs<TValue>> OnBeginEdit { get; set; }
Property Value
Type | Description |
---|---|
Microsoft.AspNetCore.Components.EventCallback<BeginEditArgs<TValue>> | An event callback function. |
Remarks
This event handler receives a BeginEditArgs<T> object through which you can be able to get the current edited record details through the event argument. Edit action can be cancelled using Cancel argument property.
Examples
<SfTreeGrid>
<TreeGridEvents OnBeginEdit="BeginEditHandler" TValue="BusinessObject"></TreeGridEvents>
</SfTreeGrid>
@code {
public void BeginEditHandler(BeginEditArgs<BusinessObject> args)
{
}
}
OnCellEdit
An event that is raised when the cell is being edited.
Declaration
public EventCallback<CellEditArgs<TValue>> OnCellEdit { get; set; }
Property Value
Type | Description |
---|---|
Microsoft.AspNetCore.Components.EventCallback<CellEditArgs<TValue>> | An event callback function. |
Remarks
This event handler receives a CellEditArgs<T> object through which you can get the corresponding column and edited row details through event argument. Cell edit action can be cancelled using Cancel argument property.
Examples
<SfTreeGrid>
<TreeGridEvents OnCellEdit="CellEditHandler" TValue="BusinessObject"></TreeGridEvents>
</SfTreeGrid>
@code {
public void CellEditHandler(CellEditArgs<BusinessObject> args)
{
}
}
OnCellSave
An event that is raised when modified cell value is saved.
Declaration
public EventCallback<CellSaveArgs<TValue>> OnCellSave { get; set; }
Property Value
Type | Description |
---|---|
Microsoft.AspNetCore.Components.EventCallback<CellSaveArgs<TValue>> | An event callback function. |
Remarks
This event handler receives a CellSaveArgs<T> object through which you can get previous and current edited cell values so you can be able to customize the cell save action.
Examples
<SfTreeGrid>
<TreeGridEvents OnCellSave="CellSaveHandler" TValue="BusinessObject"></TreeGridEvents>
</SfTreeGrid>
@code {
public void CellSaveHandler(CellSaveArgs<BusinessObject> args)
{
}
}
OnDataBound
An event that is raised when data is bound to the tree grid.
Declaration
public EventCallback<BeforeDataBoundArgs<TValue>> OnDataBound { get; set; }
Property Value
Type | Description |
---|---|
Microsoft.AspNetCore.Components.EventCallback<BeforeDataBoundArgs<TValue>> | An event callback function. |
Remarks
This event handler receives a BeforeDataBoundArgs<T> object through which you can able to get currentview data and total records count.
Examples
<SfTreeGrid>
<TreeGridEvents OnDataBound="DataBoundHandler" TValue="BusinessObject"></TreeGridEvents>
</SfTreeGrid>
@code {
public void DataBoundHandler(BeforeDataBoundArgs<BusinessObject> args)
{
}
}
OnExcelExport
An event that is raised when the tree grid data is exported to an excel file.
Declaration
public EventCallback<object> OnExcelExport { get; set; }
Property Value
Type | Description |
---|---|
Microsoft.AspNetCore.Components.EventCallback<System.Object> | An event callback function. |
Remarks
This event handler receives a object which provides the details of tree grid data and excel properties.
Examples
<SfTreeGrid>
<TreeGridEvents OnExcelExport="ExcelExportHandler" OnToolbarClick="ToolbarClickHandler" TValue="BusinessObject"></TreeGridEvents>
</SfTreeGrid>
@code {
SfTreeGrid<BusinessObject> TreeGrid;
public async Task ToolbarClickHandler(Syncfusion.Blazor.Navigations.ClickEventArgs Args)
{
if (Args.Item.Text == "Excel Export")
{
await this.TreeGrid.ExcelExport();
}
}
public void ExcelExportHandler(object args)
{
}
}
OnLoad
An event that is raised before rendering of TreeGrid Component.
Declaration
public EventCallback<object> OnLoad { get; set; }
Property Value
Type | Description |
---|---|
Microsoft.AspNetCore.Components.EventCallback<System.Object> | An event callback function. |
Remarks
This event handler receives a System.Object object which provides the details of the tree grid before initial rendering.
Examples
<SfTreeGrid>
<TreeGridEvents TValue="BusinessObject" OnLoad="LoadHandler"></TreeGridEvents>
</SfTreeGrid>
@code {
public void LoadHandler(object args)
{
}
}
OnPdfExport
An event that is raised when tree grid data is exported to a PDF document.
Declaration
public EventCallback<object> OnPdfExport { get; set; }
Property Value
Type | Description |
---|---|
Microsoft.AspNetCore.Components.EventCallback<System.Object> | An event callback function. |
Remarks
This event handler receives a object argument that provides the details on tree grid data and PDF properties.
Examples
<SfTreeGrid>
<TreeGridEvents OnPdfExport="PdfExportHandler" OnToolbarClick="ToolbarClickHandler" TValue="BusinessObject"></TreeGridEvents>
</SfTreeGrid>
@code {
SfTreeGrid<BusinessObject> TreeGrid;
public async Task ToolbarClickHandler(Syncfusion.Blazor.Navigations.ClickEventArgs Args)
{
if (Args.Item.Text == "PDF Export")
{
await this.TreeGrid.PdfExport();
}
}
public void PdfExportHandler(object args)
{
}
}
OnRecordDoubleClick
An event that is raised when tree grid row is double clicked.
Declaration
public EventCallback<RecordDoubleClickEventArgs<TValue>> OnRecordDoubleClick { get; set; }
Property Value
Type | Description |
---|---|
Microsoft.AspNetCore.Components.EventCallback<RecordDoubleClickEventArgs<TValue>> | An event callback function. |
Remarks
This event handler receives a RecordDoubleClickEventArgs<T> object which provides the details of the tree grid row.
Examples
<SfTreeGrid>
<TreeGridEvents OnRecordDoubleClick="RecordDoubleClickHandler" TValue="BusinessObject"></TreeGridEvents>
</SfTreeGrid>
@code {
public void RecordDoubleClickHandler(RecordDoubleClickEventArgs<BusinessObject> args)
{
}
}
OnResizeStart
An event that is raised when tree grid column resize starts.
Declaration
public EventCallback<ResizeArgs> OnResizeStart { get; set; }
Property Value
Type | Description |
---|---|
Microsoft.AspNetCore.Components.EventCallback<ResizeArgs> | An event callback function. |
Remarks
This event handler receives a ResizeArgs object which provides the details of the resizing column.
Examples
<SfTreeGrid>
<TreeGridEvents OnResizeStart="OnResizeStartHanlder" TValue="BusinessObject"></TreeGridEvents>
</SfTreeGrid>
@code {
public void OnResizeStartHanlder(ResizeArgs args)
{
}
}
OnRowDragStart
Gets or sets the event callback that is raised when we start dragging the rows to perform reorder.
Declaration
public EventCallback<RowDragEventArgs<TValue>> OnRowDragStart { get; set; }
Property Value
Type | Description |
---|---|
Microsoft.AspNetCore.Components.EventCallback<RowDragEventArgs<TValue>> | An event callback function. |
Remarks
This event handler receives a RowDragEventArgs<T> object which provides the details of the rows from which it is dragged.
Examples
<SfTreeGrid DataSource="@TreeData" @ref="TreeGrid">
<TreeGridEvents TValue="BusinessObject" OnRowDragStart="OnRowDragStartHandler"></TreeGridEvents>
........
</SfTreeGrid>
@code{
public async Task OnRowDragStartHandler(RowDragEventArgs<BusinessObject> args)
{
//you can get the dragged row data's here
List<BusinessObject> Data = args.Data;
}
OnToolbarClick
An event that is raised when toolbar item is clicked.
Declaration
public EventCallback<ClickEventArgs> OnToolbarClick { get; set; }
Property Value
Type | Description |
---|---|
Microsoft.AspNetCore.Components.EventCallback<ClickEventArgs> | An event callback function. |
Remarks
This event handler receives a OnToolbarClick object which provides the details about the toolbar item. Custom actions for custom toolbar items can be performed using this event.
Examples
<SfTreeGrid Toolbar="@(new List<string>() { "Add", "Edit", "Delete", "Cancel", "Update" })">
<TreeGridEvents OnToolbarClick="ToolbarClickHandler" TValue="BusinessObject"></TreeGridEvents>
</SfTreeGrid>
@code {
public void ToolbarClickHandler(Syncfusion.Blazor.Navigations.ClickEventArgs Args)
{
}
}
PageChanged
Gets or sets the event callback that is raised after paging action is performed in the tree grid.
Declaration
public EventCallback<GridPageChangedEventArgs> PageChanged { get; set; }
Property Value
Type | Description |
---|---|
Microsoft.AspNetCore.Components.EventCallback<GridPageChangedEventArgs> | An event call back function. |
Remarks
The event handler receives a GridPageChangedEventArgs object, which provides details about the paging action in the tree grid.
Examples
This example shows how to handle the PageChanged event:
<SfTreeGrid DataSource="@TreeData" @ref="TreeGrid" AllowPaging="true">
<TreeGridEvents TValue="BusinessObject" PageChanged="PageChangedHandler"></TreeGridEvents>
........
</SfTreeGrid>
@code {
public async Task PageChangedHandler (GridPageChangedEventArgs args)
{
args.CurrentPage = 2; // Sets the current page number.
}
PageChanging
Gets or sets the event callback that is raised before paging action is performed in the tree grid.
Declaration
public EventCallback<GridPageChangingEventArgs> PageChanging { get; set; }
Property Value
Type | Description |
---|---|
Microsoft.AspNetCore.Components.EventCallback<GridPageChangingEventArgs> | An event call back function. |
Remarks
The event handler receives a GridPageChangingEventArgs object, which provides details about the paging action in the tree grid.
Examples
This example shows how to handle the PageChanging event:
<SfTreeGrid DataSource="@TreeData" @ref="TreeGrid" AllowPaging="true">
<TreeGridEvents TValue="BusinessObject" PageChanging="PageChangingHandler"></TreeGridEvents>
........
</SfTreeGrid>
@code {
public async Task PageChangingHandler (GridPageChangingEventArgs args)
{
args.CurrentPage = 2; // Sets the current page number.
}
Parent
Gets the Parent component.
Declaration
protected SfTreeGrid<TValue> Parent { get; set; }
Property Value
Type |
---|
SfTreeGrid<TValue> |
PdfQueryCellInfoEvent
An event that is raised every time a data is entered into a cell of the pdf document.
Declaration
public EventCallback<PdfQueryCellInfoEventArgs<TValue>> PdfQueryCellInfoEvent { get; set; }
Property Value
Type | Description |
---|---|
Microsoft.AspNetCore.Components.EventCallback<PdfQueryCellInfoEventArgs<TValue>> | An event callback function. |
Remarks
This event handler receives a PdfQueryCellInfoEventArgs<T> object which provides the details before the tree grid data is exported to PDF document. It can be used to customize the tree grid content in a PDF document.
Examples
<SfTreeGrid AllowPdfExport="true" Toolbar="@(new List<string>() { "PdfExport" })">
<TreeGridEvents PdfQueryCellInfoEvent="PdfQueryCellInfoHandler" OnToolbarClick="ToolbarClickHandler" TValue="BusinessObject"></TreeGridEvents>
</SfTreeGrid>
@code {
SfTreeGrid<BusinessObject> TreeGrid;
public async Task ToolbarClickHandler(Syncfusion.Blazor.Navigations.ClickEventArgs Args)
{
if (Args.Item.Text == "PDF Export")
{
await this.TreeGrid.PdfExport();
}
}
public void PdfQueryCellInfoHandler(PdfQueryCellInfoEventArgs<BusinessObject> args)
{
}
}
QueryCellInfo
An event that is raised every time a tree grid cell is rendered or refreshed.
Declaration
public EventCallback<QueryCellInfoEventArgs<TValue>> QueryCellInfo { get; set; }
Property Value
Type | Description |
---|---|
Microsoft.AspNetCore.Components.EventCallback<QueryCellInfoEventArgs<TValue>> | An event callback function. |
Remarks
This event handler receives a QueryCellInfoEventArgs<T> object which provides the details of the tree grid cell. Customizations for tree grid cell element can be performed here.
Examples
<SfTreeGrid>
<TreeGridEvents QueryCellInfo="QueryCellInfoHandler" TValue="BusinessObject"></TreeGridEvents>
</SfTreeGrid>
@code {
public void QueryCellInfoHandler(QueryCellInfoEventArgs<BusinessObject> args)
{
}
}
RecordClicked
Gets or sets an event callback that is raised when a cell is clicked in the tree grid.
Declaration
public EventCallback<RecordClickEventArgs<TValue>> RecordClicked { get; set; }
Property Value
Type | Description |
---|---|
Microsoft.AspNetCore.Components.EventCallback<RecordClickEventArgs<TValue>> | The event callback function. |
Remarks
This event handler receives a RecordClickEventArgs<T> object, which provides the information about the clicked cell and row information.
Examples
The following example demonstrates how to handle the event in a Razor component:
<SfTreeGrid>
<TreeGridEvents RecordClicked = "RecordClickHandler" TValue="BusinessObject"> </TreeGridEvents>
</SfTreeGrid>
@code {
public void RecordClickHandler(Syncfusion.Blazor.TreeGrid.RecordClickEventArgs<BusinessObject> args)
{
}
}
ResizeStopped
An event that is raised when tree grid column resize ends.
Declaration
public EventCallback<ResizeArgs> ResizeStopped { get; set; }
Property Value
Type | Description |
---|---|
Microsoft.AspNetCore.Components.EventCallback<ResizeArgs> | An event callback function. |
Remarks
This event handler receives a ResizeArgs object which provides the details of resized column.
Examples
<SfTreeGrid>
<TreeGridEvents ResizeStopped="ResizeStoppedHanlder" TValue="BusinessObject"></TreeGridEvents>
</SfTreeGrid>
@code {
public void ResizeStoppedHanlder(ResizeArgs args)
{
}
}
RowCreated
Gets or sets the event callback that is raised after the add action is performed in the tree grid.
Declaration
public EventCallback<RowCreatedEventArgs<TValue>> RowCreated { get; set; }
Property Value
Type | Description |
---|---|
Microsoft.AspNetCore.Components.EventCallback<RowCreatedEventArgs<TValue>> | An event call back function. |
Remarks
This event handler receives a RowCreatedEventArgs<T> object, which provides details about the after add action in the tree grid.
Examples
This example shows how to handle the RowAdded event:
<SfTreeGrid DataSource="@TreeData" Toolbar="@(new List<string>() { "Add" })">
<TreeGridEditSettings AllowAdding="true" Mode="Syncfusion.Blazor.TreeGrid.EditMode.Row" />
<TreeGridEvents TValue="BusinessObject" RowAdded="RowAddedHandler"></TreeGridEvents>
........
</SfTreeGrid>
@code{
public async Task RowAddedHandler (RowCreatedEventArgs<BusinessObject> args)
{
var addedRecord = args.Data; // Gets the added record.
}
RowCreating
Gets or sets the event callback that is raised before the add action is performed in the tree grid.
Declaration
public EventCallback<RowCreatingEventArgs<TValue>> RowCreating { get; set; }
Property Value
Type | Description |
---|---|
Microsoft.AspNetCore.Components.EventCallback<RowCreatingEventArgs<TValue>> | An event call back function. |
Remarks
This event handler receives a RowCreatingEventArgs<T> object, which provides details about the before add action in the tree grid.
Examples
This example shows how to handle the RowAdding event:
<SfTreeGrid DataSource="@TreeData" Toolbar="@(new List<string>() { "Add" })">
<TreeGridEditSettings AllowAdding="true" Mode="Syncfusion.Blazor.TreeGrid.EditMode.Row" />
<TreeGridEvents TValue="BusinessObject" RowAdded="RowAddedHandler"></TreeGridEvents>
........
</SfTreeGrid>
@code{
public async Task RowAddingHandler (RowCreatingEventArgs<BusinessObject> args)
{
args.Cancel = true; // To cancel the add action.
}
RowDataBound
An event that is raised every time a tree grid row is rendered or refreshed.
Declaration
public EventCallback<RowDataBoundEventArgs<TValue>> RowDataBound { get; set; }
Property Value
Type | Description |
---|---|
Microsoft.AspNetCore.Components.EventCallback<RowDataBoundEventArgs<TValue>> | An event callback function. |
Remarks
This event handler receives a RowDataBoundEventArgs<T> object which provides the details of the tree grid row. Customizations for tree grid row element can be performed here.
Examples
<SfTreeGrid>
<TreeGridEvents RowDataBound="RowDataBoundHandler" TValue="BusinessObject"></TreeGridEvents>
</SfTreeGrid>
@code {
public void RowDataBoundHandler(RowDataBoundEventArgs<BusinessObject> args)
{
}
}
RowDeleted
Gets or sets the event callback that is raised after the delete action is performed in the tree grid.
Declaration
public EventCallback<RowDeletedEventArgs<TValue>> RowDeleted { get; set; }
Property Value
Type | Description |
---|---|
Microsoft.AspNetCore.Components.EventCallback<RowDeletedEventArgs<TValue>> | An event call back function. |
Remarks
This event handler receives a RowDeletedEventArgs<T> object, which provides details about the after delete action in the tree grid.
Examples
This example shows how to handle the RowDeleted event:
<SfTreeGrid DataSource="@TreeData" Toolbar="@(new List<string>() { "Delete" })">
<TreeGridEditSettings AllowDeleting="true" Mode="Syncfusion.Blazor.TreeGrid.EditMode.Row" />
<TreeGridEvents TValue="BusinessObject" RowDeleted ="RowDeletedHandler"></TreeGridEvents>
........
</SfTreeGrid>
@code{
public async Task RowDeletedHandler(RowDeletedEventArgs<BusinessObject> args)
{
var rowIndex = args.RowIndex; // Gets the row index of the deleted record.
}
RowDeleting
Gets or sets the event callback that is raised before the delete action is performed in the tree grid.
Declaration
public EventCallback<RowDeletingEventArgs<TValue>> RowDeleting { get; set; }
Property Value
Type | Description |
---|---|
Microsoft.AspNetCore.Components.EventCallback<RowDeletingEventArgs<TValue>> | An event call back function. |
Remarks
This event handler receives a RowDeletingEventArgs<T> object, which provides details about the before delete action in the tree grid.
Examples
This example shows how to handle the RowDeleting event:
<SfTreeGrid DataSource="@TreeData" Toolbar="@(new List<string>() { "Delete" })">
<TreeGridEditSettings AllowDeleting="true" Mode="Syncfusion.Blazor.TreeGrid.EditMode.Row" />
<TreeGridEvents TValue="BusinessObject" RowDeleting="RowDeletingHandler"></TreeGridEvents>
........
</SfTreeGrid>
@code{
public async Task RowDeletingHandler(RowDeletingEventArgs<BusinessObject> args)
{
if(args.Data.TaskID == 2) // To cancel the delete action for a specific record.
{
args.Cancel = true;
}
}
RowDeselected
An event that is raised after a selected row is deselected.
Declaration
public EventCallback<RowDeselectEventArgs<TValue>> RowDeselected { get; set; }
Property Value
Type | Description |
---|---|
Microsoft.AspNetCore.Components.EventCallback<RowDeselectEventArgs<TValue>> | An event callback function. |
Remarks
This event handler receives a RowDeselectEventArgs<T> object which provides the details of deselected row.
Examples
<SfTreeGrid>
<TreeGridEvents RowDeselected="RowDeselectedHandler" TValue="BusinessObject"></TreeGridEvents>
</SfTreeGrid>
@code {
public void RowDeselectedHandler(RowDeselectEventArgs<BusinessObject> args)
{
}
}
RowDeselecting
An event that is raised when deselecting the selected row.
Declaration
public EventCallback<RowDeselectEventArgs<TValue>> RowDeselecting { get; set; }
Property Value
Type | Description |
---|---|
Microsoft.AspNetCore.Components.EventCallback<RowDeselectEventArgs<TValue>> | An event callback function. |
Remarks
This event handler receives a RowDeselectEventArgs<T> object which provides the details of the row to be deselected.
Examples
<SfTreeGrid>
<TreeGridEvents RowDeselecting="RowDeselectingHandler" TValue="BusinessObject"></TreeGridEvents>
</SfTreeGrid>
@code {
public void RowDeselectingHandler(RowDeselectEventArgs<BusinessObject> args)
{
}
}
RowDragStarting
Gets or sets the event callback that is raised when we start dragging the rows to perform reorder.
Declaration
public EventCallback<RowDragStartingEventArgs<TValue>> RowDragStarting { get; set; }
Property Value
Type | Description |
---|---|
Microsoft.AspNetCore.Components.EventCallback<RowDragStartingEventArgs<TValue>> | An event callback function. |
Remarks
This event handler receives a RowDragStartingEventArgs<T> object which provides the details of the rows from which it is dragged.
Examples
<SfTreeGrid DataSource="@Orders">
<TreeGridEvents TValue="Orders" RowDragStaringt="RowDragStartingHandler"></TreeGridEvents>
........
</SfTreeGrid>
@code{
public async Task RowDragStartingHandler(RowDragStartingEventArgs<Orders> args)
{
//you can get the dragged row data's here
List<Orders> Data = args.Data;
}
RowDropped
Gets or sets the event callback that is raised when row elements are dropped on the target element.
Declaration
public EventCallback<RowDroppedEventArgs<TValue>> RowDropped { get; set; }
Property Value
Type | Description |
---|---|
Microsoft.AspNetCore.Components.EventCallback<RowDroppedEventArgs<TValue>> | An event callback function. |
Remarks
This event handler receives a RowDroppedEventArgs<T> object which provides the details of the rows which are dropped and the target where the rows are dropped.
Examples
<SfTreeGrid DataSource="@TreeData" @ref="TreeGrid">
<TreeGridEvents TValue="BusinessObject" RowDropped="RowDroppedHandler"></TreeGridEvents>
........
</SfTreeGrid>
@code{
public async Task RowDroppedHandler(RowDroppedEventArgs<BusinessObject> args)
{
//you can get the dropped row data's here
List<BusinessObject> Data = args.Data;
}
RowDropping
Gets or sets the event callback that is raised when the row elements are dropping on the target element. You can cancel the dropping action using this event.
Declaration
public EventCallback<RowDroppingEventArgs<TValue>> RowDropping { get; set; }
Property Value
Type | Description |
---|---|
Microsoft.AspNetCore.Components.EventCallback<RowDroppingEventArgs<TValue>> | An event callback function. |
Remarks
This event handler receives a RowDroppingEventArgs<T> object which provides the details of the rows which are dropping and the target where the rows are dropping.
If the dropping action is prevented using the Cancel
argument, then the RowDropped event doesn't trigger.
Examples
<SfTreeGrid DataSource="@TreeData" @ref="TreeGrid">
<TreeGridEvents TValue="BusinessObject" RowDropping="RowDroppingHandler"></TreeGridEvents>
........
</SfTreeGrid>
@code{
public async Task RowDroppingHandler(RowDroppingEventArgs<BusinessObject> args)
{
//you can cancel the dropping action here
args.Cancel = true;
}
RowEdited
Gets or sets the event callback that is raised after the edit action is performed in the tree grid.
Declaration
public EventCallback<RowEditedEventArgs<TValue>> RowEdited { get; set; }
Property Value
Type | Description |
---|---|
Microsoft.AspNetCore.Components.EventCallback<RowEditedEventArgs<TValue>> | An event call back function. |
Remarks
This event handler receives a RowEditedEventArgs<T> object, which provides details about the after edit action in the tree grid.
Examples
This example shows how to handle the RowEdited event:
<SfTreeGrid DataSource="@TreeData" Toolbar="@(new List<string>() { "Edit" })">
<TreeGridEditSettings AllowEditing="true" Mode="Syncfusion.Blazor.TreeGrid.EditMode.Row" />
<TreeGridEvents TValue="BusinessObject" RowEdited ="RowEditedHandler"></TreeGridEvents>
........
</SfTreeGrid>
@code{
public async Task RowEditedHandler(RowEditedEventArgs<<BusinessObject> args)
{
var editedData = args.Data; // Gets the data of the edited record.
}
RowEditing
Gets or sets the event callback that is raised before the edit action is performed in the tree grid.
Declaration
public EventCallback<RowEditingEventArgs<TValue>> RowEditing { get; set; }
Property Value
Type | Description |
---|---|
Microsoft.AspNetCore.Components.EventCallback<RowEditingEventArgs<TValue>> | An event call back function. |
Remarks
This event handler receives a RowEditingEventArgs<T> object, which provides details about the before edit action in the tree grid.
Examples
This example shows how to handle the RowEditing event:
<SfTreeGrid DataSource="@TreeData" Toolbar="@(new List<string>() { "Edit" })">
<TreeGridEditSettings AllowEditing="true" Mode="Syncfusion.Blazor.TreeGrid.EditMode.Row" />
<TreeGridEvents TValue="BusinessObject" RowEditing ="RowEditingHandler"></TreeGridEvents>
........
</SfTreeGrid>
@code{
public async Task RowEditingHandler(RowEditingEventArgs<BusinessObject> args)
{
args.Cancel = true ; // To cancel the editing action
}
RowSelected
An event that is raised after a tree grid row is selected.
Declaration
public EventCallback<RowSelectEventArgs<TValue>> RowSelected { get; set; }
Property Value
Type | Description |
---|---|
Microsoft.AspNetCore.Components.EventCallback<RowSelectEventArgs<TValue>> | An event callback function. |
Remarks
This event handler receives a RowSelectEventArgs<T> object which provides the details of selected row.
Examples
<SfTreeGrid>
<TreeGridEvents RowSelected="RowSelectedHandler" TValue="BusinessObject"></TreeGridEvents>
</SfTreeGrid>
@code {
public void RowSelectedHandler(RowSelectEventArgs<BusinessObject> args)
{
}
}
RowSelecting
An event that is raised before row selection occurs.
Declaration
public EventCallback<RowSelectingEventArgs<TValue>> RowSelecting { get; set; }
Property Value
Type | Description |
---|---|
Microsoft.AspNetCore.Components.EventCallback<RowSelectingEventArgs<TValue>> | An event callback function. |
Remarks
This event handler receives a RowSelectingEventArgs<T> object which provides the details of the row to be selected. Row selection action can be cancelled using Cancel argument property.
Examples
<SfTreeGrid>
<TreeGridEvents RowSelecting="RowSelectingHandler" TValue="BusinessObject"></TreeGridEvents>
</SfTreeGrid>
@code {
public void RowSelectingHandler(RowSelectingEventArgs<BusinessObject> args)
{
}
}
RowUpdated
Gets or sets the event callback that is raised after the save action is performed in the tree grid.
Declaration
public EventCallback<RowUpdatedEventArgs<TValue>> RowUpdated { get; set; }
Property Value
Type | Description |
---|---|
Microsoft.AspNetCore.Components.EventCallback<RowUpdatedEventArgs<TValue>> | An event call back function. |
Remarks
This event handler receives a RowUpdatedEventArgs<T> object, which provides details about the after save action in the tree grid.
Examples
This example shows how to handle the RowUpdated event:
<SfTreeGrid DataSource="@TreeData" Toolbar="@(new List<string>() { "Update" })">
<TreeGridEditSettings AllowEditing="true" Mode="Syncfusion.Blazor.TreeGrid.EditMode.Row" />
<TreeGridEvents TValue="BusinessObject" RowUpdated="RowUpdatedHandler"></TreeGridEvents>
........
</SfTreeGrid>
@code{
public async Task RowUpdatedHandler (RowUpdatedEventArgs<BusinessObject> args)
{
var rowIndex = args.RowIndex; // Gets the row index of the saved record.
}
RowUpdating
Gets or sets the event callback that is raised before the save action is performed in the tree grid.
Declaration
public EventCallback<RowUpdatingEventArgs<TValue>> RowUpdating { get; set; }
Property Value
Type | Description |
---|---|
Microsoft.AspNetCore.Components.EventCallback<RowUpdatingEventArgs<TValue>> | An event call back function. |
Remarks
This event handler receives a RowUpdatingEventArgs<T> object, which provides details about the before save action in the tree grid.
Examples
This example shows how to handle the RowUpdating event:
<SfTreeGrid DataSource="@TreeData" Toolbar="@(new List<string>() { "Update" })">
<TreeGridEditSettings AllowEditing="true" Mode="Syncfusion.Blazor.TreeGrid.EditMode.Row" />
<TreeGridEvents TValue="BusinessObject" RowUpdating="RowUpdatingHandler"></TreeGridEvents>
........
</SfTreeGrid>
@code{
public async Task RowUpdatingHandler (RowUpdatingEventArgs<BusinessObject> args)
{
args.Cancel = true; // To cancel the save action.
}
Searched
Gets or sets the event callback that is raised after the search action is performed in the tree grid.
Declaration
public EventCallback<SearchedEventArgs> Searched { get; set; }
Property Value
Type | Description |
---|---|
Microsoft.AspNetCore.Components.EventCallback<SearchedEventArgs> | An event call back function. |
Remarks
This event handler receives a SearchedEventArgs object, which provides details about the after-search action in the tree grid.
Examples
This example shows how to handle the Searched event:
<SfTreeGrid DataSource="@TreeData" @ref="TreeGrid">
<TreeGridEvents TValue="BusinessObject" Searched="SearchedHandler"></TreeGridEvents>
........
</SfTreeGrid>
@code{
public async Task SearchedHandler (SearchedEventArgs args)
{
var searchResult = args.SearchString; // Gets the search result.
}
Searching
Gets or sets the event callback that is raised before the search action is performed in the tree grid.
Declaration
public EventCallback<SearchingEventArgs> Searching { get; set; }
Property Value
Type | Description |
---|---|
Microsoft.AspNetCore.Components.EventCallback<SearchingEventArgs> | An event call back function. |
Remarks
This event handler receives a SearchingEventArgs object, which provides details about the search begin action in the tree grid.
Examples
This example shows how to handle the Searching event:
<SfTreeGrid DataSource="@TreeData" @ref="TreeGrid" >
<TreeGridEvents TValue="BusinessObject" Searching ="SearchingHandler"></TreeGridEvents>
........
</SfTreeGrid>
@code {
public async Task SearchingHandler (SearchingEventArgs args)
{
args.Cancel = true; // To cancel the search begin action.
}
Sorted
Gets or sets the event callback that is raised after sorting action is performed in the tree grid.
Declaration
public EventCallback<SortedEventArgs> Sorted { get; set; }
Property Value
Type | Description |
---|---|
Microsoft.AspNetCore.Components.EventCallback<SortedEventArgs> | An event call back function. |
Remarks
This event handler receives a SortedEventArgs object, which provides details about the after sorting action in the tree grid.
Examples
This example shows how to handle the Sorted event:
<SfTreeGrid DataSource="@TreeData" @ref="TreeGrid" AllowSorting="true">
<TreeGridEvents TValue="BusinessObject" Sorted="SortedHandler"></TreeGridEvents>
........
</SfTreeGrid>
@code{
public async Task SortedHandler(SortedEventArgs args)
{
var direction = args.Direction; // Gets the current sorting direction.
}
Sorting
Gets or sets the event callback that is raised before sorting action is performed in the tree grid.
Declaration
public EventCallback<SortingEventArgs> Sorting { get; set; }
Property Value
Type | Description |
---|---|
Microsoft.AspNetCore.Components.EventCallback<SortingEventArgs> | An event call back function. |
Remarks
This event handler receives a SortingEventArgs object, which provides details about the before sorting action in the tree grid.
Examples
This example shows how to handle the Sorting event:
<SfTreeGrid DataSource="@TreeData" @ref="TreeGrid" AllowSorting="true">
<TreeGridEvents TValue="BusinessObject" Sorting="SortingHandler"></TreeGridEvents>
........
</SfTreeGrid>
@code{
public async Task SortingHandler(SortingEventArgs args)
{
args.Cancel = true; // To cancel the sorting action.
}
Methods
OnInitializedAsync()
Method invoked when the component is ready to start, having received its initial parameters from its parent in the render tree. Override this method if you will perform an asynchronous operation and want the component to refresh when that operation is completed.
Declaration
protected override Task OnInitializedAsync()
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task | A System.Threading.Tasks.Task representing any asynchronous operation. |