Telerik Forums
UI for ASP.NET Core Forum
1 answer
563 views
Hello, can someone (admin) provide me a thorough working example on how to have a Multi-select have its values fetched using ajax when a dropdown is changed in a row in a grid when doing inline editing? I'm using Asp.Net MVC. I've looked at some samples, but seems that CascadeFrom() function is not supported in a multi-select.  Please provide working sample for both inline grid and popup.
Viktor Tachev
Telerik team
 answered on 08 Aug 2018
2 answers
469 views

I have to upload the files and I have some restriction that can be evaluated on the server. For instance the total size of all the files uploaded have a maximum size.

The demo states this: "// Return an empty string to signify success". From this I took that if I return a string that is not empty it will not be success. But when I tested instead of getting the error event the upload widget shows success.

Please provide an example on how to signify errors and if possible to return for instance an object as error.

What I have returned is something like this Json(new { errors: [{ ErrorMessage: "1"}, {ErrorMessage: "2"}] })

Dimitar
Telerik team
 answered on 08 Aug 2018
1 answer
168 views

Hello,

 

Does "UI for ASP.NET Core" components supports "ASP.Net Core 2.1 and Razor Pages"?

 

Regards

 

Eyup
Telerik team
 answered on 07 Aug 2018
2 answers
50 views

I have a grid with a custom command column for delete. I have also configured the Destroy method using additional parameters which is supported

.Destroy("DeleteAction", "MyController", new { extraId = Model.Id })

I should mention that the Create function is not defined since I am not going to use it.

When I press the button I was getting nothing. After attaching to the error event I got an exception with Not Found. After further investigation I saw that instead of calling Destroy method it was calling Create. I define also the Create and confirmed that the telerik grid on delete button was calling create method.

Since Destroy does not support the parameter routeValues why is it available?

Dan
Top achievements
Rank 1
Iron
Iron
Veteran
 answered on 06 Aug 2018
2 answers
144 views

I want to add a record in kendo grid .net core (with inline edit mode) after selected row in same group . but when I click on button "Add Record" as shown in image attached,  its creating a new collapse expand group and adding a new row there.

As in Image1, I want to add record after selected row with ID 2 , but its creating a new collapse expand group and adding a row there as shown in Image2.

 

Please provide solution how can I add a row after selection in same group.

 

 

Isha
Top achievements
Rank 1
 answered on 06 Aug 2018
3 answers
201 views
Created an application with Telerik Kendo UI or Asp.Net Core 2.0 controls. We used some controls which work perfectly in development. Locally we are able to run the same code without error in Visual Studio 2017, but after publishing in local IIS it gives below error( see attached image).

Error : - "http://localhost:91/Master/StateMaster/GetStateList 404 (Not Found)". 

While checking the error found that there only Read method (may be due to '[DataSourceRequest]DataSourceRequest' parameter) of a grid cannot call (  action method is perfectly called like in below code 'GetRecordStatusList()')


Our controller 
    [Area("Master")]
public class StateMasterController : Controller
    {
private IAllRepository<StateMaster> iAllStateRepository;

public IActionResult StateMaster()
{
List<SelectListItem> statusList = new List<SelectListItem>() {
new SelectListItem{Text = "Active", Value = "1" },
new SelectListItem{Text = "Inactive", Value = "2" }
};
ViewData["Status"] = statusList;

HttpContext.Session.SetInt32("UserId", 1);
HttpContext.Session.SetString("UserName", "Admin");
ViewBag.UserName = HttpContext.Session.GetString("UserName");

return View();
}

//This action method is not called in published-code
public ActionResult GetStateList([DataSourceRequest]DataSourceRequest request)
{
this.iAllStateRepository = new StateMasterRepository();
var result = iAllStateRepository.GetModelList();
var dsResult = result.ToDataSourceResult(request);
return Json(dsResult);
}

public JsonResult GetRecordStatusList()
{
List<SelectListItem> statusList = new List<SelectListItem>() {
new SelectListItem{Text = "Active", Value = "1" },
new SelectListItem{Text = "Inactive", Value = "2" }
};
return Json(statusList);
}
}


Georgi
Telerik team
 answered on 06 Aug 2018
1 answer
624 views

Hi, I'm looking for help disabling an entire rows edit abilities by using the value in one of the columns.

ex.

...

            columns.Bound(p => p.releaseState).Title("Release State");
            columns.Command(command => {command.Edit().Visible("isEditable(releaseState)");});

...

 

This does not work neither does isEditable(p.releaseState) or isEditable(Model.releaseState)...

Any help would be greatly appreciated.

Eyup
Telerik team
 answered on 05 Aug 2018
1 answer
315 views

I was trying to get DatePickerFor work on a Kendo Grid Popup editor with no luck. I've already spent countless hours first with the DropDownListFor (https://www.telerik.com/forums/dropdownlistfor-events-in-razor-pages) which still doesn't work and now with DatePickerFor. Any help is much appreciated.

I have the DatePickerFor in a Kendo Grid Popup Template.

Grid:

.DataSource(dataSource => dataSource
                .Custom()
                .Transport(t => {
                    t.Read(r => r.Action("Cases", "CaseList", new { handler = "GetCases" }).Type(HttpVerbs.Post).Data("sendAntiForgeryToken"));
                    t.Create(r => r.Action("Cases", "CaseList", new { handler = "AddCase" }).Type(HttpVerbs.Post).Data("sendAntiForgeryToken"));
                })

Razor Page:

public JsonResult OnPostAddCase([DataSourceRequest] DataSourceRequest request, CaseModel newCase)
        {
            if(ModelState.IsValid)
            {
               
            }
        }

 

Popup Template:

@(Html.Kendo().DatePickerFor(model => model.LetterDate)
                        .HtmlAttributes(new { style = "width:150px; font-size:14px" })
            )

Model:

[DataType(DataType.Date, ErrorMessage ="Letter Date is required")]
        [DisplayFormat(DataFormatString = "{0:MM/dd/yyyy}", ApplyFormatInEditMode = true)]
        [Display(Name ="LetterDate")]
        public DateTime LetterDate { get; set; }

FormData:

LetterDate: Tue Jul 31 2018 13:04:15 GMT-0400 (Eastern Daylight Time)

Error: The value 'Tue Jul 31 2018 13:04:15 GMT-0400 (Eastern Daylight Time)' is not valid for LetterDate.

I have tried several solutions like setting up the culture, changing the formats but nothing seems to work.

The only option that I'm left with is intercepting the date before submit. But before I do that I would like to know why it is so hard to get the basic functionality work with kendo controls. This is so frustrating.

Georgi
Telerik team
 answered on 03 Aug 2018
8 answers
246 views

I have an application that uses the SCSS telerik theme

/*Bootstrap v4 custom variables*/
@import "lib_overwrite/bootstrap_variables_overwirte";
 
/*Kendo UI custom variables*/
@import "lib_overwrite/sbkvariables";
 
/*Keno UI - Bootstrap v4 theme*/
@import "../../../node_modules/@progress/kendo-theme-bootstrap/scss/all";
 
/*Original Bootstrap v4 reboot*/
@import "../../../node_modules/bootstrap/scss/bootstrap-reboot";
 
/*Original Bootstrap v4*/
@import "../../../node_modules/bootstrap/scss/bootstrap";
 
/*Custom sass*/
@import "main";

but the resulting css does not contain the browser prefix styles. I have found this because on IE 11 the filter grid row contains the input fields but they do not have the same width as the column. But If I add the "-ms-flex 1 1 0px" that exist on the telerik site the input fields have the correct width.

How can the browser prefix be generated using SCSS for the telerik?

Plamen
Telerik team
 answered on 03 Aug 2018
5 answers
2.2K+ views

I'm trying to add Change Event for DropDownListFor in Razor Pages but facing an issue - "Cannot use lambda expression..."

@(Html.Kendo().DropDownListFor(model => model.CaseSourceCode)

                         .BindTo(ViewBag.LookupSourceTypes)

                         .Events(e => e.Change("OnChange")

)

 

If I don't add the Events line the DropDownListFor works just fine.

 

AJ
Top achievements
Rank 1
 answered on 02 Aug 2018
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?