I am looking for an extension to the Grid Columns fluent api that adds .Exportable(true or false). Exportable(true) would be the default and indicate that this column does get exported when exporting to Excel (or PDF). Exportable(false) would indicate that the column does NOT get exported.
Imagine the following Grid Definition:
@(Html.Kendo().Grid<Services>
()
.Name("gridMain")
.Columns(columns =>
{
columns.Bound(p => p.ServiceId).ClientTemplateId("rowNumTemplate").Title("Row").Width(50);
//columns.Bound(p => p.ServiceId).ClientTemplateId("cmdsTemplate").Title("Cmds").Width(125).Media("(min-width: 768px)");
columns.Bound(p => p.ServiceCode).Media("(min-width: 768px)");
columns.Bound(p => p.ServiceId).ClientTemplateId("xsTemplate").Title("Service / Desc / Code").Media("(max-width: 768px)");
columns.Bound(p => p.ServiceId).ClientTemplateId("serviceTemplate").Title("Service / Desc").Media("(max-width: 992px) and (min-width: 768px)");
columns.Bound(p => p.ServiceName).Media("(min-width: 992px)");
columns.Bound(p => p.ServiceDescription).Media("(min-width: 992px)");
columns.Bound(p => p.ServiceActive).ClientTemplateId("activeTemplate").Width(60).Media("(min-width: 768px)");
columns.Bound(p => p.ServiceId).ClientTemplateId("btnsTemplate").Title("View/Edit/Del").Width(150);
//columns.Bound(p => p.ServiceId).ClientTemplateId("xsCmdsTemplate").Title("Cmds").Media("(max-width: 768px)");
})
.Scrollable(scrollable => scrollable.Endless(true))
.Pageable(p => p.Numeric(false).PreviousNext(false))
.ToolBar(t => t.Search())
.Search(s => { s.Field(c => c.ServiceCode); s.Field(c => c.ServiceName); s.Field(c => c.ServiceDescription); })
.Resizable(resize => resize.Columns(true))
.ToolBar(t => t.Excel().Text("Excel"))
.Excel(excel => excel
.FileName("ABT_Services.xlsx")
.Filterable(true)
)
.DataSource(dataSource =>
dataSource
.WebApi()
.PageSize(Model.GridPageSize)
.Model(model =>
{
model.Id(p => p.ServiceId);
})
.Events(events => events.Error("errorHandler").RequestEnd("gridMainRequestEnd"))
.Read(read => read.Action("Get", "Services"))
)
)
What I would like to do is define a column like the following:
columns.Bound(p => p.ServiceId).ClientTemplateId("rowNumTemplate").Title("Row").Width(50).Exportable(false);
In the case above, the "Row" column would not be Exported to Excel.
If you take a closer look at the Columns definition above you will see that the configuration is implemented to support responsive page sizing. Because the current implementation of Export to Excel does not allow an Exportable(true/false), I get these columns that I don't want in the exported Excel.
Although there appear to be workarounds (like keeping a second hidden grid -- a poor solution at best), none would be as useful to a Developer as defining an Exportable(true/false) as part of the Column configuration.
Thanks for considering my request.
It would be great if the scaffolder can use an existing model (one that I created before starting the scaffolder). I also would like to have the option to select a namespace:
Need support for DataTable in Grid in ASP.NET Core 2.0
Using .Net Core 3.0
ToDataSourceResult raises an exception if the DataSourceRequest has Aggregates
the exception says that there is no constructor with the following signature:
Void Microsoft.CodeAnalysis.CSharp.CSharpCompilationOptions(
Microsoft.CodeAnalysis.OutputKind,
Boolean,
String,
String,
String,
Collections.Generic.IEnumerable`1<String>,
Microsoft.CodeAnalysis.OptimizationLevel,
Boolean,
Boolean,
String,
String,
Collections.Immutable.ImmutableArray`1<Byte>,
Nullable`1<Boolean>,
Microsoft.CodeAnalysis.Platform,
Microsoft.CodeAnalysis.ReportDiagnostic,
Int32,
IEnumerable<KeyValuePair<String,Microsoft.CodeAnalysis.ReportDiagnostic>>,
Boolean,
Boolean,
Microsoft.CodeAnalysis.XmlReferenceResolver,
Microsoft.CodeAnalysis.SourceReferenceResolver,
Microsoft.CodeAnalysis.MetadataReferenceResolver,
Microsoft.CodeAnalysis.AssemblyIdentityComparer,
Microsoft.CodeAnalysis.StrongNameProvider,
Boolean,
Microsoft.CodeAnalysis.MetadataImportOptions,
Microsoft.CodeAnalysis.CSharp.NullableContextOptions
)
I traced the error down to the method that causes it :
CSharpCompilation CreateCompilation(SyntaxTree syntaxTree)
kendo.aspnetmvc.js does not account for server aggregates serialized with came case property names like it does for Groups.
Can the following code (minus the comments) be included in a future release to resolve this?
function translateAggregateResults(aggregate) {
var obj = {};
// LSS: support for camel case serialization
obj[(aggregate.AggregateMethodName || aggregate.aggregateMethodName).toLowerCase()] = (aggregate.Value || aggregate.value);
return obj;
}
function translateAggregate(aggregates) {
var functionResult = {}, key, functionName, aggregate;
for (key in aggregates) {
functionResult = {};
aggregate = aggregates[key];
for (functionName in aggregate) {
functionResult[functionName.toLowerCase()] = aggregate[functionName];
}
aggregates[key] = functionResult;
}
return aggregates;
}
function convertAggregates(aggregates) {
var idx, length, aggregate;
var result = {};
for (idx = 0, length = aggregates.length; idx < length; idx++) {
aggregate = aggregates[idx];
// LSS: support for camel case serialization
result[(aggregate.Member || aggregate.member)] = extend(true, result[(aggregate.Member || aggregate.member)], translateAggregateResults(aggregate));
}
return result;
}
extend(true, kendo.data, {
schemas: {
'aspnetmvc-ajax': {
groups: function (data) {
return $.map(this._dataAccessFunction(data), translateGroup);
},
aggregates: function (data) {
data = data.d || data;
// LSS: support for camel case serialization
var aggregates = data.AggregateResults || data.aggregateResults || [];
if (!$.isArray(aggregates)) {
for (var key in aggregates) {
aggregates[key] = convertAggregates(aggregates[key]);
}
return aggregates;
}
return convertAggregates(aggregates);
}
}
}
});
Currently the components accept only ClientTemplates. From an ASP.NET perspective it is more convenient to store the templates in ~Views\Shared\DisplayTemplates folder.
Please provide a new method TemplateView("ViewName") that will look for the partial in the folders much like we have it for the EditorTemlates.
Hi Telerik Team
Wil younot implement the LightBox also as a a asp.net core component ?
We think it will be usefull. of course we could also implement in window component but its not the same
Telerik Web UI LightBox Overview Demo | Telerik UI for ASP.NET AJAX
Best regards
Murat Zürich
### Bug report
When Microsoft.AspNetCore.Mvc.Razor.RuntimeCompilation NuGet package is installed in Telerik UI for ASP.NET Core application, it throws an exception:
FileNotFoundException: Could not load file or assembly 'Microsoft.DotNet.InternalAbstractions, Version=1.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60'. The system cannot find the file specified.
### Reproduction of the problem
1. Create Telerik UI for ASP.NET Core MVC application (.NET Core version 6.0).
2. Install Microsoft.AspNetCore.Mvc.Razor.RuntimeCompilation NuGet package (version 6.0.5).
3. Turn on the Razor Runtime Compilation:
//Program.cs file
// Add services to the container.
builder.Services.AddControllersWithViews()
.AddNewtonsoftJson(options => options.SerializerSettings.ContractResolver = new Newtonsoft.Json.Serialization.DefaultContractResolver())
.AddRazorRuntimeCompilation();
4. Run the application and review the exception.
Attached is a runnable sample for reproduction.
### Workaround
Install Microsoft.DotNet.InternalAbstractions NuGet package (version: 1.0.0)
### Environment
* **Kendo UI version: 2022.2.510
* **jQuery version: 1.12.4
* **Browser: [all]
Hello,
I am working with application where I have thousands of images to load on ImageBrowser of Kendo Editor.
ImageBrowser is getting stuck as having too many images to load, Can we have any option to add pagination or lazy loading in ImageBrowser?
So, I can load only 20 images at a time and other based on request.
Thanks,
Trusha
### Bug report
When the Dialog is configured with actions and the Content Security Policy is enabled, it throws an "Invalid template" error.
### Reproduction of the problem
1) Configure a Dialog widget with actions and set the CSP with the following content:
<meta http-equiv="Content-Security-Policy" content="script-src 'self' 'unsafe-inline' https://kendo.cdn.telerik.com https://code.jquery.com; style-src 'self' 'unsafe-inline' https://kendo.cdn.telerik.com;" />
2) Open the browser console to review the error.
A Dojo sample for reproduction: https://dojo.telerik.com/ULOyazUC
### Expected/desired behavior
The Dialog should be rendered correctly without using the 'unsafe-eval' keyword in the "script-src" directive.
### Workaround
Insert the following script before the Dialog initialization:
<script>
kendo.ui.Dialog.fn._mergeTextWithOptions = function(action) { var text = action.text; if(text) { return kendo.isFunction(text) ? text(this.options) : text; } return ""; }
</script>
### Environment
* **Kendo UI version: 2023.2.606
* **jQuery version: 3.4.1
* **Browser: [all]
When both UI for ASP.NET MVC and UI for ASP.NET Core Visual Studio extensions are installed and only UI for ASP.NET Core project is loaded, the notification for new version is shown for UI for ASP.NET MVC.
At this stage, the Serialize() method depends on Newtonsoft.Json:
using Newtonsoft.Json;
namespace Kendo.Mvc.Infrastructure
{
public class DefaultJavaScriptSerializer : IJavaScriptSerializer
{
public string Serialize(object value)
{
return JsonConvert.SerializeObject(value).Replace(@"<", @"\u003c").Replace(@">", @"\u003e");
}
}
}
Is it possible to remove the dependency and use the System.Text.Json serializer instead?
### Bug report
When building the scripts through the 'npx gulp scripts' command, there is an error "Error: Cannot find module './build/gulp/kendo-version'".
### Reproduction of the problem
Download any of the source bundles (Core, MVC, jQuery) and try to build the scripts.
### Environment
* **Kendo UI version: 2024.4.1112
Allow HTML comments & other tags to be mixed inside kendo tags; eg. I would like to use a <asp-partial name="_template" required=false asp-if="@User.IsInRole("role")> to inject settings/configuration of the kendo component