We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

Treegrid search not returning results when clearing search

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}";

    }


Attachment: Screen_Recording_(04102022_124155)_cb2ff4b4.zip

1 Reply

FS Farveen Sulthana Thameeztheen Basha Syncfusion Team October 5, 2022 03:08 PM UTC

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.


  1. Type of data you have used(whether Local or Remote Data).
  2. Share us the dataSource structure that you have used.
  3. If possible replicate it in the above sample and revert us back.
  4. Syncfusion NuGet package version details.


The requested details will be more helpful to provide you solution as early as possible.


Regards.

Farveen sulthana T


Loader.
Live Chat Icon For mobile
Up arrow icon