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

Row selection not working

Hi,

I am experiencing strange behaviour whenever I click on a row.  The two last rows selected always remain selected. For instance, If I click on row 1 then 2, both rows are selected.  If I then click on row 4, then rows 2 and 4 will be selected.  Also, at some point, it gets really messy and all rows are selected whenever I click on a row.

This only happen when I use remote data, using SfDataManager.  If I hardcode the data in the code then it works ok. I am using entity framework to source a treegrid control on a WASM app. I tried to configure the GridEditSettings but no luck.

I even tried using a component created using Syncfusion scaffolding mechanism (treegrid control), without even changing a bit of the code.

The page
<SfTreeGrid Id="TreeGrid" @ref="Treegrid" TValue="TreeNode" AllowRowDragAndDrop="true" AllowSorting="false" TreeColumnIndex="1" IdMapping="Id" ParentIdMapping="ParentId" Toolbar="@(new List<string>() { "Add","Edit", "Update", "Cancel"})" HasChildMapping="IsParent">
    <SfDataManager Url="/api/NodeEntity" Adaptor="Adaptors.WebApiAdaptor"></SfDataManager>
        <GridEditSettings AllowAdding="false" AllowDeleting="false" AllowEditing="true"></GridEditSettings>
    <TreeGridColumns>
        <TreeGridColumn Field="Id" HeaderText="Id" IsPrimaryKey="true" Width="10" Visible="false"></TreeGridColumn>
        <TreeGridColumn Field="SortOrder" HeaderText="Order" Width="100" Visible="false"></TreeGridColumn>
        <TreeGridColumn Field="Name" HeaderText="Name" Width="100"></TreeGridColumn>
    </TreeGridColumns>
</SfTreeGrid>

The model
public class TreeNode
    {
        public int Id { get; set; }
        public string Name { get; set; }
        public int? ParentId { get; set; }
        public int SortOrder { get; set; }
        public int TreeId { get; set; }
        public bool IsParent { get; set; }
    }

The controller
Is the one created by syncfusion scaffolding process

Am I doing something wrong?

Martin.

4 Replies 1 reply marked as answer

FS Farveen Sulthana Thameeztheen Basha Syncfusion Team December 28, 2020 05:17 PM UTC

Hi Martin, 

Thanks for contacting Syncfusion Support. 

Query#:- Row selection not working. This only happen when I use remote data, using SfDataManager. 
 
We have prepared sample with WebAPI Adaptor but we are unable to reproduce any problem at our end(Row Selection works fine). Refer to the sample Link:- https://www.syncfusion.com/downloads/support/forum/160964/ze/blazor_sample-169321166.zip 
 
 
We need some more additional details to find the cause of the issue. Share us the following details. 
 
  1. Share us the Video Demo to replicate the issue.
  2. Syncfusion NuGet package version details.
  3. If possible replicate the issue in the above sample and revert us back.
 
Regards, 
Farveen sulthana T 



MA Martin Ares December 28, 2020 09:21 PM UTC

Hi,

LAST MINUTE EDIT: Found how to fix the issue. You need to have AllowPaging="true" in the grid otherwise is doesn't work properly.  Even with the sample you provided, you can either remove this attribute or set it to false and the selection no longer work.  ***please indicate how to work without paging ***

The provided sample works fine.  I created a video so you can better understand.

First part of the video shows your sample.

From your sample, I added my model and connection to SQL Server local. I added a scaffolded item (treegrid) using the syncfusion template (add / new scaffolded item / Syncfusion Blazor scaffolder) linked to my remote data from local SQL server (via entity framework). This one is not working properly. - This is the TREE GRID  in the video

Last part of the video shows there are no errors in Chrome.

I am using the Syncfusion.Blazor.TreeGrid 18.4.0.31 package, as provided in the sample by you. Only modificaitons to your sample were:

- Adding entity framework (Model, connections string...);
- Created a new treegrid page (using Syncfusion scaffolded template)
- Modified the navmenu to include the page.


My model:
public partial class Node
    {
        [Key]
        public int Id { get; set; }
        [Required]
        [StringLength(255)]
        public string Name { get; set; }
        public int? ParentId { get; set; }
        public int SortOrder { get; set; }
        public int? PackageId { get; set; }
        public bool IsParent { get; set; }
        public DateTime? CreatedAt { get; set; }
        [StringLength(255)]
        public string CreatedBy { get; set; }
        public DateTime? UpdatedAt { get; set; }
        [StringLength(255)]
        public string UpdatedBy { get; set; }
    }

The grid (auto generated)
        
   
 
 
 
 
 
 
 
 
 
 
 

   

The video is attached.

Thanks for your help!



Attachment: DemoRowSelection_ca792e.zip


FS Farveen Sulthana Thameeztheen Basha Syncfusion Team December 29, 2020 03:55 PM UTC

Hi Martin, 

We are able to replicate the problem from your provided details. Further validating, we have confirmed this issue as bug “RowSelection not working properly while using RemoteData with Paging disabled” and logged the defect report for the same. 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 at 2nd week patch release of January 2021. 

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.      

Regards, 
Farveen sulthana T 



FS Farveen Sulthana Thameeztheen Basha Syncfusion Team January 12, 2021 03:59 PM UTC

Hi Martin, 
 
We appreciate your patience. 
  
We are glad to announce that fix for the issue “RowSelection not working properly while using RemoteData with Paging disabledhas been rolled out in our weekly NuGet packages release. We request you to update to our latest version " 18.4.0.34". 
 
 
Kindly get back to us for further assistance. 
 
Regards, 
Farveen sulthana T 


Marked as answer
Loader.
Up arrow icon