I am not able to mark checkboxes in a Treegrid using SelectCheckboxes or SelectRows

Hi, currently I'm having problems with the TreeGrid trying to mark checkboxes using SelectCheckboxes or SelectRows, the checkboxes have a hierarchy, I need the checkboxes to be marked based on a condition, I attached a project with the code that I'm using, anyways I'm also adding the code here

@page "/"

@using Syncfusion.Blazor.TreeGrid;

<SfTreeGrid @ref="@TreeGrid" DataSource="@BusinessObjectCollection" IdMapping="TaskId" AllowSelection="true" ParentIdMapping="ParentId" TreeColumnIndex="0" AutoCheckHierarchy>
    <TreeGridColumns>
        <TreeGridColumn ShowCheckbox Width="80">TreeGridColumn>
        <TreeGridColumn Field="TaskId" HeaderText="Task ID" Width="80" TextAlign="Syncfusion.Blazor.Grids.TextAlign.Right">TreeGridColumn>
        <TreeGridColumn Field="TaskName" HeaderText="Task Name" Width="160">TreeGridColumn>
        <TreeGridColumn Field="Duration" HeaderText="Duration" Width="100" TextAlign="Syncfusion.Blazor.Grids.TextAlign.Right">TreeGridColumn>
        <TreeGridColumn Field="Progress" HeaderText="Progress" Width="100" TextAlign="Syncfusion.Blazor.Grids.TextAlign.Right">TreeGridColumn>
        <TreeGridColumn Field="Priority" HeaderText="Priority" Width="80">TreeGridColumn>
    TreeGridColumns>
SfTreeGrid>

<button @onclick="@(async () => await SelectCheckBoxes())">Select SelectCheckBoxesbutton>
<button @onclick="@(async () => await SelectRows())">Select SelectRowsbutton>


@code{
    private SfTreeGrid<TreeDataTreeGrid;
    private List<doubleSelectIndex { getset; }

    List<TreeDataBusinessObjectCollection = new List<TreeData>();

    protected override void OnInitialized()
    {
        BusinessObjectCollection.Add(new TreeData() { TaskId = 1TaskName = "Parent Task 1"Duration = 10Progress = 70Priority = "Critical"ParentId = null });
        BusinessObjectCollection.Add(new TreeData() { TaskId = 2TaskName = "Child task 1"Duration = 6Progress = 80Priority = "Low"ParentId = 1 });
        BusinessObjectCollection.Add(new TreeData() { TaskId = 3TaskName = "Child Task 2"Duration = 5Progress = 65Priority = "Critical"ParentId = 2 });
        BusinessObjectCollection.Add(new TreeData() { TaskId = 4TaskName = "Child task 3"Duration = 6Priority = "High"Progress = 77ParentId = 3 });
        BusinessObjectCollection.Add(new TreeData() { TaskId = 5TaskName = "Parent Task 2"Duration = 10Progress = 70Priority = "Critical"ParentId = null });
        BusinessObjectCollection.Add(new TreeData() { TaskId = 6TaskName = "Child task 1"Duration = 4Progress = 80Priority = "Critical"ParentId = 5 });
        BusinessObjectCollection.Add(new TreeData() { TaskId = 7TaskName = "Child Task 2"Duration = 5Progress = 65Priority = "Low"ParentId = 5 });
        BusinessObjectCollection.Add(new TreeData() { TaskId = 8TaskName = "Child task 3"Duration = 6Progress = 77Priority = "High"ParentId = 5 });
        BusinessObjectCollection.Add(new TreeData() { TaskId = 9TaskName = "Child task 4"Duration = 6Progress = 77Priority = "Low"ParentId = 5 });
    }

    public async Task SelectCheckBoxes()
    {
        var Source = TreeGrid.DataSource;
        var IndexNum = 0;
        SelectIndex = new List<double>();
        foreach (var record in Source)
        {
            if (record.Progress > 70)
            {
                SelectIndex.Add(IndexNum);
            }
            IndexNum++;
        }
        await TreeGrid.SelectCheckboxes(SelectIndex.ToArray());
    }

    public async Task SelectRows()
    {
        var Source = TreeGrid.DataSource;
        var IndexNum = 0;
        SelectIndex = new List<double>();
        foreach (var record in Source)
        {
            if (record.Progress > 70)
            {
                SelectIndex.Add(IndexNum);
            }
            IndexNum++;
        }
        await TreeGrid.SelectRows(SelectIndex.ToArray());
    }

    public class TreeData
    {

        public int TaskId { getset; }
        public string TaskName { getset; }
        public intDuration { getset; }
        public intProgress { getset; }
        public string Priority { getset; }
        public intParentId { getset; }
    }
}


Attachment: Sample_e7e76b75.zip

3 Replies

PS Pon Selva Jeganathan Syncfusion Team February 3, 2021 09:17 AM UTC

Hi Daniel ,    
   
Thanks for contacting syncfusion forum.    

Query : not able to mark checkboxes in a Treegrid using SelectCheckboxes or SelectRows

 

We are able to replicate the problem at our end in your specified scenario(“The checkbox is not selected while using the method of selectcheckboxes) with that latest version. Further analyzing we have confirmed this issue “SelectCheckboxes method is not working properly ” as bug. Thank you for the taking the time to report the issue and helping us improve our product. At Syncfusion we are committed to fixing all the validated defect (subject to technological feasibility and Product Development Life Cycle) and including its fix in our subsequent release. The fix for the issue will be included in third week of February, 2021 patch release.   
   
You can track the current status of your request, review the resolution timeline and contact us for any further inquiries through this link.       
   
Note: To view the above feedback, kindly login into your account.       
    
Please get back to us if you need any further assistance.   
   
Regards,  
Pon selva   
  




DA Daniel February 3, 2021 02:51 PM UTC

Hi Pon,

Thanks for the response, I'll use the link provided to track the status

Thanks!


PS Pon Selva Jeganathan Syncfusion Team February 4, 2021 01:48 PM UTC

Hi Daniel,   
      
We will let you know once the patch release rolled out with the fix included. 
  
We appreciate your patience until then. 
  
Regards,  
Pon selva   


Loader.
Up arrow icon