If you enter a search with the treegrid, which returns data and then clear the search using either the x or just deleting the search term and search again then no results are returned. Looks like the search code is not ignoring an empty search. See code and attached video
<SfTreeGrid DataSource=@NetworkAssetModelList IdMapping=@nameof(NetworkAssetModel.RowId) ParentIdMapping=@nameof(NetworkAssetModel.ParentRowId) TreeColumnIndex="1" AllowPaging="true" AllowSorting="true" AllowResizing="true" AllowTextWrap="true" Toolbar=@(new List<string>() { "Search" })>
<TreeGridPageSettings PageSizeMode="PageSizeMode.Root" PageSize="10"></TreeGridPageSettings>
<TreeGridColumns>
<TreeGridColumn Field=@nameof(NetworkAssetModel.AssetId) HeaderText=" ID" Width="5%" TextAlign="Syncfusion.Blazor.Grids.TextAlign.Left">
<Template>
@{
NetworkAssetModel NetworkAssetModelObj = (context as NetworkAssetModel);
if (NetworkAssetModelObj.IsParent == true)
{
<div><a rel='nofollow' href="#" @onclick=@(() => DisplayRiskFlowDiagram(NetworkAssetModelObj)) @onclick:preventDefault>@($"ToE.{NetworkAssetModelObj.AssetId}")</a></div>
}
}
</Template>
</TreeGridColumn>
<TreeGridColumn Field=@nameof(NetworkAssetModel.Name) HeaderText=@Glossary_Asset Width="25%"></TreeGridColumn>
<TreeGridColumn Field=@nameof(NetworkAssetModel.ConfidentialityFlow) HeaderText=@TString.value("Confidentiality") Width="15%"></TreeGridColumn>
<TreeGridColumn Field=@nameof(NetworkAssetModel.IntegrityFlow) HeaderText=@TString.value("Integrity") Width="15%"></TreeGridColumn>
<TreeGridColumn Field=@nameof(NetworkAssetModel.AvailabilityFlow) HeaderText=@TString.value("Availability") Width="15%"></TreeGridColumn>
<TreeGridColumn Field=@nameof(NetworkAssetModel.ComplianceFlow) HeaderText=@TString.value("Compliance") Width="15%"></TreeGridColumn>
<TreeGridColumn Field=@nameof(NetworkAssetModel.ConsumerReleationCount) HeaderText=@TString.value("Number of flows") Width="10%"></TreeGridColumn>
</TreeGridColumns>
</SfTreeGrid>
public class NetworkAssetModel : ModelBase
{
public int RowId { get; set; }
public int AssetId { get; set; }
public bool IsParent { get; set; }
public int? ParentRowId { get; set; }
public string Name { get; set; }
public int ConfidentialityFlow { get; set; }
public int IntegrityFlow { get; set; }
public int AvailabilityFlow { get; set; }
public int ComplianceFlow { get; set; }
public int? ConsumerReleationCount { get; set; }
public override string ToString() => $"{this.Name}";
}
Hi Michael Aston,
We have prepared sample from using provided code example but we are not able to replicate the problem(searched results not clear) at our end. Refer to the sample link:-
Sample link:- https://www.syncfusion.com/downloads/support/directtrac/general/ze/Test_(6)1546494430.zip
Video Demo:- https://www.syncfusion.com/downloads/support/directtrac/general/ze/video-53326486.zip
We need some more additional details to find the cause of the issue. Share us the following details.
The requested details will be more helpful to provide you solution as early as possible.
Regards.
Farveen sulthana T