I have a Kendo grid and in the Create method, I want to do some server side validation and the response I want to show to the user if validation is true or false.
In the below code CreateTLPCurveAllocations is an MVC action method which is having return type as void.
How to use the CreateTLPCurveAllocations method with return type, so that I can show that return value/ message to the user.
@(Html.Kendo().Grid<TLPAllocationDetails>()
.Name("TLPCurveAllocationsGrid") .DataSource(datasource => datasource.Ajax().Read(read => read.Action("GetTLPCurveAllocations", "DataMgmt"))) .Columns(columns => { columns.Bound(p => p.AllocationDate).Editable("EditFieldsForNewRec").Format("{0:MM/dd/yyyy}").Title("Allocation Date").Width(90).HeaderHtmlAttributes(new { style = "justify-content:center" }).HtmlAttributes(new { style = "text-align: right" }); columns.Bound(p => p.CurveDetails).Editable("EditFieldsForNewRec").ClientTemplate("#=getCurveName(data)#").Title("Curve").Width(100).HeaderHtmlAttributes(new { style = "justify-content:center" }).HtmlAttributes(new { style = "text-align: right" }); columns.Bound(p => p.Allocation).Editable("EditAllocation").Title("Allocation").Width(100).HeaderHtmlAttributes(new { style = "justify-content:center" }).HtmlAttributes(new { style = "text-align:right" }); }) .ToolBar(toolbar => { toolbar.Create(); toolbar.Save(); }) .HtmlAttributes(new { style = "height: 400px;width:97%" }) .Editable(editable => editable.Mode(GridEditMode.InCell)) .Pageable() .Navigatable() .Filterable() .Scrollable() .DataSource(dataSource => dataSource .Ajax() .Batch(true) .PageSize(5) .ServerOperation(false) .Model(model => { model.Id(p => p.AllocationDate); model.Field(p => p.CurveDetails).DefaultValue(ViewData["CurveDetails"] as CurveDetails); }) .Create("CreateTLPCurveAllocations", "DataMgmt") .Update("UpdateTLPCurveAllocations", "DataMgmt") ) )
I am trying to upgrade a .NET 4.5 project using the Upgrade Wizard. However, when I attempt to use the wizard I am getting a message saying "No distribution available for your project" and there aren't any versions listed in the dropdown.
I downloaded the ASP.NET MCV 2024.4.1112. Am I missing something?
I have attached a photo of the message I am receiving.
<TelerikTileLayout Columns="3"
ColumnWidth="285px"
RowHeight="285px"
Reorderable="true"
Resizable="true"
ColumnSpacing="0px"
RowSpacing="0px">
<TileLayoutItems>
<TileLayoutItem @ref="reference">
<HeaderTemplate>
@* <button @onclick="OnCloseButtonClicked"></button> *@
<span>sometext</span>
</HeaderTemplate>
<Content>
<img class="k-card-image" draggable="false" src="images/cards/places/barcelona.jpg" alt="Barcelona" />
</Content>
</TileLayoutItem>
<TileLayoutItem HeaderText="Sofia">
<Content>
<img class="k-card-image" draggable="false" src="images/cards/places/sofia.jpg" alt="Sofia" />
</Content>
</TileLayoutItem>
<TileLayoutItem HeaderText="Rome">
<Content>
<img class="k-card-image" draggable="false" src="images/cards/places/rome.jpg" alt="Rome" />
</Content>
</TileLayoutItem>
</TileLayoutItems>
</TelerikTileLayout>
I need a support for ,
I am working on grid custom editing , i want to show success message after successful operation.
How can I do that ? Also If there is any way if we can use inbuild save changes button.
Below is my grid.
Thanks in advance.
@(Html.Kendo().Grid<RVNLMIS.Models.ListMasterBOQResourceCalc>()
.Name("ResourceTypeGrid")
.Columns(columns =>
{
// Resource Type column
columns.Bound(c => c.RsrcType)
.Title("Resource Type")
.ClientTemplate("#= RsrcType ? RsrcType.ResourceTypeName : '' #")
.EditorTemplateName("ClientResource")
.Sortable(false)
.HtmlAttributes(new { style = "text-align:left" })
.HeaderHtmlAttributes(new { style = "text-align:left" })
.Width(120)
;
// Resource Name column
columns.Bound(c => c.drpResource)
.Title("Resource")
.ClientTemplate("#= drpResource ? drpResource.ResourceName : ''#")
.EditorTemplateName("ClientSubResources")
.Sortable(false)
.HtmlAttributes(new { style = "text-align:left" })
.HeaderHtmlAttributes(new { style = "text-align:left" })
.Width(120);
// Quantity column
columns.Bound(c => c.rsrcQty)
.Title("Quantity")
.HtmlAttributes(new { style = "text-align:right" })
.HeaderHtmlAttributes(new { style = "text-align:right" })
.Width(70)
.Format("{0:N2}");
// Wastage Percentage column
columns.Bound(c => c.wastagePct)
.Title("Wastage %")
.HtmlAttributes(new { style = "text-align:right" })
.HeaderHtmlAttributes(new { style = "text-align:right" })
.Width(60);
// Total Quantity column
columns.Bound(c => c.TotalQty)
.Title("Total Qty")
.HtmlAttributes(new { style = "text-align:right" })
.HeaderHtmlAttributes(new { style = "text-align:right" })
.Width(80)
.Format("{0:N2}");
// Unit column
columns.Bound(c => c.Unit)
.Title("Unit")
.HtmlAttributes(new { style = "text-align:left" })
.HeaderHtmlAttributes(new { style = "text-align:left" })
.Width(60);
// Base Rate column
columns.Bound(c => c.BaseRate)
.Title("Base Rate")
.HtmlAttributes(new { style = "text-align:right" })
.HeaderHtmlAttributes(new { style = "text-align:right" })
.Width(80)
.Format("{0:N2}");
// Total Rate column
columns.Bound(c => c.TotalRate)
.Title("Resource Amount")
.HtmlAttributes(new { style = "text-align:right" })
.HeaderHtmlAttributes(new { style = "text-align:right" })
.Width(100)
.Format("{0:N2}");
columns.Command(command => command.Destroy()).Width(150);
})
.ToolBar(t =>
{
t.Create().HtmlAttributes(new { style = "float:right; margin: 5px;" });
t.Save().HtmlAttributes(new { style = "float:right; margin: 5px;" });
})
.Editable(editable => editable.Mode(GridEditMode.InCell))
.Pageable() // Pagination enabled
.Sortable() // Sorting enabled
.Scrollable() // Scrollable grid
.HtmlAttributes(new { style = "height:500px;" })
.DataSource(dataSource => dataSource
.Ajax()
.Batch(true) // Batch editing
.ServerOperation(false) // Client-side operations
.Model(model =>
{
model.Id(p => p.AutoID); // Set primary key
model.Field(p => p.AutoID).Editable(false); // Disable editing for AutoID
model.Field(p => p.RsrcType).DefaultValue(
ViewData["defaultResourceType"] as RVNLMIS.Controllers.Sub_BOQController.ResourceTypeModel);
model.Field(p => p.drpResource).DefaultValue(new RVNLMIS.Controllers.Sub_BOQController.DrpResourceModel
{
ResourceName = "Select Resource",
ResourceID = 0
});
})
.PageSize(20) // Set page size
.Read(read => read.Action("GetBOQResource_Details", "Sub_BOQ").Data("getBOQId"))
.Create(create => create.Action("EditingCustom_Create", "Sub_BOQ"))
.Update(update => update.Action("EditingCustom_Update", "Sub_BOQ"))
.Destroy(destroy => destroy.Action("EditingCustom_Destroy", "Sub_BOQ"))
)
)
Above is grid code , the tool bar is not showing at the top of the grid .
It should show like below example.
@(Html.Kendo().Grid<RVNLMIS.Models.ListMasterBOQResourceCalc>()
.Name("ResourceTypeGrid")
.Columns(columns =>
{
// Resource Type column
columns.Bound(c => c.RsrcType)
.Title("Resource Type")
.ClientTemplate("#= RsrcType ? RsrcType.ResourceTypeName : '' #")
.EditorTemplateName("ClientResource")
.Sortable(false)
.HtmlAttributes(new { style = "text-align:left" })
.HeaderHtmlAttributes(new { style = "text-align:left" })
.Width(120)
;
// Resource Name column
columns.Bound(c => c.drpResource)
.Title("Resource")
.ClientTemplate("#= drpResource ? drpResource.ResourceName : ''#")
.EditorTemplateName("ClientSubResources")
.Sortable(false)
.HtmlAttributes(new { style = "text-align:left" })
.HeaderHtmlAttributes(new { style = "text-align:left" })
.Width(120);
// Quantity column
columns.Bound(c => c.rsrcQty)
.Title("Quantity")
.HtmlAttributes(new { style = "text-align:right" })
.HeaderHtmlAttributes(new { style = "text-align:right" })
.Width(70)
.Format("{0:N2}");
// Wastage Percentage column
columns.Bound(c => c.wastagePct)
.Title("Wastage %")
.HtmlAttributes(new { style = "text-align:right" })
.HeaderHtmlAttributes(new { style = "text-align:right" })
.Width(60);
// Total Quantity column
columns.Bound(c => c.TotalQty)
.Title("Total Qty")
.HtmlAttributes(new { style = "text-align:right" })
.HeaderHtmlAttributes(new { style = "text-align:right" })
.Width(80)
.Format("{0:N2}");
// Unit column
columns.Bound(c => c.Unit)
.Title("Unit")
.HtmlAttributes(new { style = "text-align:left" })
.HeaderHtmlAttributes(new { style = "text-align:left" })
.Width(60);
// Base Rate column
columns.Bound(c => c.BaseRate)
.Title("Base Rate")
.HtmlAttributes(new { style = "text-align:right" })
.HeaderHtmlAttributes(new { style = "text-align:right" })
.Width(80)
.Format("{0:N2}");
// Total Rate column
columns.Bound(c => c.TotalRate)
.Title("Resource Amount")
.HtmlAttributes(new { style = "text-align:right" })
.HeaderHtmlAttributes(new { style = "text-align:right" })
.Width(100)
.Format("{0:N2}");
columns.Command(command => command.Destroy()).Width(150);
})
.ToolBar(toolBar =>
{
toolBar.Create(); // Adds a Create button
toolBar.Save(); // Adds a Save button
})
.Editable(editable => editable.Mode(GridEditMode.InCell))
.Pageable() // Pagination enabled
.Sortable() // Sorting enabled
.Scrollable() // Scrollable grid
.HtmlAttributes(new { style = "height:550px;" })
.DataSource(dataSource => dataSource
.Ajax()
.Batch(true) // Batch editing
.ServerOperation(false) // Client-side operations
.Model(model =>
{
model.Id(p => p.AutoID); // Set primary key
model.Field(p => p.AutoID).Editable(false); // Disable editing for AutoID
model.Field(p => p.RsrcType).DefaultValue(
ViewData["defaultResourceType"] as RVNLMIS.Controllers.Sub_BOQController.ResourceTypeModel);
model.Field(p => p.drpResource).DefaultValue(new RVNLMIS.Controllers.Sub_BOQController.DrpResourceModel
{
ResourceName = "Select Resource",
ResourceID = 0
});
})
.PageSize(20) // Set page size
.Read(read => read.Action("GetBOQResource_Details", "Sub_BOQ").Data("getBOQId"))
.Create(create => create.Action("EditingCustom_Create", "Sub_BOQ"))
.Update(update => update.Action("EditingCustom_Update", "Sub_BOQ"))
.Destroy(destroy => destroy.Action("EditingCustom_Destroy", "Sub_BOQ"))
)
)
ClientResource.cshtml
public class ResourceTypeModel@model RVNLMIS.Controllers.Sub_BOQController.ResourceTypeModel
@(Html.Kendo().DropDownListFor(m => m)
.Name("drpRsrcTypeId")
.OptionLabel("Select Resource Type")
.DataValueField("ResourceTypeId")
.DataTextField("ResourceTypeName")
.BindTo((IEnumerable<RVNLMIS.Controllers.Sub_BOQController.ResourceTypeModel>)ViewData["listResourceTypes"])
.Events(e => e.Change("onResourceTypeChange"))
)
ClientSubResources.cshtml
public class DrpResourceModel@model RVNLMIS.Controllers.Sub_BOQController.DrpResourceModel
@(Html.Kendo().DropDownListFor(m => m)
.Name("drpRsrcId")
.OptionLabel("Select Resource")
.DataTextField("raRsrcName")
.DataValueField("raRsrcID")
.CascadeFrom("drpRsrcTypeId") // Cascade from the Category dropdown
.DataSource(dataSource => dataSource
.Read(read => read.Action("GetResourcesByTypeId", "Sub_BOQ").Data("getRsrcTypeID")) // Action to fetch subcategories
)
.Events(e => e.Change("onResourceChange"))
)
After selecting the values from dropdown , the values are not remain selected & also not passing to create method. The default values are passing to create method.
Hi,
I have a Kendo Menu with the menu items, when user will click on the menu it should show the Kendo panels vertically and then again click on the menu should hide the panels within that menu. On Click on the Panelbar items should show the respective pages.
Attached is the screenshot for the reference.
Yea, I know...that's a lot to ask. I've gotten very close. My code is below.
What I need is a tooltip that renders the results of a partial view when user hovers a specific column (column #6) in the kendo grid (mvc razor). I need to show a list of active orders for the given row in the grid.
If the row.OnOrder = 0, I see the proper tooltip text "- no orders found -".
But when row.OnOrder > 0 and the AJAX call is necessary, the tooltip just shows an empty tooltip box (shown in screenshot). In Chrome Network tab I can see the ajax call made, and I can see the html response of the partial view. So I'm fairly certain the partial call is working and responding correctly. VS debugger shows the controller gets hit and returns the view. But the result doesn't populate to the tooltip. I just get a little grey box.
I feel like I'm missing some really, really small but I can't tell what. Any suggestions? The partial view does have a kendo grid in it as well, if that matters.
document.ready():
$("#grdStockLevels").kendoTooltip({
filter: "td:nth-child(6)", // Adjust the selector to target the specific column
position: "top",
content: function (e) {
var dataItem = $("#grdStockLevels").data("kendoGrid").dataItem(e.target.closest("tr"));
if (dataItem.OnOrder > 0) {
return $.ajax({
url: '@Url.Action("OpenOrderList", "Purchasing")',
type: 'GET',
async: false,
data: {
productId: dataItem.ProductId,
optionList: dataItem.OptionList
},
dataType: 'html'
});
} else {
return "- no open orders -";
}
}
}).data("kendoTooltip");
Controller partial view:
public ActionResult OpenOrderList(int productId, string optionList)
{
// validate product
Product p = _productRepo.Load(productId);
if (p == null) return new HttpStatusCodeResult(HttpStatusCode.BadRequest);
// locate open order items
var orderItemList = p.SupplierOrderItems.Where(z => z.OptionList == optionList && z.Order.OrderStatus.IsActive).ToList();
IList<SupplierOrderModel> model = orderItemList.Select(x => new SupplierOrderModel()
{
OrderNumber = x.Order.OrderNumber,
EtaDate = x.Order.EtaDate,
SupplierShipMethodId = x.QtyRemain
}).ToList();
return PartialView("_OpenOrderListPopup", model);
}
partial view:
@model IList<SupplierOrderModel>
@(Html.Kendo().Grid(Model)
.Name("grdOpenOrderList")
.Columns(columns =>
{
columns.Bound(p => p.OrderNumber).Title("Order Number");
columns.Bound(p => p.EtaDate).Title("ETA Date").Format("{0:MM/dd/yyyy}");
columns.Bound(p => p.PurchaseMethodId).Title("Qty On Order");
})
.HtmlAttributes(new { style = "height: 550px;" })
)
Hi!
I am upgrading my .NET 4.8.1 MVC project from 2013 to 2024.
However, I am struggling to do the following:
1) In old setup (2013), there were .css files which were referenced in the Layout file.
Example: "https://da7xgjtj801h2.cloudfront.net/2014.3.1119/styles/kendo.silver.min.css"
After upgrading to 2024 (via Telerik extension), I cannot find a theme with the same name locally and I cannot use the same CDN link (with modified package version of course).
I found the following info: CDN Info but was not able to follow through and my styles are still not applied.
Here are my original CDN links that need to be updated to 2024.3.1015
https://da7xgjtj801h2.cloudfront.net/2014.3.1119/styles/kendo.common.min.css - Edit: I have managed to find a link for this (or similar version) on Kendo Dojo repo
https://da7xgjtj801h2.cloudfront.net/2014.3.1119/styles/kendo.rtl.min.css - Edit: I have managed to find a link for this (or similar version) on Kendo Dojo repo
https://da7xgjtj801h2.cloudfront.net/2014.3.1119/styles/kendo.silver.min.css - Have not managed to find this (please help)
https://da7xgjtj801h2.cloudfront.net/2014.3.1119/styles/kendo.dataviz.silver.min.css - Have not managed to find this (please help)
Above those, I included the licence snippet:
How do I fix my links? Any help is greatly appreciated.
Thanks!
Using the following script to build a Filter and DataSource.
When I click the Apply button I would expect the Filter Property in the method to be populated. See screen print below
<script>
$(document).ready(function () {
var dataSource = new kendo.data.DataSource({
transport: {
read: {
dataType: "json",
url: "/Home/Products_Read"
}
},
serverFiltering: true,
pageSize: 4,
schema: {
model: {
fields: {
ProductName: { type: "string" },
}
}
}
});
$("#filter").kendoFilter({
dataSource: dataSource,
expressionPreview: true,
applyButton: true,
fields: [
{ name: "ProductName", type: "string", label: "ProductName" },
],
expression: {
logic: "or",
filters: [
{ field: "ProductName", value: "Chai", operator: "contains" }
]
}
});
});
</script>