GetSelectedRecords crashes

Hello, I am trying to use ExcelExport for records selected from SfGrid.

List<CombinedResultsHeader> selectedRecords = await DefaultGrid.GetSelectedRecords();
ExcelExportProperties ExportProperties = new ExcelExportProperties();
ExportProperties.DataSource = selectedRecords;
await DefaultGrid.ExcelExport(ExportProperties);

When  I select one or two rows, then everything goes OK. However when I select all records from current page (12) or sometimes even 6 of them, then the function GetSelectedRecords never returns. No exception is thrown, no ActionFailure, memory is not exhausted. Just everything stops working until the thread is killed.
I prepared a simplified project which shows this problem.

I thought even about getting the list of selected row-indexes and then get one record after another but I couldn't find a way to get a single record from the grid.

Could you please help me to make it working?
Best regards




Attachment: EFGridSelectionPcdrdata_A02_3e2ab906.rar

3 Replies

RS Renjith Singh Rajendran Syncfusion Team May 22, 2020 09:49 AM UTC

Hi Andrzej, 

Greetings from Syncfusion support. 

We have analyzed your sample, and we could see that you have large column data available for the rows in Grid. This error may occur when there is no enough space to allocate the data sent from server to JS Interop. In Blazor application, they (Microsoft) have limited the message size (32KB) which will be sent from server to JSInterop to increase the performance.  

So, we suggest you to resolve this issue by increase the message size using the below way. Please add the below highlighted code into your project’s Startup.cs file to overcome the problem you are facing. 

 
public void ConfigureServices(IServiceCollection services) 
{ 
    ... 
    services.AddSyncfusionBlazor(); 
    services.AddSingleton<ResultsHeaderDataAccessLayer>(); 
    services.AddSignalR(e => 
    { 
        e.MaximumReceiveMessageSize = 102400000; 
    }); 
} 
 
   
Refer to the below Github issue regarding the above solution  

Please get back to us if you need further assistance. 

Regards, 
Renjith Singh Rajendran 



AN Andrzej May 22, 2020 11:47 AM UTC

Thanks a lot - it helped.
However there is still a question if I can get record-data from certain row, or contents of certain row-column? It might be helpful in some cases. There is a function Task<DOM> GetRowByIndex, but I am not sure how to get the record-data from retrieved DOM-object.


RS Renjith Singh Rajendran Syncfusion Team May 25, 2020 09:44 AM UTC

Hi Andrzej, 

Thanks for your update. 

We suggest you to use the CurrentViewData property of Grid to achieve this requirement. Please use as like the below code, 

 
    <SfButton OnClick="GetRowData" Content="Get Data from row"></SfButton> 
 
    public void GetRowData() 
    { 
        var Viewdata = DefaultGrid.CurrentViewData.ElementAt(2);   //Based on row index 2 get the data in row 
    } 


Please get back to us if you need further assistance. 

Regards, 
Renjith Singh Rajendran 


Loader.
Up arrow icon