Hi,
I have a custom class with a few strings and a list My grid is bound to a collection of my custom class and one of the columns is for the list.count. When the Grid renders, the column is empty. When reviewing the html code for the Grid, I discovered that the object type of list.count is now "object", see below:
{"Provider":{"type":"string"},"Type":{"type":"string"},"Bills":{"type":"object"}
Where bills is a List<>.
Hi everyone,
I've created a Grid Hierarchy here..I was able to get the column values from my Parent Grid(CustomerGrid) to use it on a ClientTemplate for example
(@Html.ActionLink(
"Add Order"
,
"AddOrder"
,
"Customer"
,
new
{ customerId =
"#= CustomerId#"
},
null
).ToHtmlString()).
But when I'm trying to adapt this kind of code, now getting the customerOrderId field from my Child Grid and use it on my ClientTemplate for example
(@Html.ActionLink(AmsStrings.LabelEditAmendment,
"EditOrder"
,
"CustomerOrder"
,
new
{ orderId =
"#= OrderId#"
},
null
).ToHtmlString())
@(Html.Kendo().Grid<customerviewmodel>
()
.Name(
"CustomerGrid"
)
.Columns(columns =>
{
columns.Bound(item => item.CustomerId).Hidden(
true
);
columns.Bound(item => item.Name);
columns.Template(t => { })
.Title(
""
)
.Width(120)
.ClientTemplate("<div
class
=
'btn-group'
>
" +
"<a class='btn btn-default btn-sm dropdown-toggle' data-toggle='dropdown'> Action <span class='caret'></span></a>"
+
"<ul
class
=
'dropdown-menu'
>
" +
"
<li>
" + (@Html.ActionLink("
Add Order
", "
AddOrder
", "
Customer
", new { customerId = "
#= CustomerId#
" }, null).ToHtmlString()) + "
</li>" +
"
</ul>
</div>");
})
.Selectable(selectable =>
{
selectable.Enabled(
true
);
selectable.Mode(GridSelectionMode.Single);
})
.ClientDetailTemplateId(
"template"
)
.DataSource(datasource => datasource.Ajax()
.Model(model =>
{
model.Id(m => m.CustomerId);
})
.Read(read => read.Action(
"CustomerDataSource"
,
"Customer"
)))
.Sortable())
<script id=
"template"
type=
"text/x-kendo-template"
>
@(Html.Kendo().Grid
<CustomerOrderViewModel>
()
.Name(
"grid_#=CustomerId#"
)
.Columns(columns =>
{
columns.Bound(item => item.OrderId).Hidden(
true
);
columns.Bound(item => item.OrderName);
columns.Template(@<text></text>)
.Title(
""
)
.Width(100)
.ClientTemplate("<div
class
=
'btn-group'
>
" +
"<a class='btn btn-default btn-sm dropdown-toggle' data-toggle='dropdown'>Action<span class='caret'></span></a>"
+
"<ul
class
=
'dropdown-menu'
>
" +
"
<li>
" + (@Html.ActionLink("
Edit
", "
EditOrder
", "
CustomerOrder
", new { orderId = "
#= OrderId#
" }, null).ToHtmlString()) + "
</li>" +
"
<li>
" + (@Html.ActionLink("
View
", "
ViewOrder
", "
CustomerOrder
", new { orderId = "
#= OrderId#
" }, null).ToHtmlString()) + "
</li>" +
"
</ul>
</div>");
})
.Editable(editable => editable.Enabled(
false
))
.Sortable()
.Selectable(selectable =>
{
selectable.Enabled(
true
);
selectable.Mode(GridSelectionMode.Single);
})
.DataSource(datasource => datasource
.Ajax()
.ServerOperation(
false
)
.PageSize(5)
.Model(model => model.Id(p => p.OrderId))
.Read(read => read.Action(
"CustomerOrderDataSource"
,
"CustomerOrder"
,
new
{ customerOrderId =
"#=customerId#"
})))
.ToClientTemplate())
</script>
I found out that defining "Editable(false)" for a model field doesn't seem to work when I've chosen GridEditMode.PopUp:
@(Html.Kendo().Grid<Pharmacy>()
.Columns(columns => ...)
.Editable(editable => editable.Mode(GridEditMode.PopUp))
.DataSource(dataSource => dataSource
.Ajax()
.Model(model =>
{
model.Id(p => p.Id);
model.Field(p => p.Id).Editable(
false
);
model.Field(p => p.MyReadOnlyField).Editable(
false
);
}))
)
In this case, the "Id" field and the "MyReadOnlyField" field will be shown in the popup as editable - which obviously is not the expected behavior.
Is this done intentional or is it a bug that Model definition doesn't work correctly with PopUp edit mode? Of course I can define a custom template, but that's not what I really want... from my view it's a bug or missing feature.
Thanks in advance,
Dimitrij
Does ASP.NET MVC scheduler support integration with google calender or outlook?
Thank you..
Hi,
I'm Thinking of moving from kendo ui html5 to the mvc version but I am worried about performance problem when moving to large scale (2,000,000 + users per month)
Has anybody experienced issues with the MVC edition of kendo that might not happen in the Kendo UI html5 version?
Thanks
Hi
please i have create my grid and set bootstrap theme to it and add 3 custom button on it and every thing works fine but buttons not centered in each grid cell it's align to right (i have add rtl css) as you can see in attached image
so please how can i set them center vertically and Horizontally in each grid cell ?
my attempt (Where I have Kendo DropDownList 1 as #Type and Kendo DropDownList 2 as #Units:
$('#Type').change(function (e) {
//if (e.target.value == "Electirc") {
var val = e.target.value;
var ddL = $('#Units').data("kendoDropDownList")
if (val == "Electric") {
ddl.dataSource.data({Text:"-", value:"null"},{Text:"kW", value:"kW"},{Text:"GJ", value:"GJ"})
//$("#Units").html("<option value='null'>item1:-</option><option value='kW'>item1: kW</option><option value='GJ'>item1: GJ</option>");
}
})
The goal would be to have the contents of DDL2 to change based on the selection by DDL1
I'm starting to build a Telerik UI for ASP.NET MVC project, just like the Grid Demo on http://demos.telerik.com/aspnet-mvc/
And i got this error when i debug project.
What problem?