My customer has an obnoxiously wide grid (~200 columns) which introduces the need to allow them to pick a Grid Column Title from a droplist (of all column titles) so that we can auto scroll the select grid into view. I have tried to follow several other examples like this
https://docs.telerik.com/kendo-ui/knowledge-base/grid-scroll-to-last-column
but the offset() and .let seem to now work for core.
This is the closest that I have found but I cannot get it to work, either
Thanks!
Sample Code
<button onclick="jumpToColumn();">Jump</button>
<input type="text" id="jumpToColumnName" name="jumpToColumnName">
<br>
<br>
@(Html.Kendo().Grid<OrderViewModel>
().Name("grid")
.Groupable()
.Sortable()
.Editable()
.Scrollable()
.ToolBar(x => x.Create())
.Columns(columns =>
{
columns.Bound(column => column.Freight);
columns.Bound(column => column.ShipName);
columns.Bound(column => column.ShipCity);
columns.Template("1").Title("Sh1").Width(200);
columns.Template("2").Title("Sh2").Width(200);
columns.Template("3").Title("Sh3").Width(200);
columns.Template("4").Title("Sh4").Width(200);
columns.Template("5").Title("Sh5").Width(200);
columns.Template("6").Title("Sh6").Width(200);
columns.Template("7").Title("Sh7").Width(200);
columns.Template("8").Title("Sh8").Width(200);
columns.Template("9").Title("Sh9").Width(200);
columns.Template("10").Title("Sh10").Width(200);
columns.Template("11").Title("Sh11").Width(200);
columns.Template("12").Title("Sh12").Width(200);
columns.Template("13").Title("Sh13").Width(200);
columns.Template("14").Title("Sh14").Width(200);
columns.Template("15").Title("Sh15").Width(200);
columns.Template("16").Title("Sh16").Width(200);
columns.Template("17").Title("Sh17").Width(200);
columns.Template("18").Title("Sh18").Width(200);
columns.Template("19").Title("Sh19").Width(200);
columns.Template("20").Title("Sh20").Width(200);
columns.Template("21").Title("Sh21").Width(200);
columns.Template("22").Title("Sh22").Width(200);
columns.Template("23").Title("Sh23").Width(200);
columns.Command(column =>
{
column.Edit();
column.Destroy();
}).Width(230);
})
.DataSource(ds => ds.Ajax()
.Read(r => r.Url("/Index?handler=Read").Data("forgeryToken"))
.Update(u => u.Url("/Index?handler=Update").Data("forgeryToken"))
.Create(c => c.Url("/Index?handler=Create").Data("forgeryToken"))
.Destroy(d => d.Url("/Index?handler=Destroy").Data("forgeryToken"))
.Model(m => m.Id(id => id.OrderID))
.PageSize(10)
)
.Pageable()
.Selectable()
)
<script type="text/javascript">
function jumpToColumn() {
let columnTitle = 'sh11'; //$("#jumpToColumnName").val();
var grid = $("#grid").data().kendoGrid;
let headerColumnTitleSelector = "th[data-field='" + columnTitle + "']"; //"th[data-title='" + columnTitle + "']";
let column = $(headerColumnTitleSelector);
let columnOffset = column.offset(); // returns undefined
let lastColumnOffset = columnOffset.left; // exception because of the previous line
// This scrolls the scrollbar but does NOT scroll the content
grid.content.scrollLeft(lastColumnOffset);
}
</script>
Good evening,
I'm trying the DockManager in 2023.3.1114 and I'm unable to find a way to specify a client template. I noticed there's a ContentTemplate but I couldn't find a way to specify a client template id.
Hoping for something similar to TileLayout's BodyTemplateId.
Regards,
Heath
Hi,
I tried to set up a DataSource and a Filter Control like in the demo (https://demos.telerik.com/aspnet-core/filter) but i can not get the DataSource working.
I have the kendo v2023.3.1010 JS Files (kendo.all.min.js, kendo.aspnetmvc.min.js) and other controls like buttons, grids, etc all work as expected
My cshtml Page is
[PartialView/_SearchProvision.cshtml]
@using Kendo.Mvc;
@using Model;
@(
Html.Kendo().DataSource<SearchProvisionDto>()
.Name("DS_SearchProvision")
.Ajax(dataSource => dataSource
.Read("GetData", "SearchProvisionDto")
)
)
@(Html.Kendo().Filter<SearchProvisionDto>()
.Name("Filter_PCProvision")
.DataSource("DS_SearchProvision")
.MainLogic(FilterCompositionLogicalOperator.Or)
.ApplyButton()
.ExpressionPreview()
//Fields, FilterExpression
}
Loading the Page shows only, that the DataSource is not initialized
Am I missing something? I dont really understand where the problem might be.
Hi,
I need to create a custom editor to provide an upload field in my form component. I have seen posts and this documentation about creating custom editors with the HtmlHelper approach but can't find anything for the TagHelper approach.
Please can you point me in the right direction?
I have a brand new solution and a brand new subscription to the telerik library mvc and core
I am following all the documentation and samples but when I try to register the Kendo service, it is not recognized
Also the @html tag is not recognized either even after registering the taghelpers
Is this product not suppose to work with .net 6 or higher?
This line is not recognized
builder.Services.AddKendo();Pasting this code on a Razor page should help illustrate the problem:
<div id="strangeStore">
@(Html.Kendo().Menu()
.Name("Menu")
.Animation(animation => animation.Enable(false))
.Scrollable(true)
.OpenOnClick(click => click.RootMenuItems(true).SubMenuItems(true))
.Items(items =>
{
items.Add()
.Text("Products")
.Items(children =>
{
children.Add().Text("Furniture")
.Items(innerChildren =>
{
innerChildren.Add().Text("Tables")
.Items(iic =>
{
iic.Add().Text("Red");
iic.Add().Text("Green");
iic.Add().Text("Blue");
});
innerChildren.Add().Text("Chairs")
.Items(iic =>
{
iic.Add().Text("42");
iic.Add().Text("1337");
});
innerChildren.Add().Text("Sofas")
.Items(iic =>
{
iic.Add().Text("Soft");
iic.Add().Text("Hard");
});
innerChildren.Add().Text("Beds")
.Items(iic =>
{
iic.Add().Text("deadbeef");
iic.Add().Text("cafebabe");
});
});
children.Add().Text("Decor")
.Items(innerChildren =>
{
innerChildren.Add().Text("Curtains");
innerChildren.Add().Text("Blinds");
innerChildren.Add().Text("Rugs");
innerChildren.Add().Text("Carpets");
});
});
items.Add().Text("Events");
})
)
</div>
To see the problem, click in sequence: Products, Furniture, Tables, Decor
Expected result: Products and its Decor child menu is open
Actual result: the Tables child menu is also open
Changing to ".Scrollable(false)" seems to fix the problem, but makes it hard to use a multi-level menu with many items on small screens😅
Any other suggestions on how to fix this?
Hello everyone,
I'm encountering this issue when loading a page with the RadTimeline, the error is shown below:
"Error during serialization or deserialization using the JSON JavaScriptSerializer. The length of the string exceeds the value set on the maxJsonLength property."
This issue is occurring when this page is getting back a lot of entitles for the timeline, the MaxJsonLength is set in web.config but it seems this only applies to Web Services.
Unsure how to set this in the code as it looks like the serialization happens in the RadDataBoundControl if I'm not mistaken.
Any ideas how to to implement this MaxJsonLength in code?
Thanks for any help!
Hello everyone,
First of all, we did not renew our telerik license and we are using the latest possible telerik version we can get for a long time.
Last week our devops publish failed because of dotnet tools download failure. We had detailed look on the fail and found out that telerik nuget feed causing the error. We literally changed nothing about versions in the code but still we get the error nonetheless. Even the latest successfull published commit is giving the same error. Publish from VS is also giving the same error and Nuget solution with telerik package source in VS still works fine with our telerik credentials.
What is the reason for that, can anyone help us?
Thanks.
When I try to add a label to a DropDownList, it gives me a syntax error as if the property doesn't exist. Thoughts?
CS1929
'DropDownListBuilder' does not contain a definition for 'Label' and the best extension method overload 'HtmlHelperLabelExtensions.Label(IHtmlHelper, string)' requires a receiver of type 'Microsoft.AspNetCore.Mvc.Rendering.IHtmlHelper'
@(Html.Kendo().DropDownList() .Name("PrimaryAnalystId") .Label(label => label.Content("Primary Analyst")) .OptionLabel("[Select a person]") .DataTextField("Person") .DataValueField("PersonId") .DataSource(s => s.Read(r => r.Action("GetPeople", "Utility", new { type = "analyst" }))) .HtmlAttributes(new { required = "required", validationmessage = "Primary analyst is required." }))
I have a multiselect whose items cascade from the the selected value of a drop down list.
When the page is loaded, the drop down list selection defaults to the first item in the list, which results in two items in the multiselect and the multiselect popup height shows the two items.
If a different drop down list option is selected, there are 15 items in the multiselect but the popup height still shows two items at a time. The scroll buttons work, but I would like to increase the height so that more options are visible. I have tried setting the height of the multiselect, but it has no effect.
Is there a way to resize the popup height when the items in the multiselect changes or to specify a minimum height of say 4 lines?
Thank you