or
@(Html.Kendo().DropDownList()
.Name("cbAccount")
.HtmlAttributes(new { style = "width: 250px" })
.DataTextField("Descr")
.DataValueField("ID")
.DataSource(source =>
{
source.Read(read =>
{
read.Action("GetListaAccount", "Common");
}).ServerFiltering(false);
})
)
<
form
class
=
"configuration k-widget k-header"
>
<
span
class
=
"configHead"
>Animation Settings</
span
>
<
ul
class
=
"options"
>
<
li
>
<
input
name
=
"animation"
type
=
"radio"
@(ViewBag.animation == "toggle" ? "checked=\"checked\"" : "")
value
=
"toggle"
/> <
label
for
=
"toggle"
>toggle animation</
label
>
</
li
>
<
li
>
<
input
name
=
"animation"
type
=
"radio"
@(ViewBag.animation != "toggle" ? "checked=\"checked\"" : "")
value
=
"expand"
/> <
label
for
=
"expand"
>expand animation</
label
>
</
li
>
<
li
>
@Html.CheckBox("opacity", (bool)ViewBag.opacity) <
label
for
=
"opacity"
>animate opacity</
label
>
</
li
>
</
ul
>
<
button
class
=
"k-button"
>Apply</
button
>
</
form
>
<
h3
>Conversation history</
h3
>
@(Html.Kendo().TabStrip()
.Name("tabstrip")
.HtmlAttributes(new { style = "width:500px" })
.Animation(animation =>
{
animation.Enable(ViewBag.animation == "expand" || ViewBag.opacity);
animation.Open(config =>
{
if (ViewBag.animation != "toggle")
{
config.Expand();
}
if (ViewBag.opacity == true)
{
config.Fade(FadeDirection.In);
}
config.Duration(AnimationDuration.Fast);
});
})
.SelectedIndex(0)
.Items(panelbar =>
{
panelbar.Add().Text("First Tab")
.Content(@<
text
>
<
p
>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer felis libero, lobortis ac rutrum quis, varius a velit. Donec lacus erat, cursus sed porta quis, adipiscing et ligula. Duis volutpat, sem pharetra accumsan pharetra, mi ligula cursus felis, ac aliquet leo diam eget risus. Integer facilisis, justo cursus venenatis vehicula, massa nisl tempor sem, in ullamcorper neque mauris in orci.</
p
>
</
text
>);
panelbar.Add().Text("Second Tab")
.Content(@<
text
>
<
p
>Ut orci ligula, varius ac consequat in, rhoncus in dolor. Mauris pulvinar molestie accumsan. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; Aenean velit ligula, pharetra quis aliquam sed, scelerisque sed sapien. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos. Aliquam dui mi, vulputate vitae pulvinar ac, condimentum sed eros.</
p
>
</
text
>);
panelbar.Add().Text("Third Tab")
.Content(@<
text
>
<
p
>Aliquam at nisl quis est adipiscing bibendum. Nam malesuada eros facilisis arcu vulputate at aliquam nunc tempor. In commodo scelerisque enim, eget sodales lorem condimentum rutrum. Phasellus sem metus, ultricies at commodo in, tristique non est. Morbi vel mauris eget mauris commodo elementum. Nam eget libero lacus, ut sollicitudin ante. Nam odio quam, suscipit a fringilla eget, dignissim nec arcu. Donec tristique arcu ut sapien elementum pellentesque.</
p
>
</
text
>);
panelbar.Add().Text("Fourth Tab")
.Content(@<
text
>
<
p
>Maecenas vitae eros vel enim molestie cursus. Proin ut lacinia ipsum. Nam at elit arcu, at porttitor ipsum. Praesent id viverra lorem. Nam lacinia elementum fermentum. Nulla facilisi. Nulla bibendum erat sed sem interdum suscipit. Vestibulum eget molestie leo. Aliquam erat volutpat. Ut sed nulla libero. Suspendisse id euismod quam. Aliquam interdum turpis vitae purus consectetur in pulvinar libero accumsan. In id augue dui, ac volutpat ante. Suspendisse purus est, ullamcorper id bibendum sed, placerat id leo.</
p
>
</
text
>);
panelbar.Add().Text("Fifth Tab")
.Content(@<
text
>
<
p
>Fusce nec mauris enim, non pharetra neque. Etiam elementum nunc ut velit fermentum sed porta eros dignissim. Duis at nisl eros. Integer arcu nisl, accumsan non molestie at, elementum nec odio. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Quisque arcu odio, aliquam vel viverra ac, varius at sapien. Nullam elementum nulla non libero interdum vestibulum at in lacus. Curabitur ac magna ac lacus dapibus convallis non at turpis.</
p
>
</
text
>);
})
)
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
namespace BizSpark.Controllers
{
public class HomeController : Controller
{
//
// GET: /Home/
public ActionResult Index(string animation, bool? opacity)
{
ViewBag.animation = animation ?? "expand";
ViewBag.opacity = opacity ?? true;
return View();
}
}
}
<!DOCTYPE html>
<
html
>
<
head
>
<
meta
charset
=
"utf-8"
/>
<
meta
name
=
"viewport"
content
=
"width=device-width"
/>
<
title
>@ViewBag.Title</
title
>
@Styles.Render("~/Content/css")
@Scripts.Render("~/bundles/modernizr")
@Styles.Render("~/Content/kendo/css")
@Scripts.Render("~/bundles/jquery")
@Scripts.Render("~/bundles/kendo")
</
head
>
<
body
>
@RenderBody()
@RenderSection("scripts", required: false)
</
body
>
</
html
>
public class BundleConfig
{
// For more information on Bundling, visit http://go.microsoft.com/fwlink/?LinkId=254725
public static void RegisterBundles(BundleCollection bundles)
{
bundles.Add(new ScriptBundle("~/bundles/jquery").Include(
"~/Scripts/jquery-{version}.js"));
bundles.Add(new ScriptBundle("~/bundles/jqueryui").Include(
"~/Scripts/jquery-ui-{version}.js"));
bundles.Add(new ScriptBundle("~/bundles/jqueryval").Include(
"~/Scripts/jquery.unobtrusive*",
"~/Scripts/jquery.validate*"));
// Use the development version of Modernizr to develop with and learn from. Then, when you're
// ready for production, use the build tool at http://modernizr.com to pick only the tests you need.
bundles.Add(new ScriptBundle("~/bundles/modernizr").Include(
"~/Scripts/modernizr-*"));
bundles.Add(new ScriptBundle("~/bundles/kendo")
.Include("~/Scripts/kendo.all.min.js") // or kendo.all.min.js kendo.web.min.js
.Include("~/Scripts/kendo.aspnetmvc.min.js")
);
bundles.Add(new StyleBundle("~/Content/css").Include("~/Content/site.css"));
bundles.Add(new StyleBundle("~/Content/themes/base/css").Include(
"~/Content/themes/base/jquery.ui.core.css",
"~/Content/themes/base/jquery.ui.resizable.css",
"~/Content/themes/base/jquery.ui.selectable.css",
"~/Content/themes/base/jquery.ui.accordion.css",
"~/Content/themes/base/jquery.ui.autocomplete.css",
"~/Content/themes/base/jquery.ui.button.css",
"~/Content/themes/base/jquery.ui.dialog.css",
"~/Content/themes/base/jquery.ui.slider.css",
"~/Content/themes/base/jquery.ui.tabs.css",
"~/Content/themes/base/jquery.ui.datepicker.css",
"~/Content/themes/base/jquery.ui.progressbar.css",
"~/Content/themes/base/jquery.ui.theme.css"));
// The Kendo CSS bundle - replace "2012.3.1315" with the Kendo UI version that you are using
bundles.Add(new StyleBundle("~/Content/css")
.Include("~/Content/kendo.common.*")
.Include("~/Content/kendo.uniform.min.*")
);
}
}
}
01.
@(Html.Kendo().Grid<
Sanwin.ViewModels.Customer.CustomerInfoModel
>()
02.
.Name("user-Grid")
03.
.EnableCustomBinding(true)
04.
//.BindTo(Model.Customers)
05.
.Events(ev=>ev.Edit("edit"))
06.
.Columns(columns =>
07.
{
08.
09.
columns.Bound(p => p.FirstName).Width(150).Title("First Name");
10.
columns.Bound(p => p.LastName).Width(150).Title("Last Name");
11.
columns.Bound(p => p.Email).Width(150).Title("Email");
12.
13.
columns.Bound(p => p.Ranking).Width(150).Title("Ranking");
14.
// columns.ForeignKey(p => p.RankingId, rankingList,"Value","Text").Width(150).Title("Ranking");
15.
columns.Bound(p => p.Gender1).Title("Gender");
16.
17.
columns.Bound(x => x.UserName).Width(100);
18.
columns.Bound(x => x.Password).Width(100);
19.
20.
21.
columns.Command(command => { command.Edit(); command.Destroy(); }).Width(100).Title("Action");
22.
})
23.
.ToolBar(toolBar => toolBar.Create())
24.
.Editable(editable => editable.Mode(GridEditMode.InLine))
25.
.Pageable()
26.
.Sortable()
27.
28.
.DataSource(dataSource => dataSource
29.
.Ajax()
30.
.Events(events => events.Error("error_handler"))
31.
.Model(model => model.Id(p => p.Id))
32.
.Create(update => update.Action("EditingInline_Create", "Customer", ViewBag.CustomerInfoModel))
33.
.Read(read => read.Action("UsersList", "Customer"))
34.
.Update(update => update.Action("EditingInline_Update", "Customer"))
35.
.Destroy(update => update.Action("EditingInline_Destroy", "Customer"))
37.
))
01.
@using System.Web.Mvc;
02.
@using Kendo.Mvc.UI;
03.
@using Sanwin.Services.Catalog;
04.
05.
@model string
06.
07.
@{
08.
var _rankingService = DependencyResolver.Current.GetService<
IRankingService
>();
09.
var rankings = _rankingService.GetAllRanking().Select(c => new { Id = c.Rankings, Name = c.DisplayText }).ToList();
10.
rankings.Insert(0, new { Id = 0, Name = "--select--" });
11.
12.
var rankingList=new List<
SelectListItem
>();
13.
foreach(var r in rankings)
14.
{
15.
rankingList.Add(new SelectListItem
16.
{
17.
Text=r.Name,
18.
Value=r.Id.ToString()
19.
});
20.
}
21.
}
22.
@*@(Html.Kendo().DropDownList().Name("Ranking").DataSource(
23.
ds=>ds.Read("RankingList","Catalog")
24.
)
25.
//.SelectedIndex(0)
26.
.DataTextField("Name").DataValueField("Id")
27.
//.Value(Model.ToString())
28.
)*@
29.
30.
@(Html.Kendo().DropDownList().Name("Ranking").BindTo(rankingList)
31.
)
1.
[UIHint("Ranking")]
2.
public string Ranking { get; set; }
01.
for (int i = 0; i <
customers.Count
; i++)
02.
{
03.
if (!customerIds.Contains(customers[i].Id))
04.
{
05.
Customer
manager
=
null
;
06.
string
siteName
=
""
;
07.
if (customers[i].ManagerCustomerId.HasValue && customers[i].ManagerCustomerId > 0)
08.
{
09.
manager = _customerService.GetCustomerById(customers[i].ManagerCustomerId.Value);
10.
siteName = manager.EntityId.HasValue ? _customerService.GetEntityById(manager.EntityId.Value).Title : string.Empty;
11.
}
12.
var customermodel = new CustomerInfoModel
13.
{
14.
Id = customers[i].Id,
15.
Email = customers[i].Email,
16.
UserName = customers[i].UserName,
17.
Active = customers[i].IsActive,
18.
FirstName = customers[i].FirstName,
19.
LastName = customers[i].LastName,
20.
Ranking = customers[i].Ranking.HasValue && customers[i].Ranking.Value > 0 ? _rankingService.GetRankingByRank(customers[i].Ranking.Value).DisplayText : "",
21.
GroupName = customers[i].CustomerGroups.FirstOrDefault() != null ? customers[i].CustomerGroups.FirstOrDefault().Group.Name : string.Empty,
22.
Manager = manager != null ? siteName + "-" + manager.UserName : string.Empty,
23.
Gender1 = customers[i].Gender,
24.
RankingId = customers[i].Ranking.HasValue ? customers[i].Ranking.Value : 0,
25.
26.
};
27.
customerInfoModel.Add(customermodel);
28.
customerIds.Add(customers[i].Id);
29.
}
30.
}
31.
32.
33.
34.
return Json(customerInfoModel.ToDataSourceResult(request));
function
deleteRow(e) {
/* How prevent delete row in client side too - return false or e.preventDefault cancel remote delete call but row was removed from view */
alertify.confirm(
"dddd"
,
function
(result) {
if
(result) {
e.sender.removeRow(e.row);
/* not removing row */
}
});
return
false
;
}
@(Html.Kendo().Grid(Model.Franchises)
.Name("franchisesGrid")
.Columns(columns =>
{
columns.Bound(p => p.Name);
columns.Bound(p => p.CompanyName);
columns.Command(command =>
{
command.Edit().Text(LocalizationResources.Update).CancelText(LocalizationResources.Cancel).UpdateText(LocalizationResources.OK);
command.Destroy().Text(LocalizationResources.Remove);
});
})
.Groupable()
.Pageable()
.Sortable()
.Scrollable()
.Filterable()
.ColumnMenu()
.ToolBar(toolbar =>
{
toolbar.Template(@<
text
>
<
div
class
=
"row control-group"
>
<
div
class
=
"span10"
>
<
a
class
=
"btn k-btn-add k-grid-add"
><
span
class
=
"k-icon k-add"
></
span
>@LocalizationResources.Create</
a
>
</
div
>
</
div
>
</
text
>);
})
.Resizable(resize => resize.Columns(true))
.Reorderable(reorder => reorder.Columns(true))
.Editable(editable =>
{
editable.Mode(GridEditMode.PopUp).Window(builder => builder.Title("Title"));
editable.DisplayDeleteConfirmation(false);
})
.Events(builder => builder.Remove("deleteRow"))
.DataSource(dataSource => dataSource
.Ajax()
.Events(events => events.Error("error_handler"))
.Model(model => model.Id(p => p.Id))
.Read("Get", "Home")
.Create("Create", "Home")
.Update("Update", "Home")
.Destroy("Remove", "Home")))
function
formatXAxis(value) {
var
hr = Math.floor(value);
var
min = value - hr;
var
newval = hr + (min * 6 / 10);
return
$.telerik.formatString(
'{0:N}'
, newval).replace(
'.'
,
':'
).replace(
','
,
':'
);
}