Telerik Forums
UI for ASP.NET MVC Forum
0 answers
115 views

Hi,

I use the latest Kendo UI MVC with Visual Studio 2019. I would to know if is possible to change the menu orientation with a button click and not with a combobox option ?

 

Thank you.

Ignacio

José Ignacio
Top achievements
Rank 1
 asked on 19 May 2022
2 answers
1.6K+ views

hi, 

I'm maintaing a ASP.NET MVC 5.2.7 webapp with kendo 2021.2.616,  the question is: will this version of kendo work when the webapp is migrated to .Net 6? otherwise is there a kendo roadmap for such kind of migration?

regards and happy holidays

Gerardo
Top achievements
Rank 1
Iron
Veteran
Iron
 answered on 16 May 2022
1 answer
131 views
How to disable search option from multicolumncombobox
Ivan Danchev
Telerik team
 answered on 16 May 2022
0 answers
89 views

I have created an ASP.NET MVC application and I am using Telerik Grid control in it. An issue is reported by QA that if the page call via postman is issued with incorrect values for page, size or filter parameters e.g., filter=aaaaaaaaaaaa, it results in crashing the page. Is there anyway to handle the incorrect values for these three grid attributes and instead of error dump on webpage, default value gets assigned to erroneous parameter.

Version Information
.NET Runtime: 4.7
Telerik Web MVC: 2013.2.611.340

Tahir
Top achievements
Rank 1
 asked on 16 May 2022
1 answer
129 views
I do not see TextArea in the WidgetFactory with all the other controls and cannot find an explanation for why it is missing.
Eyup
Telerik team
 answered on 13 May 2022
4 answers
682 views

I'm implementing a file manager in an MVC site that works with files located somewhere other than the site. I have got this working fine as long as I stay in the root directory. Trying to change into another directory throws the following error in the console:

 

Error! Could not navigate to the folder at the requested path(/Message Attachments). Make sure that the parent folder of the target folder has already been loaded.

As changing directories doesn't seem to be triggering anything on the server, I'm at a loss as to how to troubleshoot this.

The code in the view is pretty much right out of the demo at this point:

@(Html.Kendo().FileManager().Name("filemanager")
    .DataSource(ds =>
        {
            ds.Read(operation => operation
            .Type(HttpVerbs.Post)
            .Action("Read", "Documents")
        );
        ds.Destroy(operation => operation
            .Type(HttpVerbs.Post)
            .Action("Destroy", "Documents")
        );
        ds.Create(operation => operation
            .Type(HttpVerbs.Post)
            .Action("Create", "Documents")
        );
        ds.Update(operation => operation
            .Type(HttpVerbs.Post)
            .Action("Update", "Documents")
        );
    })
    .UploadUrl("Upload", "Documents")
    .Toolbar(tb => tb.Items(items =>
    {
        items.Add("createFolder");
        items.Add("upload");
        items.Add("sortDirection");
        items.Add("sortField");
        items.Add("changeView");
        items.Add("spacer");
        items.Add("details");
        items.Add("search");
    }))
    .ContextMenu(context => context.Items(items =>
    {
        items.Add("rename");
        items.Add("delete");
    }))
)
Anna
Top achievements
Rank 1
Iron
Iron
Iron
 answered on 12 May 2022
1 answer
385 views

I am using @Html.Kendo().Spreadsheet() on a Razor page in a DotNet Core App. I want to Configure which options are available on the Toolbar and add a Custom one. I see from an older question from 2017, adding a Custom button was not supported back then. Has that changed?

 

Can someone point me to the appropriate documentation for that please.

 

 

Aleksandar
Telerik team
 answered on 12 May 2022
0 answers
374 views

I have a grid filter on a column that doesn't allow decimals.  I tried the solution provided in this forum topic but it appears to only work when Mode(GridFilterMode.Row) is set but I have to use Mode(GridFilterMode.Menu).  Do you have a working example for the Mode(GridFilterMode.Menu) option to ensure that decimals don't show up in the input after you filter the grid and reopen the filter input menu or focus out of the filter input for the numeric text box?

code for the column in the grid:

columns.Bound(c => c.ProspectID).Title("ID").Sortable(true).Filterable(ftb => ftb.Cell(cell => cell.Template("customFilter"))).Format("{0:N0}");

 

Custom form to export the excel from a grid external html button:

<form class="grid-export" action="@Url.Action("CreateExcelFile")" method="POST">
     <input type="hidden" id="export-grid" name="grid" value="" />
     <input type="hidden" id="export-model" name="model" value="" />
     <input type="hidden" id="export-title" name="title" value="Prospects Export" />
     <input type="hidden" id="export-format" name="format" value="xlsx" />
     <input type="hidden" id="export-criteria" name="criteria" value="" />
     <button id="btnGridExport" type="submit" class="submitButtons secondary" onclick="exportExcel()">Export</button>
</form>

JavaScript code to align to that so far:

function exportExcel() {
    var grid = $("#prospectGrid").data("kendoGrid");
    $("#export-model").val(encodeURIComponent(JSON.stringify(grid.columns)));
    $("#export-grid").val("prospectGrid");
    closeGridExport();
}

function customFilter(args) {
    args.element.kendoNumericTextBox({
        decimals: 0,
        format: "n0"
    });
}

Thanks,

Sean

Sean
Top achievements
Rank 1
Iron
 updated question on 11 May 2022
8 answers
1.3K+ views

I want to have the grid number column (ID field) filter to be integer.  How can I accomplish that?  When it run, the filter show decimal.  There is no JavaScript for it.  What is the correct code?

Thank you very much in advance!!
Anieda

Here is the code:

@{<br>    Html.Kendo().Grid(Model)<br>        .Name("grid")<br>        .Columns(columns =><br>        {<br>     columns.Bound(request => request.Id).Encoded(false);<br>     columns.Bound(request => request.Requestor).Encoded(false);<br>     columns.Bound(request => request.RequestDate).Format("{0:MM/dd/yyyy}").Encoded(false);<br>     columns.Bound(request => request.ChangeStartDateTime).Format("{0: M/d/yyyy h:mm tt}").Encoded(false);<br>     columns.Bound(request => request.ChangeEndDateTime).Format("{0: M/d/yyyy h:mm tt}").Encoded(false);<br>     columns.Bound(request => request.RequestSubject).Encoded(false);<br>     columns.Bound(request => request.CurrentStatus).Encoded(false);<br>     columns.Bound(request => request.CompletedFlag).Encoded(false);<br> })<br>.Filterable(filterable => filterable<br>   .Extra(false)<br>   .Operators(operators => operators<br>       .ForString(str => str.Clear()<br>           .Contains("Contains")<br>           .StartsWith("Starts With "))<br>       .ForNumber(num => num.Clear()<br>              .IsEqualTo("Equal to"))<br>       .ForDate(d => d.Clear())<br>    )<br>   .Mode(GridFilterMode.Row))<br>.Pageable(pageable => pageable<br>   .Refresh(true)<br>   .PageSizes(true)<br>   .ButtonCount(5))<br>.Resizable(resize => resize.Columns(true))<br>.Selectable()<br>.Sortable()<br>.DataSource(dataSource => dataSource<br>.Server()<br>.Model(model => model.Id(request => request.Id))<br>)<br>.ToolBar(toolbar =><br>{<br>   toolbar.Template(@<text><br>    <div class="toolbar"><br>        <label class="category-label" for="category">Requests</label><br>        @Html.ActionLink("New Request", "New", "Request", null, new { @class = "btn-primary btn" })<br>    </div><br></text>);<br>})<br>.Render();
Sean
Top achievements
Rank 1
Iron
 answered on 09 May 2022
1 answer
444 views

Scenario: Drop-down for customer to select preferred language. If they choose anything other than English, the Radio Group 'Interpreter Required?' (Yes / No) would be a required field. If they select English, this Radio Group is NOT required.

I have the 'Required' Data Annotations set in my model:

[Required]
public int? LanguageID { get; set; }

[Required]
public int? InterpreterRequiredID { get; set; }


View:

<div class="form-group">
    <label>What is your preferred language?</label><br />

    @Html.Kendo().ComboBoxFor(m => m.LanguageID).BindTo(new List<SelectListItem>()
    {
        new SelectListItem() { Text="English", Value="E" },
        new SelectListItem() { Text="Spanish", Value="S" },
        new SelectListItem() { Text="Other", Value="O" }
    }).Events(e => e
        .Change("LanguageID_onChange")
    )
</div>
<div class="form-group">
    <label>Do you require an interpreter?</label><br />
    @Html.Kendo().RadioGroupFor(m => m.InterpreterRequiredID).Items(i =>
        {
            i.Add().Label("Yes").Value("1");
            i.Add().Label("No").Value("2");
        })
</div>
<script>
    function LanguageID_onChange(e) {
        var el = document.getElementById('InterpreterRequiredID');

        if (this.value() == 'E') {
            el.removeAttribute("data-val-required");
        } else {
            el.setAttribute("data-val-required", "This is required!");
        }
    }
</script>
The Radio Group is still requiring a selection upon submission, no matter the language selected. If I change the target control in the javascript function to any other type of input (such as textbox or combobox), the required attribute is successfully removed / assigned according to the language selection. It just doesn't appear to work with the RadioGroup.
Anton Mironov
Telerik team
 answered on 09 May 2022
Narrow your results
Selected tags
Tags
+? more
Top users last month
Will
Top achievements
Rank 2
Iron
Motti
Top achievements
Rank 1
Iron
Hester
Top achievements
Rank 1
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Thomas
Top achievements
Rank 2
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Will
Top achievements
Rank 2
Iron
Motti
Top achievements
Rank 1
Iron
Hester
Top achievements
Rank 1
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Thomas
Top achievements
Rank 2
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?