The following dropdownlist works fine:
@(Html.Kendo().DropDownList()
.Name("TrunkDepotsList")
.HtmlAttributes(new { style = "width: 70px;" })
.DataTextField("DepotNumber")
.DataValueField("DepotID")
.BindTo(Model.DepotList)
.SelectedIndex(Model.DepotIndex)
)
However - when I add an event handler, it turns into a textbox:
@(Html.Kendo().DropDownList()
.Name("TrunkDepotsList")
.HtmlAttributes(new { style = "width: 70px;" })
.DataTextField("DepotNumber")
.DataValueField("DepotID")
.BindTo(Model.DepotList)
.SelectedIndex(Model.DepotIndex)
.Events(e =>
{
e.Change("refreshTrunkSummaryPage");
})
)
For reference, here's my event handler script:
function refreshTrunkSummaryPage() {
alert('refresh running');
...etc
}
http://demos.telerik.com/aspnet-mvc/combobox/serverfiltering
The view and the controller do not seem to work together. The view is calling a controller action that does not exist, the controller action that does exist is not returning any data.
Or if I'm wrong, I'll humbly accept corrections :-)
I'm trying to use the Telerik MVC TreeView control with the kendo.data.HierarchicalDataSource control and local data.
In samples for the Kendo Treeview, they point to the Javascript datasource like this:
dataSource: homogeneous
What syntax do I use in the fluent MVC TreeView to reference data that's held in a JavaScript variable?
Showing my hierarchical data below.
Thanks,
Ken
{
"bodyType"
:
"ESTATE"
,
"capCode"
:
"VWTI20SE5EDTM4"
,
"capID"
:
null
,
"co2Emissions"
:
"167"
,
"colour"
:
"SILVER"
,
"cylinderCapacity"
:
"1968 cc"
,
"dateFirstUsed"
:
"23 July 2009"
,
"dateOfFirstRegistration"
:
"23 JULY 2009"
,
"description"
:
"2009 Volkswagen Tiguan Se Tdi (140) 4MOTION, 1968CC Diesel, 5DR, Manual"
,
"engineSize"
:
"1968CC"
,
"fuel"
:
"Diesel"
,
"fuelType"
:
"DIESEL"
,
"imported"
:
"false"
,
"insuranceGroup"
:
"09"
,
"licencePlate"
:
"mt09nks"
,
"make"
:
"Volkswagen"
,
"model"
:
"Tiguan"
,
"mot"
:
true
,
"motDetails"
:
"Expires: 28 April 2017"
,
"motTestReports"
:[
{
"motTestNumber"
:244794981138,
"testResult"
:
"Pass"
,
"testDate"
:
"29 April 2016"
,
"odometerReading"
:80084,
"expiryDate"
:
"28 April 2017"
,
"advisoryItems"
:[
],
"failureItems"
:[
]
},
{
"motTestNumber"
:938552815158,
"testResult"
:
"Pass"
,
"testDate"
:
"22 April 2015"
,
"odometerReading"
:74998,
"expiryDate"
:
"21 April 2016"
,
"advisoryItems"
:[
],
"failureItems"
:[
]
},
{
"motTestNumber"
:157384685012,
"testResult"
:
"Fail"
,
"testDate"
:
"25 March 2015"
,
"odometerReading"
:74813,
"expiryDate"
:
""
,
"advisoryItems"
:[
"Front Brake pad(s) wearing thin (3.5.1g)"
,
"Front brake disc worn, pitted or scored, but not seriously weakened (3.5.1i)"
,
"Rear brake disc worn, pitted or scored, but not seriously weakened (3.5.1i)"
,
"Rear Brake pad(s) wearing thin (3.5.1g)"
,
"Nearside Front Suspension arm rubber bush deteriorated but not resulting in excessive movement (2.4.G.2)"
,
"Offside Front Suspension arm rubber bush deteriorated but not resulting in excessive movement (2.4.G.2)"
],
"failureItems"
:[
"Nearside Front Tyre tread depth below requirements of 1.6mm (4.1.E.1)"
,
"Offside Front Tyre tread depth below requirements of 1.6mm (4.1.E.1)"
,
"Front Brakes imbalanced across an axle (3.7.B.5b)"
,
"Nearside Front Windscreen wiper does not clear the windscreen effectively (8.2.2)"
]
},
{
"motTestNumber"
:195455474181,
"testResult"
:
"Pass"
,
"testDate"
:
"24 June 2014"
,
"odometerReading"
:63643,
"expiryDate"
:
"23 July 2015"
,
"advisoryItems"
:[
],
"failureItems"
:[
]
},
{
"motTestNumber"
:198414503254,
"testResult"
:
"Pass"
,
"testDate"
:
"23 July 2013"
,
"odometerReading"
:52191,
"expiryDate"
:
"23 July 2014"
,
"advisoryItems"
:[
],
"failureItems"
:[
]
},
{
"motTestNumber"
:945398182180,
"testResult"
:
"Pass"
,
"testDate"
:
"6 July 2012"
,
"odometerReading"
:308600,
"expiryDate"
:
"23 July 2013"
,
"advisoryItems"
:[
],
"failureItems"
:[
]
}
],
"numberOfDoors"
:
"5"
,
"numberOfSeats"
:
"5"
,
"price"
:
"6465.0"
,
"steering"
:
"RHD"
,
"transmission"
:
"MANUAL"
,
"typeApproval"
:
"M1"
,
"vin"
:
"WVGZZZ5NZAW007903"
,
"year"
:
"2009"
,
"yearOfManufacture"
:
"2009"
}
I have tabstrip that is displaying a partial from a different controller/view area, but I cant get the post of the partial in the tabstrip to post back to the different controller
the View that the tab is in.
~/Areas/Secure/Views/Company/companyStaff.cshtml
display a view assocated to a different controller
tabstrip.Add().Text("Create Contact")
.Selected(false)
.Content(Html.Partial("~/Areas/Secure/Views/Contact/_ContactManagement.cshtml", new WebSite.Library.Models.Contact() , new ViewDataDictionary { { "Id", "0" } }).ToHtmlString());
How can I get the partial in the tab to post back to its own controller post method
Hi,
I am using the Pdf export to print a grid. In the page header on each page I would like to have content from the model (or the ViewBag or some other way), in any case data that I can set in the method in the controller when I load the ViewModel for the page. I have found a lot of info about the page headers, but the page number is the only variable data I have seen.
I would like to show something like "Inventory as of Dec 3rd, report printed March 21st", so not only page number and today's date but other stuff too.
Is this possible and if so, can someone please point me in the right direction for info on this?
Best regards,
Henrik
How do i get the value of a Kendo Date Picker by class name. The reason being is because im using the name and id attributes for something else. As you can see below the class attribute is dynamic. Every other time ive selected a Kendo Date Picker, i've always used the ID attribute. Is it possible to select by class attribute?
@Html.Kendo().DatePicker()Greetings all,
I am attempting to have the same select list display on one page via MVC Display Templates. So far I've only been able to get one of the select lists to display at a time. Is this functionality not allowed. See my code example below:
<div
class
=
"row"
>
<div
class
=
""
>@Html.DisplayFor(m => m.AgentSelector)</div>
</div>
<div
class
=
""
>
<p> a bunch of misc. data
is
here </p>
</div>
<div
class
=
"row"
>
<div
class
=
""
>@Html.DisplayFor(m => m.AgentSelector)</div>
</div>
The first one works. The second one does not. Is there a way to get this to work.
Hello,
I have used kendo scheduler for displaying schedule but not able see any event on scheduler and also not getting error as well.
please check attached images for reference.
Thanks,
Vinal Patwa