I work on asp.net core 7 blazor server side . I face Issue I can't export to excel column picking true
on my scenario I have radzen data grid have 15 columns i need only to picking 3 columns at runtime then export to excel .
my issue when export to excel after picking 3 columns it correct must be export 3 columns
but it make wrong it export all columns on ridzen data grid
so How to export ridzen data grid columns picking
so How to change my code to export only 3 column picking
private async Task ExportToExcel() { var visibleColumns = myDataGrid.ColumnsCollection.Where(c => c.Pickable==true); if (string.IsNullOrEmpty(myDataGrid.Query.Filter)) { ExceldatabaseData = databaseData.Select(p => new CopyExcelDatabaseClass { DBID = p.dbid, DBName = p.databaseName, ServerID = p.serverID, ServerName = p.serverName, Severity = p.serverity, BackupProcedure = p.backUpProcedure, Remarks = p.remarks, OwnerFileNo = p.ownerfilenumber, OwnerFileName = p.ownerfilename, IsActive = p.isActive }).ToList(); } else { var query = myDataGrid.Query.Filter; var filteredList = databaseData.AsQueryable().Where(query).ToList(); ExceldatabaseData = filteredList.Select(p => new CopyExcelDatabaseClass { DBID = p.dbid, DBName = p.databaseName, ServerID = p.serverID, ServerName = p.serverName, Severity = p.serverity, BackupProcedure = p.backUpProcedure, Remarks = p.remarks, OwnerFileNo = p.ownerfilenumber, OwnerFileName = p.ownerfilename, IsActive = p.isActive }).ToList(); } ExcelPackage.LicenseContext = LicenseContext.Commercial; var stream = new MemoryStream(); using (var package = new ExcelPackage(stream)) { var worksheet = package.Workbook.Worksheets.Add("DatabaseList"); worksheet.Cells.LoadFromCollection(ExceldatabaseData, true); package.Save(); } var buffer = stream.ToArray(); var fileName = $"Database_{DateTime.Now:yyyyMMddHHmmss}.xlsx"; await JS.InvokeAsync<object>("saveAsFile", fileName, Convert.ToBase64String(buffer)); }