Hi all:
We have a functional requirement to be able to edit the data in a column inside a kendo grid, by selecting a different header.
For example, let's say we have a kendo grid that has six columns.
Name City Class etc
We need the ability for a user (with the given permission) to select a different option for each header column.
Let's say they decide that they don't want "Class" as the third header/column. We'd like the user to be able to click into the header, a dropdown appear and then the user can select a different data source. Once selected the grid would update with the new data in the third column.
Anyone able to point me in the right direction? We also need to be able to reorder the kendo columns but I see that already with the Grid/Column reordering drag drop feature which is perfect.
Thanks!
Hi
How can I hide the Excel Export button in runtime? Depending on the logged in user I have to hide and show the Export Excel button.
Would you have some sample code?
In one of our projects, we are using Kendo UI Q2 and we cannot upgrade because of IE8 support and we need Export to Excel & Export to PDF features. So we decided to take these features to server side.
By googling, I found following sample projects from github:
https://github.com/telerik/ui-for-aspnet-mvc-examples/tree/master/grid/excel-export-server-side
https://github.com/telerik/ui-for-aspnet-mvc-examples/tree/master/grid/pdf-export-server-side
These seem to be helping but in the PDF part I see that iTextSharp is used and it's commercial license is NOT FREE. What I want to confirm is that by having a valid license of Telerik DevCraft, can we use iTextSharp commercially or do we need separate license for it?
Any other help or solution will be highly appreciated.
@(Html.Kendo().ComboBox()
.Name("fabric")
.Filter("contains")
.Placeholder("Select fabric...")
.DataTextField("Text")
.DataValueField("Value")
.DataSource(source =>
source.Read(read =>
{
read.Url("http://localhost:59590/api/Search/LoadonDemand");
}).ServerFiltering(true))
.HighlightFirst(true)
.IgnoreCase(true)
Is it possible to mask a phone number with or without an extension? I'm looking for:
(612) 555-1212
or
(612) 555-1212 ext. 5
or
(612) 555-1212 ask for Larry
Basically, the beginning of the string must be formatted as a phone number, but the user can enter whatever they want after that.
Can I do it?
Thanks!
I have a dynamic model below is the cshtml code, is line editing possible with dynamic model ?
@(Html.Kendo().Grid<dynamic>()
.Name(
"requestCapacity"
)
.Columns(columns =>
{
foreach
(var c
in
Model)
{
if
(c.Equals(
"Week Starting"
))
columns.Template(@<text> </text>).ClientTemplate(@
"<span class='k-widget k-datepicker' style='width: 150px;'><span class='k-picker-wrap k-state-default'><input id='datepicker' style='width: 100%;' data-role='datepicker' type='text' class='k-input' role='combobox' aria-expanded='false' aria-owns='datepicker_dateview' aria-disabled='false' aria-readonly='false' aria-activedescendant='270cfa37-b189-46a8-b0ea-857df06f84ab_cell_selected'><span unselectable='on' class='k-select' role='button' aria-controls='datepicker_dateview'><span unselectable='on' class='k-icon k-i-calendar'>select</span></span></span></span>"
).Width(150).Title(c.Key);
else
columns.Template(@<text>c</text>).Title(c.Key);
}
columns.Command(command => { command.Edit(); command.Destroy(); }).Width(200);
}
)
.Editable(editable => editable.Mode(GridEditMode.PopUp))
.HtmlAttributes(
new
{ style =
"height:auto;width:85%;align:center;margin:0 auto"
})
.Pageable()
.ToolBar(toolbar => toolbar.Create().Text(
"Add"
))
.Sortable()
.Scrollable().EnableCustomBinding(
true
)
.DataSource(dataSource => dataSource
.Ajax().Model(model =>model.Id(
"ID"
)
)
.PageSize(10)
.Events(events => events.Error(
"error_handler"
))
.Create(update => update.Action(
"EditingInline_Update"
,
"RequestCapacity"
,
new
{testing=
"#=dataItem#"
}).Type(HttpVerbs.Post))
.Read(read => read.Action(
"PopulateRequest"
,
"RequestCapacity"
).Type(HttpVerbs.Post))
.Update(update => update.Action(
"EditingInsline_Update"
,
"RequestCapacity"
,
"#=dataItem#"
).Type(HttpVerbs.Post))
.Destroy(update => update.Action(
"EditingInline_Destroy"
,
"Capacity"
))
)
)
controller code.
public
ActionResult RequestCapacityPopUp()<br> {<br> var dynamicBinding =
new
List<
string
>(){
"Week Starting"
};<br>
using
(var dataModel =
new
CapacityPlannerEntities())<br> {<br>
foreach
(var team
in
dataModel.Teams)<br> {<br> dynamicBinding.Add(team.TeamName);<br> }<br> }<br>
return
View(dynamicBinding);<br> }
Hi
How do I pass a value from the button .content
@(Html.Kendo().Button()
.Name("p14")
.HtmlAttributes(new { type = "button" })
.Content("135")
.Events(ev => ev.Click("onClickPol")))
<script>
function onClickPol(e) {
//This dos not work, I want to retrieve the name, content of that button what n this case is 135
var xContent = $(e.event.target).closest(".k-button").attr("textContent")
}
</script>