Hi, I'm referring to the article below:
In the article Asynchronous Mode Fallback is When Upload which is placed inside a form and configured for asynchronous operation.
I have done this, however after uploading some file (and failed since I didn't implement the controller) the form post still doesn't contain any Files.
Is there a specific to implement a fallback mechanism? a sample will be very helpful.
I have a nullable DateTime property in my view model, and I'm binding it to a DatePicker, with a custom date format like so:
@Html.Kendo().DatePickerFor(model => model.MyNullableDateTimeField).HtmlAttributes(new { @class = "form-control" }).Format("MM/dd/yyyy").ParseFormats("MM/dd/yyyy", "yyyy-MM-dd").DateInput(true)
However, it displays like this:
And when I try to submit the form, I get a model validation error: "The value 'month/day/year' is not valid for <my property name>", and it is not possible for me to clear the text from the control at all.
If I input a valid date, it does submit correctly, but I need to be able to have a null value here. I tried
$("#MyNullableDateTimeField").data("kendoDatePicker").value(null) but that did not work. (also tried .val instead of .value)
Also, if there is anyway to have the DatePicker control submit the value in the more standard yyyy-MM-dd format, and just display it in the custom format, I would very much like to know that as well, as it would save me a lot of trouble. I don't understand why it submits a raw string in the "MM/dd/yyyy" format when a standard <input type="date"> will submit in a yyyy-MM-dd format and just display the value in the regular format.
Thanks!
hi, I'm using a combobox like the one below, when the model already has a country assigned, the combobox shows the Id instead of the Name.
At page load I can see that the URL Countries is requested, however this doesn't make a difference.
so the question is, how can I to set the initial value?. I've read examples but they all use a local datasource with bind-to, not a remote datasource. is this possible?
regards
<kendo-combobox for="CountryId" suggest="true"
datatextfield="Name"
datavaluefield="Id" filter="FilterType.Contains">
<datasource server-filtering="true">
<transport>
<read url="@Url.Action("Countries", "Common")"/>
</transport>
</datasource>
</kendo-combobox>
Good afternoon,
Is there a way to populate a second grid based on the outcome of the read action for the first grid?
For example, the read action for grid1 pulls a list of files from the file system in and runs checks against each file. The list generated is returned to load grid1. During the processing a number of errors are generated, creating a second list. Ultimately I'd like grid2 to display that list.
It seems unnecessary to have a separate action for grid2 that is essentially running the same processing, just returning a different list.
With the two grids having AutoBind set to false I assume I can control the order the girds are populated. Could grid2 be populated from a list stored in ViewData?
This article explains how two models can be returned to a single View, but ToDataSourceResult in the Controller can only return one model:
https://www.c-sharpcorner.com/UploadFile/ff2f08/multiple-models-in-single-view-in-mvc/
Kind regards,
Richard
Hi Team,
In our ASP.Net Core MVC project we are using the Telerik Feed for automatic package restoration which work fine by setting up the Username and Password in the nuget.config file inside the %AppData% Folder(C:\Users\-----\AppData\Roaming\NuGet present inside windows), but when we try to deploy build into the server Nuget package restore is failing. May I expect any assistance on this or any steps are we missing which we need to follow to get restoration happen properly on the server.
Using Bootstrap grid row/columns, the listbox will not stay within the bounds of the column it is contained in. Further, I have tried to limit it's width in CSS and it refuses. What needs to be set to get this to conform to standard layout rules? We are using HTMLHelper code to generate the listboxes.
I have a simple test page that has a Chart and a PDF Viewer. I can not get both to work at the same time without getting a license error.
Below is how I have tried loading the Kendo library at the top of the page. For the chart, I need to load it as a script for it to work. For the PDF Viewer I need to load it as a module. But loading both always breaks the license. I have tried version combinations (see below)
How do I get a chart on the same page as the PDF Viewer and have the license work?
Scenario 1:
<script src="~/Portal/kendo/kendo.all.min.js" ></script>
<script src="~/Portal/kendo/kendo.aspnetmvc.min.js" ></script>
Scenario 2:
<script src="~/Portal/kendo/kendo.all.min.js" type="module" ></script>
<script src="~/Portal/kendo/kendo.aspnetmvc.min.js" type="module" ></script>
Scenario 3:
<script src="~/Portal/kendo/kendo.all.min.js" ></script>
<script src="~/Portal/kendo/kendo.aspnetmvc.min.js" ></script>
<script src="~/Portal/kendo/kendo.all.min.js" type="module" ></script>
<script src="~/Portal/kendo/kendo.aspnetmvc.min.js" type="module" ></script>
Thanks,
Richard
@(
Html.Kendo().Grid<IndexModel.CompanyFinancialVM>()
.Name("gridCompanyFinancial")
.Navigatable()
.Height(590)
.Sortable()
.Editable(e => e.Mode(GridEditMode.InCell))
.Scrollable()
.ToolBar(t => { t.Save(); t.CancelEdit(); })
.Columns(columns =>
{
columns.Bound(f => f.CompanyName).Title("Company").Width(150);
columns.Bound(f => f.PeriodName).Title("Period").Width(120);
columns.Bound(f => f.VariableName).Title("Variable").Width(150);
columns.Bound(f => f.VariableTypeName).Title("Variable Type").Width(120);
columns.Bound(f => f.Val).Title("Val")
.Width(100)
.Format("{0:n}") // Show 4 decimals and thousand separator
.EditorTemplateName("Decimal");
columns.Bound(f => f.ValCurr)
.Title("Currency")
.ClientTemplate("#= getCurrencyName(ValCurr) #")
.EditorTemplateName("Currency")
.Width(120);
columns.Bound(f => f.QuantumFK)
.Title("Quantum")
.ClientTemplate("#= getQuantumName(QuantumFK) #")
.EditorTemplateName("QuantumFK")
.Width(120);
columns.Bound(f => f.Priority).Title("Priority").Width(80);
columns.Bound(f => f.SpecOrder).Title("Spec Order").Width(100);
columns.Bound(f => f.Rem).Title("Remarks").EditorTemplateName("Rem");
})
.DataSource(ds => ds.Ajax()
.Read(r => r.Url(Url.Content("~/CompanyFinancial/Index?handler=Read")).Data("getGridRequestData"))
.Update(u => u.Url(Url.Content("~/CompanyFinancial/Index?handler=Update")).Data("forgeryToken"))
.Batch(true)
.Model(m =>
{
m.Id(f => f.Nr);
m.Field(f => f.CompanyName);
m.Field(f => f.PeriodName);
m.Field(f => f.VariableName);
m.Field(f => f.VariableTypeName);
m.Field(f => f.Priority);
m.Field(f => f.SpecOrder);
m.Field(f => f.Val);
m.Field(f => f.ValCurr);
m.Field(f => f.QuantumFK);
m.Field(f => f.Rem);
})
.Sort(s => s.Add(f => f.SpecOrder).Ascending())
.PageSize(20)
)
.Pageable()
Hi,
I'm trying to understand the data binding for a combo box control.
Approach 1. - Using the bind-to attribute. I added "Selected=true" to one of item in the continents data source. This is okay the control pre-selects the item correctly.
@{
var continents = new List<SelectListItem> {
new SelectListItem() {Text = "Africa", Value = "1"},
new SelectListItem() {Text = "Europe", Value = "2"},
new SelectListItem() {Text = "Asia", Value = "3"},
new SelectListItem() {Text = "North America", Value = "4", Selected=true},
new SelectListItem() {Text = "South America", Value = "5"},
new SelectListItem() {Text = "Antarctica", Value = "6"},
new SelectListItem() {Text = "Australia", Value = "7"}
};
}
<h4>ComboBox:</h4>
<kendo-combobox name="combobox1"
datatextfield="Text"
datavaluefield="Value"
placeholder="Select a value"
bind-to="continents"
style="width: 250px;">
</kendo-combobox>
Approach 2. - Ajax binding. I have the same datasource as Approach 1 to return in TestController.cs. I"m expecting "North America" should be pre-selected but it's not. Is this an expected behavior by design when using Ajax binding that "Selected=true" is not appliable? The reason why I'd like to use "Selected=true" with Ajax binding is because there are some logics in a controller action that set the default value for a combo box. I don't want to use the "value" attribute. I knew using the value attribute works for sure.
TestController.cs
public IActionResult Getcontinents(string payload)
{
var continents = new List<SelectListItem> {
new SelectListItem() {Text = "Africa", Value = "1"},
new SelectListItem() {Text = "Europe", Value = "2"},
new SelectListItem() {Text = "Asia", Value = "3"},
new SelectListItem() {Text = "North America", Value = "4", Selected=true},
new SelectListItem() {Text = "South America", Value = "5"},
new SelectListItem() {Text = "Antarctica", Value = "6"},
new SelectListItem() {Text = "Australia", Value = "7"}
};
return Json(continents);
}
Index.cshtml
<kendo-combobox name="combobox2"
datatextfield="Text"
datavaluefield="Value"
filter="FilterType.Contains">
<datasource server-filtering="false">
<transport>
<read url="/Test/Getcontinents"/>
</transport>
</datasource>
</kendo-combobox>
Any insights or thoughts?
Thanks,
Bob D