Telerik Forums
UI for ASP.NET MVC Forum
2 answers
330 views
We need your feedback, because we are considering changes in the release approach for Telerik UI for ASP.NET MVC. Please provide your feedback in the comments section below:


1. Is it hard to understand the version numbers of our releases? If yes, what makes them hard to understand them?

2. Would semantic versioning (SemVer) of our releases make it easier to understand our version numbers and what's behind them?

3. If we go with SemVer, we might need to start with version 3000.0.0 as we currently use 2022.x.x. Please share your thoughts about this approach and ideas for what number versioning would work best for you.

Anders
Top achievements
Rank 1
Iron
Veteran
Iron
 answered on 10 Aug 2023
1 answer
8 views

Hi,

After update from 2023.3.718 to 2024.1.319 I could no longer see icons. I understand that there has been a switch to svg icons.

I use icons like this in grid columns

columns.Bound(p => p.Id).ClientTemplate("" +

"<a href='" + @Url.Action("Details", "Orders", new { id = "#=Id#" }) + "'target='_blank' '><i title ='Show details' class='k-icon k-i-detail-section'></i></a>")

Could you please modify code above so I can understand how to use svg icons instead?

/Br. Anders

Alexander
Telerik team
 answered on 13 May 2024
0 answers
3 views

Is there a way to determine what kind of kind of control you have using JavaScript.  For example , if you have a form with several different kendo controls

.data("kendoNumericTextBox")

.data("kendoComboBox")

.data("kendoButton")

I only have the name and id of the control. Is there a way to determine what kind of kendo control that is represented.

I have tried looking through the  jquery selection but I do not see any thing that indicates whether the selection is a kendoNumericTextBox, kendoComboBox etc...

Sean
Top achievements
Rank 1
Iron
Iron
 asked on 12 May 2024
0 answers
6 views

In my cshtml view, I have this kendo mvc grid control below.

@(Html.Kendo().Grid<MyModel>()
  .Name("mygriddata")
  .Columns(column =>
  {
      column.Bound(model => model.MyData).Title("No.").....
  })
    .Pageable(x => x.PageSizes(true).ButtonCount(3).Responsive(false))
    .AutoBind(false)
    .Filterable()
    .Sortable(x => x.Enabled(true))
    .Resizable(resizable => resizable.Columns(true))
    .Scrollable(x => x.Height("auto"))
    .PersistSelection()
    .HtmlAttributes(new { style = "height: 50vh; margin-left:10px", @class = "form-group" })
    .NoRecords()
    .DataSource(dataSource => dataSource
        .Ajax()
        .ServerOperation(true)
        .Model(model =>
        {
            model.Id(item => item.ID);
        })
        .Read(read => read.Action("MyActionMethod", "MyController"))
    )
)

In in my controller, I have this async task action method.

public async Task<JsonResult> MyActionMethod([DataSourceRequest] DataSourceRequest request)
{
    var data = await _service.GetData();
     var model = data.Select((item, index) => new MyModel
                    {
                        MyData = ......
                    });

    return new JsonResult { Data = model.ToDataSourceResultAsync(request), MaxJsonLength = int.MaxValue, JsonRequestBehavior = JsonRequestBehavior.AllowGet };
}

Then, when accessing the view, I got this error. How to set up the Kendo mvc grid control in this case?

Message: The asynchronous action method 'MyActionMethod' returns a Task, which cannot be executed synchronously.

Ronan
Top achievements
Rank 1
 asked on 10 May 2024
0 answers
4 views

I am trying to update my spreadsheet based on the jsonData i get from my controller.

Controller data:


public ActionResult GetDoubleCombinations(Telerik.Web.Spreadsheet.Workbook jsonData, int id)
{

    foreach (var sheet in jsonData.Sheets)
    {
        var columnCount = sheet.Columns.Count;
        var rowCount = sheet.Rows.Count;

        for (int i = 2; i < columnCount; i++)
        {
            var expressionTop = expressionService.GetExpressionByName(sheet.Rows[1].Cells[i].Value.ToString(), id);
            var parameterTop = expressionTop.FK_ParameterID;

            for (int j = 2; j < rowCount; j++)
            {
                var expressionLeft = expressionService.GetExpressionByName(sheet.Rows[j].Cells[1].Value.ToString(), id);
                var parameterLeft = expressionLeft.FK_ParameterID;

                if (parameterTop == parameterLeft)
                {
                    var position = sheet.Rows[i].Cells[j];
                    position.Enable = false;
                    position.Background = "#d3d3d3";
                }
            }

        }
        
    }
    return Json(new { success = true, data = jsonData });
}

this is what i get in my view:


function getDoubleCombinations() {

    var spreadsheet = $("#matrix").data("kendoSpreadsheet");
    const urlParams = new URLSearchParams(window.location.search);
    const id = urlParams.get('analysisId');

    $.ajax({
        url: "@Url.Action("GetDoubleCombinations", "Matrix")",
        data: JSON.stringify({
            jsonData: spreadsheet.toJSON(),
            id: id
        }),
        contentType: "application/json",
        type: "POST",
        success: function (response) {
            spreadsheet.fromJSON(response.data);
        },
        error: function () {
            alert("Error loading data.");
        }
    });
}

I use "spreadsheet.fromJSON" to update my spreadsheet.

My spreadsheet:


@model Telerik.Web.Spreadsheet.Workbook
@(Html.Kendo().Spreadsheet()
    .Name("matrix")
    .HtmlAttributes(new { style = "width:100%" })
    .BindTo(Model)
    .Toolbar(t =>
    {
        t.Home(h =>
        {
            h.Clear();
            h.ExportAs();
        });
        t.Data(false);
        t.Insert(false);
    })
)

My problem is, that the spreadsheet is not updated.

In the attachement i have a screenshot of my jsonData.

Herr Walter Gartmann
Top achievements
Rank 1
 asked on 10 May 2024
1 answer
6 views

I have a Kendo tabstrip with partial views. When I click on the tab, the partial views are loaded. But I need to set the focus() and/or tabindex to a specific element in the partial view, for example the first text box. I tried setting the tabindex to 1 in the partial view. But that does Not seem to work.

There seems to be 2 TabStrip methods for loading a partial views ?

.LoadContentFrom("CustomerEdit"... and .Content(@<text> @Html.Partial("OrdersEdit"

I think the LoadContentFrom is Ajax.

Using Content(@<text> @Html.Partial("OrdersEdit"**... how can I set the focus to my first textbox on the the OrdersEdit.. I tried setting tabindex =1 and tried this:

 $(document).ready(function () {
    $('#firstTextBox').focus();
}

But does not work.

Anton Mironov
Telerik team
 answered on 09 May 2024
0 answers
10 views

Hi! I have a Kendo UI Filter with a column bound with a DropDownList. Everything works fine, except the ExpressionPreview gives me "[object Object]". I read that I could use the PreviewFormat, but I have no clue about how that works if it's not for numeric values. Your documentation is very thin about the subject. Can you tell me how could I see the property set as DataTextField in the preview? Or at least the DataValueField.

My razor looks like :

 @(Html.Kendo().Filter<OrderSearchBindingModel>()
.Name("filter")
.ApplyButton()
.ExpressionPreview()
.MainLogic(FilterCompositionLogicalOperator.Or).Fields(f =>
  {

      f.Add(x => x.Symbole).Label("My values list").Operators(c => c.String(x => 
                          x..Contains("Contient")).EditorTemplateHandler("getSymboleList")
}).DataSource("source"))

 

And the script containing the dropdown logic is like this :


.kendoDropDownList({
                dataTextField: "SymboleDisplayName",
                dataValueField: "Symbole",
                dataSource: {
                    type: "json",
                    transport: {
                        read: "https://myodataurl.com/symbols/getSymbols"
                    },
		    schema: {
			data: "value"
		    }
                }
            });

 

Note that my datasource is an OData query, so I defined a schema with data: "value" in my kendo.data.DataSource object as well as type: "json". The type is aslo specified in the transport.read preperties datatype: "json"

Patrice Cote
Top achievements
Rank 1
 updated question on 08 May 2024
1 answer
6 views

This is for ASP.NET MVC

 

I have a grid that on scrolling hits the controller and does true sql paging.  So each time you scroll it hits the controller that calls sql and gets the next 100 rows of data. This was working fine until we upgraded from a 2019 version of Kendo to the 2024.1.130.545 version.  It all still works but as you scroll it gets slower and slower with each group of 100, the sql calls are all still fast but loading the data on the screen slows down exponentially on each set of 100.

This is the grid code we have set.

.NoRecords(x => x.Template("<div class='empty-grid' style='height: 300px; padding-top: 50px'>There are no units that match your search criteria. <br /><br /> Please expand your search criteria and try again.</div>"))
.Sortable(sortable => sortable.Enabled(true).SortMode(GridSortMode.SingleColumn))
.ColumnMenu()
.Resizable(resize => resize.Columns(true))
.Filterable(filterable => filterable
.Mode(GridFilterMode.Row)
.Extra(false)
.Operators(operators => operators
    .ForString(str => str.Clear()
        .Contains("Contains")
        .StartsWith("Starts with")
        .IsEqualTo("Is equal to")
        .IsNotEqualTo("Is not equal to")
        .DoesNotContain("Does Not Contain")
        .EndsWith("Ends WIth")
        .IsEmpty("Is Empty")
    ))
)

.Reorderable(reorder => reorder.Columns(true))
.Selectable(selectable => selectable
.Mode(GridSelectionMode.Single))
.Scrollable(scrollable => scrollable.Endless(false).Height(600))
.ToolBar(tools => tools.Excel())
.Excel(excel => excel
    .FileName("UnitSearchExport.xlsx")
    .Filterable(true)
    .AllPages(true)
    .ProxyURL(Url.Action("Excel_Export_Save", "Functions"))
)
.DataSource(dataSource => dataSource
.Ajax()
.AutoSync(false)
.ServerOperation(false)
.Model(model =>
{
    var Modelinfo = new Infinity.Vehicle.Inventory.Vehicles_Listing.VehicleListInfo();
    var Stock_Number = Modelinfo.Stock_Number;

    model.Id(p => Stock_Number);
}))
.Events(e => e
    .Filter("UnitInventoryListInfiniteScrollGrid_OnFiltering")
    .Sort("UnitInventoryListInfiniteScrollGrid_OnSorting")
    .ExcelExport("UnitInventoryListInfiniteScrollGrid_OnExcelExport")
    .DataBound("UnitInventoryListInfiniteScrollGrid_OnDataBound")
))

 

 

Then on Scroll it basically does this.

  var dataSourceUnitListing = new kendo.data.DataSource({
      data: [
          response.Listing
      ]
  });

  unitListingGrid.dataSource.data().push.apply(unitListingGrid.dataSource.data(), dataSourceUnitListing.options.data[0]);

  amountOfUnitsShownOnGrid = unitListingGrid.dataSource.view().length;

Anton Mironov
Telerik team
 answered on 07 May 2024
1 answer
7 views

In rich text editor does kendo support the layout column selection same as we have option in word like this

does kendo mvc rich text editor support that if yes please let us know how ?

Mihaela
Telerik team
 answered on 01 May 2024
1 answer
7 views

I have a Form widget on a cshtml file:

@(Html.Kendo().Form<EditEraViewModel>()
            .Name("formEditEra")
            .HtmlAttributes(new { @method = "post" })
            .Orientation("horizontal")
            .Layout("grid")
            .ButtonsTemplateId("buttonsTemplate")
            .Grid(g => g.Cols(1).Gutter(20))
            .FormData(Model.EraViewModel)
            .Validatable(v =>
            {
                v.ValidateOnBlur(false);
                v.ValidationSummary(vs => vs.Enable(false));
            })
                    .Items(items =>
                    {
                        ....
                        });
 
                    })
    .Events(ev => ev.Submit("EditEra.OnTestSubmit"))

I'm adding the button as a template, like this:

<script id="buttonsTemplate" type="text/x-kendo-template">
    <div class="myButtonsContainer">
 
    @if (!isImpersonating)
    {
        @(Html.Kendo().Button()
                .Name(@Localizer["general.page.button.submit"].ToString())
                .HtmlAttributes(new { @class = "k-button k-button-md k-rounded-md k-button-solid k-button-solid-primary k-form-submit" })
                .Content(@Localizer["general.page.button.submit"].ToString())
                .Events(ev => ev.Click("EditEra.onFormSubmit"))
                .ToClientTemplate())
    }
    @(Html.Kendo().Button()
            .Name(@Localizer["general.page.button.cancel"].ToString())
            .HtmlAttributes(new { @class = "k-button k-button-md k-rounded-md k-button-solid k-button-solid-primary k-form-cancel" })
            .Content(@Localizer["general.page.button.cancel"].ToString())
            .Events(ev => ev.Click("goToProviderInfo"))
            .ToClientTemplate()
 
        )
    </div>
</script>

When the submit button is clicked, the OnPost method on the cshtml.cs file is not being triggered. It looks like the form is never submitted.

The "EditEra.OnTestSubmit" function that is called on the Submit event is being called. But the for is not being submitted, and the onPost method on the .cs file is never being executed.

What do I need to do to make sure that the form is submitted when the submit button is clicked?

Thanks.

I do

Alexander
Telerik team
 answered on 29 Apr 2024
Narrow your results
Selected tags
Tags
+? more
Top users last month
Mark
Top achievements
Rank 1
Yurii
Top achievements
Rank 1
Leland
Top achievements
Rank 2
Iron
Iron
Iron
Hon
Top achievements
Rank 1
Iron
Deltaohm
Top achievements
Rank 3
Bronze
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Mark
Top achievements
Rank 1
Yurii
Top achievements
Rank 1
Leland
Top achievements
Rank 2
Iron
Iron
Iron
Hon
Top achievements
Rank 1
Iron
Deltaohm
Top achievements
Rank 3
Bronze
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?