telerik-mvc

Kendo UI for MVC Grid How do I hide the ID column

笑着哭i 提交于 2019-12-10 15:53:22
问题 I would like to hide the ID column of a Kendo grid but still be able to reference it for other actions. I tried making the Width = 0 but that only makes it really wide. @(Html.Kendo().Grid(Model) .Name("LineItems") .Columns(columns => { columns.Bound(o => o.ID).Width(1); columns.Bound(o => o.Ui).Width(20); columns.Bound(o => o.QtyOrdered).Width(20); columns.Bound(o => o.Nomenclature).Width(200); columns.Bound(o => o.QtyShipped).Width(140); columns.Bound(o => o.QtyReceived).Width(200); columns

Telerik().ScriptRegistrar() How to prevent loading jquery libraries?

可紊 提交于 2019-12-10 13:25:37
问题 Script registrar loads jquery.validation.min.js even after Html.Telerik().ScriptRegistrar().jQuery(false) Is there any way to tell it not to do so? Even when I try to load exactly what I need, doing this: @Html.Telerik().ScriptRegistrar().jQuery(false).DefaultGroup(g => { g.Add("telerik.common.min.js"); g.Add("telerik.tabstrip.min.js"); } And if for example I have a telerik grid on the page it would load all necessary scripts including grid.min, grid.editing and jquery.validate.min. I prefer

Setting Telerik MVC grid column properties during an Edit

旧城冷巷雨未停 提交于 2019-12-08 10:20:00
问题 I have an MVC 3 Razor Telerik grid. I have an Edit comand on the row. When a user clicks on Edit (this places the grid in Edit mode with an Update and Cancel button), I want to set a property for two of the columns to readonly . When the user clicks on Cancel or Update, I want to set the columns back to full permission. I know there must be some properties in the controller I should be able to set when the Edit button is pressed for this, but have not seen any docs on how to accomplish this.

Select the theme from a telerik combobox MVC/ASP

試著忘記壹切 提交于 2019-12-08 06:56:21
问题 I want to implement a feature similar to the telerik theme feature available on their demo site. (I have a fully licenced copy of their controls), but I cant find any info on how to do this. I have an MVC application, and in the _Layout.cshtml (which has no controller that I know of (i hope I am wrong)) I am trying to add a combo box populated with a list of available styles like this: <section id="Login"> @if (Request.IsAuthenticated) { <section id="loginImage"> <img src="../../Content

Combobox item style

蓝咒 提交于 2019-12-08 05:11:28
问题 my project is asp.net MVC, using Telerik MVC combobox. I can change the sytle of the first item if I use: var item = combobox.dropDown.$items.first(); item.addClass('test'); Or change all items, using: combobox.dropDown.$items.addClass('test'); But I need to change just specific items (based on a model), I tried: combobox.dropDown.$items[1].addClass('test'); I get this error: Object doesn't support property or method 'addClass ' 回答1: If it's a jQuery object, you should replace: combobox

How to set the static text into JsonResult?

懵懂的女人 提交于 2019-12-08 00:46:16
问题 I found the following code example (from Telerik ) that I'm trying to understand. What I need to do is somehow to set static text into JsonResult (e.g.Text ="Abc" and Value="123") public ActionResult _AjaxLoading(string text) { Thread.Sleep(1000); using ( var nw = new NorthwindDataContext() ) { var products = nw.Products.AsQueryable(); if ( text.HasValue() ) { products = products.Where((p) => p.ProductName.StartsWith(text)); } return new JsonResult { Data = new SelectList(products.ToList(),

How to use common Layout and styles across multiple Asp.net MVC applications

喜夏-厌秋 提交于 2019-12-07 01:49:12
问题 I have a visual studio solution with multiple telerik MVC4 razor projects having same look and feel. I don't want to have same layout, CSS/styles, images and js files copied in all MVC4 projects. What is the best way to accomplish this re-usability? I tried creating a virtual directory of a commonUI project and tried to refer _layout.cshtml using http://localhost/... in _ViewStart.cshtml but it complained saying "http:/localhost/MyMvcApp/Views/Shared/_Layout.cshtml' is not a valid virtual

Combobox item style

╄→尐↘猪︶ㄣ 提交于 2019-12-06 16:41:12
my project is asp.net MVC, using Telerik MVC combobox. I can change the sytle of the first item if I use: var item = combobox.dropDown.$items.first(); item.addClass('test'); Or change all items, using: combobox.dropDown.$items.addClass('test'); But I need to change just specific items (based on a model), I tried: combobox.dropDown.$items[1].addClass('test'); I get this error: Object doesn't support property or method 'addClass ' If it's a jQuery object, you should replace: combobox.dropDown.$items[1].addClass('test'); With: combobox.dropDown.$items.eq(1).addClass('test'); $items[1] gives you

Problem rendering Telerik MVC Grid in a Razor view

我的未来我决定 提交于 2019-12-06 08:25:25
问题 I have the following markup in a 'content' page. Without the Render call, nothing renders, and with the Render call, the grid renders as the first element in the whole page, not inside the 'content' section defined by my view: @using Telerik.Web.Mvc.UI @model Outdoor.Mvc.ViewModels.OutdoorSite.SiteList @{ Html.Telerik().Grid(Model.ItemList).Name("Site Grid") .Columns(columns => { columns.Bound(o => o.SiteId); columns.Bound(o => o.Name); }) .Pageable() .Sortable() .Render(); } What am I doing

How to set the static text into JsonResult?

允我心安 提交于 2019-12-06 04:30:43
I found the following code example (from Telerik ) that I'm trying to understand. What I need to do is somehow to set static text into JsonResult (e.g.Text ="Abc" and Value="123") public ActionResult _AjaxLoading(string text) { Thread.Sleep(1000); using ( var nw = new NorthwindDataContext() ) { var products = nw.Products.AsQueryable(); if ( text.HasValue() ) { products = products.Where((p) => p.ProductName.StartsWith(text)); } return new JsonResult { Data = new SelectList(products.ToList(), "ProductID", "ProductName") }; } } Is this what you are looking for return new JsonResult { Text = "Abc"