Is there a recommended way of handling a ContextMenu in a Partial View?
I have a partial view for each tab in a TabStrip (loaded via LoadContentFrom).
Each time the partial view is loaded, the ContextMenu element (<ul>) is moved to the bottom of the page within a div with class "k-animation-container". The menu behaves correctly on first load (items can be hidden successfully). On subsequent loads, the whole menu is displayed. This is presumably because of the duplicate <ul> and <li>s with duplicate ids.
Is this an incorrect usage? Should I be destroying the widget each time (like in the example with the "Apply" dropdown to change orientation).
I have a ​TreeList that simply does not display the data it is receiving through the remote binding.
I can confirm (via Fiddler AND the KendoUI for Chorme browser extension) that the JSON data received is loaded and does contain data. However, the tree list does not display it.
I can't seem to figure out why. Please see attached images.
I also tried turning AutoBind ON/OFF, ServerOperation ON/OFF. Nothing helps. I don't see what's wrong with it.
View:
@(Html.Kendo().TreeList<Web.Models.LevelViewModel>()
.Name( "treelist1" )
.Columns( columns =>
{
columns.Add().Field( e => e.Name );
} )
.DataSource( dataSource => dataSource
.Read( read => read.Action( "Load", "Business" } ) )
.ServerOperation( false )
.Model( m =>
{
m.Id( f => f.Id );
m.ParentId( f => f.ParentId );
m.Expanded( true );
m.Field( f => f.Name );
} )
)
)
Controller:
var result = controllerService.BuildLevel​s( 1 );
return Json( result.ToTreeDataSourceResult( request,
e => e.Id,
e => e.ParentId
), JsonRequestBehavior.AllowGet );
Model:
public class LevelViewModel : ViewModelBase
{
public int Id { get; set; }
public int? ParentId { get; set; }
public string Name { get; set; }
public int FunctionId { get; set; }
public int LevelId { get; set; }
}
Can you please help?
Hi,
I've got a Kendo Window which in turn loads a Kendo Tab Strip and I want to put a Kendo PanelBar on one of the tabs. Is this feasible?
My window loads like this:
@(Html.Kendo().Window()
.Name("viewJobLogWindow")
.Draggable()
.Resizable()
.Width(640)
//.Height(350)
.Actions(actions => actions.Pin().Minimize().Close())
.LoadContentFrom("ViewJobLogWindowsContent", "TeamsV2")
.Visible(false)
.Title("")
)
The action to load the window returns a partial view - here is that code:
@model TEAMSV2.Models.TeamsV2Model
<
div
class
=
"page-wrap"
>
@(Html.Kendo().TabStrip()
.Name("JobLogTabs")
.Animation(false)
.Events(events => events
.Select("onSelectJobLogTab")
)
.Items(tabstrip =>
{
tabstrip.Add().Text("Job Overview")
.HtmlAttributes(new { index = 0, id = "JobOverviewTab" })
.LoadContentFrom("GetJobLogTab", "TeamsV2", new { id = "JobOverviewTab" });
tabstrip.Add().Text("Job Log")
.HtmlAttributes(new { index = 1, id = "JobLogTab" })
.LoadContentFrom("GetJobLogTab", "TeamsV2", new { id = "JobLogTab" });
tabstrip.Add().Text("Job Documents")
.HtmlAttributes(new { index = 2, id = "JobDocumentsTab" })
.LoadContentFrom("GetJobLogTab", "TeamsV2", new { id = "JobDocumentsTab" });
})
.SelectedIndex(Model.SelectedJobLogTabIndex)
)
</
div
>
And finally, the GetJobLogTab Action for the first tab is where I want to load the PanelBar. I've tried this:
@if (SelectedJob != null)
{
@(Html.Kendo().PanelBar()
.Name("jobLogOverviewPanels")
.ExpandMode(PanelBarExpandMode.Multiple)
.Items(panelbar =>
{
panelbar.Add()
.Text("Job Summary")
.Expanded(true)
.LoadContentFrom("GetJobLogOverviewContents", "TeamsV2", new { id = "JobSummary" });
})
)
}
Here's my controller action:
[HttpGet]
[OutputCache(NoStore = true, Duration = 0, VaryByParam = "none")]
public ActionResult GetJobLogOverviewContents(string id)
{
ViewBag.NewMode = false;
TeamsV2Model Model = new TeamsV2Model(GetOrCreateSessionHelper(false));
// The Partial views are in a folder of the same name
return PartialView("JobLog/JobOverviewTab/Panels/" + id, Model);
}
I'm expecting the panels to load up straight away as I have set them to "Expanded" but they only load once I actually click the panel bar and then it loads the partial view into the whole screen and not into the tab?
I've attached an image containing the loaded pop-up window and then what happens when I click the panel bar.
Any ideas?
Mark.
I cannot get Intellisense to work in my Razor views no matter what I try. I'm using Visual Studio 2015 and MVC 5. It has worked previously, but when I opened the project today it suddenly wasn't working. I have performed every single step in the introduction guide (reference added to the project, added to web.config), and I'm still getting the error below. I do have @using Kendo.Mvc.UI; at the top of my file, and the project builds so it's apparently finding the wrappers, but it won't enable Intellisense. I've removed/re-added the reference, closed/reopened the file and the solution, and rebooted my computer, but nothing has worked. What can I do to fix this?
ErrorCS0246 The type or namespace name 'Kendo' could not be found (are you missing a using directive or an assembly reference?)
Hi
I have DropDownList control which looks:
@(Html.Kendo().DropDownListFor(m => m.VatCategoryId)
.Name(
"VatCategoryId"
)
.DataTextField(
"Text"
)
.DataValueField(
"Value"
)
.AutoBind(
false
)
.DataSource(source =>
{
source.Read(read =>
{
read.Action(
"GetVatCategoriesDefault"
,
"VAT"
).Data(
"getCountry"
).Type(HttpVerbs.Get);
});
})
In read method I am passing a list with categories. Some I want one of the item be selected. So I set property Selected = true in SlectedListItem.
Data which view is receiving are good but the default category is not selected.
What could be wrong?
Hi,
I need to show a Window with a template as its content; the data will be JSON.
In other words, I need almost the same code showed in http://docs.telerik.com/kendo-ui/api/javascript/ui/window#configuration-content.template but using the ASP.NET MVC server wrappers.
I've searched the documentation, the demos and the forum but without any luck.
Can you help me with some code, please?
Thank you.
I have an edit cshtml page in an MVC app with a Kendo tabpanel on it.
The tabpanel works, as does data retrieval and updates.
My problem is that when I add a Kendo grid control, the tab panel stops working, and by "stops working", I mean that it no longer changes tabs. Regardless of what you click, it stays on the first tab.
It makes no difference if the grid is editable or not. Also makes no difference if the grid is inside or outside the tabpanel.
Any ideas? Thanks.Hi,
I am trying to use notification animation builder for ASP.NET MVC ?
Here is my couple of code what i have tried
@(Html.Kendo().Notification()
.Name("notification")
.HideOnClick(true)
)
Kindly guide me how can i achive it ?
Hi,
Am using Javascript for rendering a Kendo Grid. In Grid Edit pop up i have a script Template which is an MVC Kendo Template below,
<script id="popup-editor" type="text/x-kendo-template">
<div>
@(Html.Kendo().DatePickerFor(m => m.USReleaseDate).HtmlAttributes(new { @class = "form-control", placeholder = "US Release Date" }).Deferred()) </div>
</script>
Following is my Kendo Editor pop up template code in javascript
template: kendo.template($("#popup-editor").html())
which is perfectly rendering values as expected.
However the problem is, the controls inside the pop up is a plain Html control (<input>) instead of kendo date picker. As i read in the forum, i tried to initialize it below the template like this
<script>
$(function () {
var usReleaseDate = $("#USReleaseDate");
if (usReleaseDate) {
$("#USReleaseDate").kendoDatePicker( {
"format": "MM/dd/yyyy",
"min": new Date(1900, 0, 1, 0, 0, 0, 0),
"max": new Date(2099, 11, 31, 0, 0, 0, 0) });
}
});
but of no use. How can i render kendo controls within a popup editor?