@(Html.Kendo().TreeView()
.Name("EditMenu")
.DragAndDrop(true)
.BindTo(ourModel)
)
List<
Kendo.Mvc.UI.TreeViewItemModel
>
@model GMCWeb.Models.ContactViewModel
@{
Layout = "~/Views/Shared/_PublicLayout.cshtml";
}
<
div
id
=
"page"
>
<
div
class
=
"contact-page hero-unit"
>
<
div
class
=
"container"
>
<
h1
>Contact</
h1
>
</
div
>
<!--close container-->
</
div
>
<!--close hero-unit-->
<
div
class
=
"container clearfix"
id
=
"main-content"
>
<
div
class
=
"row-fluid reverse-order contact-page"
>
<
h3
class
=
"clearfix"
> Green Mountain Consulting's Parcel Spend Management solution gives you more for your money. Contact us today to find out how to start saving more. </
h3
>
<
hr
/>
<
div
class
=
"span7"
>
<
div
class
=
"row-fluid"
>
<
div
class
=
"span6 "
>
<
p
><
span
class
=
"company-name"
><
strong
>Green Mountain Consulting</
strong
></
span
><
br
/>
7240 Goodlett Farms Pkwy<
br
/>
Memphis, TN 38016<
br
/>
<
strong
>phone (toll free):</
strong
> <
a
href
=
"tel:8773972834 "
class
=
"tele"
>877.397.2834</
a
><
br
/>
<
strong
>phone (local):</
strong
> <
a
href
=
"tel:9015079307 "
class
=
"tele"
>901.507.9307</
a
><
br
/>
<
strong
>fax:</
strong
> 901.507.9329<
br
/>
<
strong
>email:</
strong
><
span
class
=
"gmcgreenlink"
><
a
href
=
"mailto:info@greenmountainconsulting.com"
>info@greenmountainconsulting.com</
a
></
span
></
p
>
<!--close input-append-->
</
div
>
<
div
class
=
"span6 contact-map"
>
<
p
class
=
"right"
>
<
iframe
width
=
"320"
height
=
"250"
frameborder
=
"0"
scrolling
=
"no"
marginheight
=
"0"
marginwidth
=
"0"
src
=
"https://maps.google.com/maps?f=q&;source=s_q&hl=en&geocode=&q=Green+Mountain+Consulting,+LLC,+Goodlett+Farms+Parkway,+Memphis,+TN&aq=0&oq=GREEN+MOUNTAIN+CONSULTING&sll=35.05842,-89.692315&sspn=0.247027,0.528374&ie=UTF8&hq=Green+Mountain+Consulting,+LLC,&hnear=Goodlett+Farms+Pkwy,+Memphis,+Shelby,+Tennessee&t=m&ll=35.180403,-89.822502&spn=0.035077,0.05476&z=13&iwloc=A&output=embed"
></
iframe
><
br
/><
small
><
a
href
=
"https://maps.google.com/maps?f=q&;source=embed&hl=en&geocode=&q=Green+Mountain+Consulting,+LLC,+Goodlett+Farms+Parkway,+Memphis,+TN&aq=0&oq=GREEN+MOUNTAIN+CONSULTING&sll=35.05842,-89.692315&sspn=0.247027,0.528374&ie=UTF8&hq=Green+Mountain+Consulting,+LLC,&hnear=Goodlett+Farms+Pkwy,+Memphis,+Shelby,+Tennessee&t=m&ll=35.180403,-89.822502&spn=0.035077,0.05476&z=13&iwloc=A"
style
=
"color:#0000FF;text-align:left"
>View Larger Map</
a
></
small
>
</
p
>
</
div
>
</
div
>
<
h3
class
=
"short_headline margin-top"
><
span
>Your Area Sales Representative</
span
></
h3
>
<
div
class
=
"row-fluid salesrep-div"
>
@{Html.RenderAction("getAllSalesReps");}
</
div
>
</
div
>
<!--close span5 -->
<
div
class
=
"span5 form-horizontal"
>
@using(Html.BeginForm()) {
@Html.ValidationSummary(true)
<
fieldset
>
<
legend
>Contact GMC</
legend
>
<
div
class
=
"control-group"
>
@Html.LabelFor(model => model.Name)
@Html.TextBoxFor(model => model.Name)
<
p
class
=
"error"
>@Html.ValidationMessageFor(model => model.Name)</
p
>
</
div
>
<
div
class
=
"control-group"
>
@Html.LabelFor(model => model.Phone)
@Html.TextBoxFor(model => model.Phone)
<
p
class
=
"error"
>@Html.ValidationMessageFor(model => model.Phone)</
p
>
</
div
>
<
div
class
=
"control-group"
>
@Html.LabelFor(model => model.Email)
@Html.TextBoxFor(model => model.Email)
<
p
class
=
"error"
>@Html.ValidationMessageFor(model => model.Email)</
p
>
</
div
>
<
div
class
=
"control-group"
>
@Html.LabelFor(model => model.Message)
@Html.TextAreaFor(model => model.Message)
<
p
class
=
"error"
>@Html.ValidationMessageFor(model => model.Message)</
p
>
</
div
>
<
button
type
=
"submit"
class
=
"btn btn-primary btn-large"
>Send</
button
>
</
fieldset
>
<
div
class
=
"control-group"
>
@foreach (var item in ViewData.ModelState)
{
if (item.Value.Errors.Any())
{
foreach (ModelError e in item.Value.Errors)
{
<
p
class
=
"error"
>@e.ErrorMessage</
p
>
}
}
}
</
div
>
}
</
div
>
<!--close span7 -->
</
div
>
<!--close row-fluid-->
</
div
>
<!--close .container role="main-content" -->
</
div
>
@(Html.Kendo().Window()
.Name("ContactConfirmWindow")
.Title("Thank you for contacting us.")
.Content(@<
text
>
<
div
class
=
"pull-left"
>
<
img
src
=
"@Url.Content("
~/Content/images/3dwhitebusinessmanthankyou.png")"
alt
=
"Thank You!"
/>
</
div
>
<
h3
>We appreciate your interest in our company. We wil be in touch with you soon.</
h3
>
</
text
>
)
.Iframe(true)
.Draggable()
.Resizable()
.Width(400)
.Actions(actions => actions.Minimize().Maximize().Close())
.Deferred()
)
<
script
type
=
"text/javascript"
>
$(document).ready(function () {
$("#ContactConfirmWindow").data("kendoWindow").open();
});
</
script
>
[HttpPost]
public
ActionResult Contact(ContactViewModel contactVM)
{
if
(!ModelState.IsValid)
{
return
View(contactVM);
}
var contact =
new
Contact()
{
Name = contactVM.Name,
Email = contactVM.Email,
Phone = contactVM.Phone,
Message = contactVM.Message
};
try
{
new
Email().Send(contact);
}
catch
(Exception ex)
{
ModelState.AddModelError(
"EmailException"
,
"Oops! We are sorry, but there was a problem sending your request. We will fix this as soon as possible. Please try again later."
);
Console.Write(ex.Message);
return
View(contactVM);
}
return
PartialView(
"ContactConfirm"
);
}
01.
02.
<
div
class
=
"SectionBoxCorners"
style
=
"width: 1610px;height:760px;position: absolute;top: 180px;left:35px"
>
03.
<
div
class
=
"SectionBoxGradient"
style
=
"width: 1610px;height:725px; padding: 10px;padding-right: 20px"
>
04.
@(Html.Kendo().Grid<
OutlookContact
>()
05.
.Name("outlookContacts")
06.
.Columns(columns =>
07.
{
08.
columns.Command(command => { command.Edit(); command.Destroy(); }).Width(160);
09.
columns.Bound(p => p.FirstName).Width(100);
10.
columns.Bound(p => p.LastName).Width(125);
11.
columns.Bound(p => p.Suffix).Width(75);
12.
columns.Bound(p => p.Company).Width(150);
13.
columns.Bound(p => p.Department).Width(100);
14.
columns.Bound(p => p.JobTitle).Width(100);
15.
columns.Bound(p => p.BusinessStreet).Title("Bus. Street").Width(150);
16.
columns.Bound(p => p.BusinessStreet2).Title("Bus. Street 2").Width(150);
17.
columns.Bound(p => p.BusinessCity).Width(125);
18.
columns.Bound(p => p.BusinessState).Title("Bus. State").Width(100);
19.
columns.Bound(p => p.BusinessPostalCode).Title("Bus. Zip").Width(75);
20.
columns.Bound(p => p.HomeStreet).Width(150);
21.
columns.Bound(p => p.HomeStreet2).Width(150);
22.
columns.Bound(p => p.HomeCity).Width(100);
23.
columns.Bound(p => p.HomeState).Title("Home State").Width(100);
24.
columns.Bound(p => p.HomePostalCode).Title("Home Zip").Width(100);
25.
columns.Bound(p => p.AssistantsPhone).Width(150);
26.
columns.Bound(p => p.BusinessFax).Title("Bus. Fax").Width(125);
27.
columns.Bound(p => p.BusinessPhone).Title("Bus. Phone").Width(125);
28.
columns.Bound(p => p.BusinessPhone2).Title("Bus. Phone 2").Width(125);
29.
columns.Bound(p => p.HomePhone).Width(125);
30.
columns.Bound(p => p.HomePhone2).Width(125);
31.
columns.Bound(p => p.MobilePhone).Width(125);
32.
columns.Bound(p => p.OtherFax).Width(125);
33.
columns.Bound(p => p.OtherPhone).Width(125);
34.
columns.Bound(p => p.PrimaryPhone).Width(125);
35.
columns.Bound(p => p.Telex).Width(100);
36.
columns.Bound(p => p.Account).Width(100);
37.
columns.Bound(p => p.Anniversary).Format("{0:MM/dd/yyyy}").Width(100);
38.
columns.Bound(p => p.AssistantsName).Width(125);
39.
columns.Bound(p => p.BillingInformation).Width(200);
40.
columns.Bound(p => p.Birthday).Format("{0:MM/dd/yyyy}").Width(100);
41.
columns.Bound(p => p.Categories).Width(200);
42.
columns.Bound(p => p.EmailAddress).Width(200);
43.
columns.Bound(p => p.EmailDisplayName).Width(250);
44.
columns.Bound(p => p.Email2Address).Width(200);
45.
columns.Bound(p => p.Email2DisplayName).Width(250);
46.
columns.Bound(p => p.Email3Address).Width(200);
47.
columns.Bound(p => p.Email3DisplayName).Width(250);
48.
columns.Bound(p => p.Gender).Width(100);
49.
columns.Bound(p => p.Initials).Title("Init.").Width(50);
50.
columns.Bound(p => p.ManagersName).Title("Manager").Width(100);
51.
columns.Bound(p => p.Mileage);
52.
columns.Bound(p => p.Notes).Width(250);
53.
columns.Bound(p => p.OfficeLocation);
54.
columns.Bound(p => p.OrganizationalIdNumber).Title("Org. ID").Width(75);
55.
columns.Bound(p => p.Spouse).Width(100);
56.
columns.Bound(p => p.User1);
57.
columns.Bound(p => p.WebPage).Width(200);
58.
})
59.
.ToolBar(toolbar => toolbar.Create())
60.
.Editable(editable => editable.Mode(GridEditMode.InLine))
61.
.Filterable()
62.
.Pageable()
63.
.Sortable()
64.
.Scrollable()
65.
.HtmlAttributes(new { style = "height:675px; td height:50px;" })
66.
.Resizable(resize => resize.Columns(true))
67.
.DataSource(dataSource => dataSource
68.
.Ajax()
69.
.AutoSync(true)
70.
.PageSize(100)
71.
.Model(model=> model.Id(p=> p.OutlookContactId))
72.
.Create(update=> update.Action("AddOutlookContact", "Options"))
73.
.Update(update=> update.Action("UpdateOutlookContact", "Options"))
74.
.Destroy(update=> update.Action("DeleteOutlookContact", "Options"))
75.
.Read(read => read.Action("GetOutLookContacts", "Options"))
76.
))
77.
</
div
>
78.
</
div
>
01.
@(Html.Kendo().Window()
02.
.Name("window")
03.
.Title("Contact Address Errors")
04.
.Content("loading info...")
05.
.LoadContentFrom("CheckContacts", "Options")
06.
.Iframe(false)
07.
.Draggable()
08.
.Resizable()
09.
.Height(350)
10.
.Width(350)
11.
)
12.
13.
<
script
>
14.
$(document).ready(function () {
15.
$("#window").data("kendoWindow").close();
16.
$("#CheckContacts")
17.
.bind("click", function () {
18.
var grid = $("#outlookContacts").data("kendoGrid");
19.
//grid.datasource.saveChanges();
20.
grid.dataSource.sync();
21.
grid.dataSource.read();
22.
$("#window").data("kendoWindow").center();
23.
$("#window").data("kendoWindow").open();
24.
});
25.
});
26.
</
script
>
@model Smartrail.UI.ViewModels.DisplayPanelViewModel
<
div
id
=
"columnsList"
style
=
"height: 110px; overflow: auto;border:solid; width:150px;"
>
@if (Model.Columns != null)
{
foreach (var column in Model.Columns)
{
var checkBoxId = "chk" + column.Id;
var tdId = "td" + column.Id;
<
table
width
=
"100%"
>
<
tr
>
<
td
width
=
"20px"
>
<
input
type
=
"checkbox"
id
=
"@checkBoxId"
value
=
"@column.Id"
/>
</
td
>
<
td
id
=
"@tdId"
width
=
"100px"
>
@column.ColumnCode
</
td
>
</
tr
>
</
table
>
}
}
</
div
>
Object reference not set to an instance of an object.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.NullReferenceException: Object reference not set to an instance of an object.
Source Error:
Line 4:
Line 5: <
div
id
=
"columnsList"
style
=
"height: 110px; overflow: auto;border:solid; width:150px;"
>
Line 6: @foreach (var names in Model.Columns)
Line 7: {
Line 8: var checkBoxId = "chk" + names.Id;
Source File: d:\Dev\Accutrak\Smartrail02\SourceCode\trunk\SmartrailWeb\Areas\DisplayPanel\Views\Setup\_ColumnsTab.cshtml Line: 6
function
onDataBound(e) {
var
grid = $(
"#Software"
).data(
"kendoGrid"
);
var
gridData = grid.dataSource.view();
for
(
var
i = 0; i < gridData.length; i++) {
var
currentUid = gridData[i].uid;
if
(gridData[i].CategoryID == 1) {
var
currenRow = grid.table.find(
"tr[data-uid='"
+ currentUid +
"']"
);
$(currenRow).addClass(
"green"
);
}
else
if
(gridData[i].CategoryID == 2 ){
var
currenRow = grid.table.find(
"tr[data-uid='"
+ currentUid +
"']"
);
$(currenRow).addClass(
"red"
);
}
else
{
var
currenRow = grid.table.find(
"tr[data-uid='"
+ currentUid +
"']"
);
$(currenRow).addClass(
"yellow"
);
}
}
}
function
SetGreen(sid, cid) {
var
grid = $(
"#grid"
).data(
"kendoGrid"
);
cid =1;
var
url =
'@Url.Action("SetMethod","SetController")'
;
$.post(url, { SID: sid, CID: cid });
grid.saveChanges();
//right here I want to set the bg color for the affected row
}
[CompareValues("PEEP", CompareValues.GreatThanOrEqualTo, ErrorMessageResourceName = "MAPGreaterThanPEEP", ErrorMessageResourceType = typeof(VentSettingStrings))]
public decimal? MAP { get; set; }
@(Html.Kendo().ListView<
VentSetting
>(Model.VentSettingsList)
.Name("listView")
.TagName("div")
.ClientTemplateId("ventTemplate")
.Editable()
.DataSource(datasource => datasource
.Events(events => events.Error("handleError"))
.Model(model => model.Id(m => m.VentSettingId))
.Read(read => read.Action("ReadVentSettings", "RunDetail"))
.Create(create => create.Action("CreateVentSetting", "RunDetail"))
.Update(update => update.Action("UpdateVentSetting", "RunDetail"))
.Destroy(destroy => destroy.Action("DeleteVentSetting", "RunDetail"))
)
)
@using ELSORegistry.Helpers
@using Kendo.Mvc.UI
@model ELSORegistry.Areas.ECLS.Models.VentSetting
<
div
style
=
"padding:10px"
>
<
span
>@Html.LabelWithTooltipFor(model => model.MAP)</
span
>
<
span
>@Html.TextBoxFor(model => model.MAP, new { @class = "k-textbox", style = "width:50px"})</
span
>
<
div
class
=
"edit-buttons"
>
<
a
class
=
"k-button k-button-icontext k-update-button"
><
span
class
=
"k-icon k-update"
></
span
>Save</
a
>
<
a
class
=
"k-button k-button-icontext k-cancel-button"
><
span
class
=
"k-icon k-cancel"
></
span
>Cancel</
a
>
</
div
>
</
div
>
$(function () {
var listView = $("#listView").data("kendoListView");
$(".k-add-button").click(function (e) {
listView.add();
e.preventDefault();
});
});
function handleError(args) {
if (args.errors) {
var list = $("#listView").data("kendoListView");
var validationTemplate = kendo.template($("#validationMessageTemplate").html());
list.one("dataBinding", function (e) {
e.preventDefault();
$.each(args.errors, function (propertyName) {
var renderedTemplate = validationTemplate({ field: propertyName, messages: this.errors });
document.getElementById("errorList").innerHTML += renderedTemplate;
});
});
}
};
Hi,
The attached sample project is based on your combo box sample post along with other elements.
In this project combo box onchange event does not fired if it has numeric value. Below are details for the same.
1. I have 2 combo boxes and 1 label in the attached project: Alphabet Combo, Numeric Combo and Selected Value: Alphabet Combo has values: A-1, B-2, C-3, D-4 and Number Combo has values: 1-A, 2-B, 3-C, 4-D
2. Select Alphabet combo by pressing letter 'A' or 'B' or 'C' or 'D' by using keyboard, onchange event fired and selected value and selected text will show on label control (working fine)
3. But I have done for Numeric Combo same as above, but it won't show selected value and selected text due to onchange event does not fired.
For testing,
- Alphabet Combo: Press 'A' by using keyboard and press Tab, it will show the selected value and text
- Numberic Combo: Press '1' by using keyboard and press Tab, it wont show the selected value and text
Code for above requirement:
1) Alphabet Combo:
@(Html.Kendo().ComboBox()
.Name("AlphabetCombo")
.Suggest(true)
.Filter("StartsWith").MinLength(0)
.HighlightFirst(true)
.Placeholder("Select fabric...")
.DataTextField("Text")
.DataValueField("Value")
.BindTo(new List<SelectListItem>() {
new SelectListItem() {
Text = "Select", Value = "0"
},
new SelectListItem() {
Text = "A-1", Value = "1"
},
new SelectListItem() {
Text = "B-2", Value = "2"
},
new SelectListItem() {
Text = "C-3", Value = "3"
},
new SelectListItem() {
Text = "D-4", Value = "4"
}
})
.SelectedIndex(0)
.Events(events =>
{
events.Change("Combo_Change");
})
)
2) Numeric Combo:
@(Html.Kendo().ComboBox()
.Name("SampleData2")
.Suggest(true)
.Filter("StartsWith").MinLength(0)
.HighlightFirst(true)
//.Placeholder("Select fabric...")
.DataTextField("Text")
.DataValueField("Value")
.BindTo(new List<SelectListItem>() {
new SelectListItem() {
Text = "Select", Value = "0"
},
new SelectListItem() {
Text = "1-A", Value = "1"
},
new SelectListItem() {
Text = "2-B", Value = "2"
},
new SelectListItem() {
Text = "3-C", Value = "3"
},
new SelectListItem() {
Text = "4-D", Value = "4"
}
})
.SelectedIndex(0)
.Events(events =>
{
events.Change("Combo_Change");
})
)
3) Label to show selected value and text
<b>Selected Value is : </b> <label id="lblSelectedValue" runat="server"></label>
4) OnChange Event: JavaScript code
<script language="javascript" type="text/javascript">
function Combo_Change(e) {
var combo = e.sender;
$('#lblSelectedValue').text(combo.value() + ', ' + combo.text());
}
</script>
Please help me to resolve the issue. Thanks in advance.
.