Telerik Forums
UI for ASP.NET Core Forum
1 answer
111 views

public class RegisterViewModel
    {
        public int Id { set; get; }

        [EmailAddress]
        public string Email { get; set; }

        public string RegObl { set; get; }
        public string RegRaion { set; get; }

        public IFormFile FilesImageUser { get; set; }
    }
 
Register.cshtml

@model exchange.Models.RegisterViewModel @using Kendo.Mvc.UI @Html.AntiForgeryToken() <div class="form-group"><label asp-for="ImageUser">Фото</label> @(Html.Kendo().Upload() .Name("FilesImageUser") .Async(a => a .Save("ImageUserTemp_Save", "File") .Remove("ImageUserTemp_Remove", "File") .AutoUpload(false) ) .Events(e => e .Success("onSuccessImageRegister") //.Select("onSelectImageRegister") ) .ShowFileList(false) .Multiple(false) //.DropZone(".dropZoneElement") .Validation(validation => { validation.AllowedExtensions(new string[] { ".jpg", ".jpeg", ".png", ".bmp"}); }) ) <div class="wrapper"><div id="imageUserRegister"></div></div></div>

 

<button type="submit" class="btn btn-success">Регистрация</button>


 public async Task<ActionResult> Register(RegisterViewModel model)
        {
            if (!ModelState.IsValid) return View(model);
..........
        }

how to make the "upload" data loaded into the model and further processed in the controller. At the moment, the data "null" ?
Alexander
Telerik team
 answered on 26 Nov 2021
1 answer
150 views
Hi,
Tsvetomir
Telerik team
 answered on 25 Nov 2021
1 answer
1.3K+ views


                    <label for="poNumTextbox" style="color:white; line-height:3.2; padding-right:5px; padding-top:5px">PO#</label>
                    <div class="k-textbox" style="width:120px">
                        @(Html.Kendo().NumericTextBox<int>()
                            .Name("poNumTextbox")
                            .Format("#")
                            .Decimals(0)
                            .RestrictDecimals(true)
                            .Placeholder("PO #")
                        .HtmlAttributes(new { style = "font-size:inherit; width: 100%" })
                        .Spinners(false)
                        )
                    </div>

I am trying to figure out how to keep leading zeros. Numbers can be something like "00045678" with max 8 chars. However when you click out of the textbox, it is converted to "45678" I'm using numeric textbox to prevent entry of non-numeric characters. Also no decimals or special characters - numbers only. 

Thank you.

 

 

edit: nevermind, found that MaskedTextbox gives me what I need without having to misuse NumericTextbox

Mihaela
Telerik team
 answered on 23 Nov 2021
1 answer
852 views

Hi,

I am trying to get the id of the selected entry in a combo box on a Razor page.

I modelled the code on the DatePicker example from the Razor examples.

I added a DatePicker to my page along with my Combo box.

The page loads and the combo box loads its entries. When I make a selection, the page does a post and my OnPost handler is called.

The value for the DatePicker is there but the ComboBox returns a null value.

I have enclosed screen shots of my cshtml and cshtml.cs pages. The DatePicker and ComboBox are setup identically as far as I can tell.

Any suggestions on what I might be doing wrong. 

Thanks,

Charlotte

Alexander
Telerik team
 answered on 23 Nov 2021
1 answer
85 views

Running

$("#tabStrip").kendoTabStrip().data("kendoTabStrip").activateTab($("#tabstrip-tab-3"));

on Doc Ready in the demo throws a Javascript error and the 3rd tab("Moscow") is not selected.

"Uncaught TypeError: Cannot read properties of undefined (reading 'length')" - logged in Console

What am I doing wrong?

https://netcorerepl.telerik.com/cFFlFhGv515cOcCN27

Mihaela
Telerik team
 answered on 22 Nov 2021
0 answers
256 views

So, basically I do not want clients to have the options to delete or rename files which they have by default when you use FileManager through tag helper. All I need is clients to be able to view available files and download them. Is there any alternative to FileManager to achieve this feature? I greatly appreciate any help or directions. Thank you.

Edit: Using <Context-Menu> tag helper inside the filemanager component accomplished what I was looking for.

Prabhat
Top achievements
Rank 1
 updated question on 19 Nov 2021
1 answer
302 views

What is the usage of UnmaskOnPost?
It seems that if the value is true or false the unmasked text is passed to the ViewModel/Model/Controller.

I need the masked value to be passed for additional validation.

Alexander
Telerik team
 answered on 19 Nov 2021
1 answer
178 views

Good afternoon,

I have created a pie chart based on a ViewModel that contains:
int OperatorId,
string OperatorName,
int OperatorTotal

The chart series is created with a click event as:

.Series(series => series .Pie(model => model.OperatorTotal, model => model.OperatorName) .ColorField("Color") .Padding(0) )
.Events(events => events.SeriesClick("onPieChartClick"))

I can access e.series.name and e.category in the click event which gives me the OperatorName, but I really need the OperatorId.

Is there a way that I can group the pie chart by Id but display the name, or pass the Id in the click event?

Many thanks

Richard

Stoyan
Telerik team
 answered on 18 Nov 2021
1 answer
128 views

Hi,

I have two Donut charts next to each other (see attachment), one has more items in the legend making the Donut smaller than the one next to it, how can i make them both the same size regardless of how many items in the legend?

I have found this article: https://docs.telerik.com/kendo-ui/controls/charts/how-to/appearance/fixed-size-pie-or-donut for JQuery how can i replicate for ASP.NET Core?

I have tried the PlotArea but this doesn't offer a Height Property.

Viktor Tachev
Telerik team
 answered on 15 Nov 2021
2 answers
1.0K+ views

I'm unable to update my project to target .Net 6 as it causes a Nuget conflict with the CodeAnalysis library when using the "Telerik.UI.for.AspNet.Core 2021.3.914" and "Microsoft.PowerShell.Commands.Utility 7.2.0" packages.

Is this something that can be looked at in the next release / internal build of the UI AspNet.Core package?

Error NU1605 Detected package downgrade: Microsoft.CodeAnalysis.CSharp from4.0.0-6.final to 3.8.0.
Reference the package directly from the project to select a different version.
-> Microsoft.PowerShell.Commands.Utility 7.2.0 -> Microsoft.CodeAnalysis.CSharp (>= 4.0.0-6.final) -> Microsoft.CodeAnalysis.CSharp (>= 3.8.0)

Thanks,
Richard

Richard
Top achievements
Rank 2
Iron
Veteran
Iron
 answered on 12 Nov 2021
Narrow your results
Selected tags
Tags
+? more
Top users last month
Rob
Top achievements
Rank 3
Iron
Iron
Iron
Atul
Top achievements
Rank 1
Iron
Iron
Alexander
Top achievements
Rank 1
Veteran
Iron
Serkan
Top achievements
Rank 1
Iron
Shawn
Top achievements
Rank 1
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Rob
Top achievements
Rank 3
Iron
Iron
Iron
Atul
Top achievements
Rank 1
Iron
Iron
Alexander
Top achievements
Rank 1
Veteran
Iron
Serkan
Top achievements
Rank 1
Iron
Shawn
Top achievements
Rank 1
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?