Telerik Forums
UI for ASP.NET MVC Forum
5 answers
166 views
Hello again!

The restriction works really well for drag & drop, but I'm having troubles with preventing recurring events to overlap. I can do this serverside, but that's not really the friendly way. Anyone got any tips?

// Pär
Vladimir Iliev
Telerik team
 answered on 20 Jan 2014
7 answers
296 views
In regards to this thread:
               
http://www.kendoui.com/forums/kendo-ui-complete-for-asp-net-mvc/general-discussions/vs2013-compatibility.aspx

I am looking for an ETA on the Kendo MVC Extensions for VS 2013 feature as its original ETA was mid-November. I am looking to upgrade my  Kendo  VS Solution from VS 2010 to  VS 2013 and have the ability to us the automatic updater as required.

Petar
Telerik team
 answered on 20 Jan 2014
2 answers
679 views
I'm using a combobox to create a searchable list of employees from where the user needs to select one.
If there is a false name entered they should get a warning (which already works) and the first person in the list needs to be selected. I Was trying to do that like this:

<div class="editor-field edit-project">
(Html.Kendo().ComboBox()
.Name("PersonId")
.HtmlAttributes(new { @class = "input-project" })
.DataTextField("Fullname").DataValueField("Id")
.DataSource(source => { source.Read(read => { read.Action("GetPeople", "Project"); }); })
.MinLength(3)
.Filter("contains")
.Events(ev => ev.Change("checkcombobox")))
</div>
And in javascript i'm doing this:

function checkcombobox(e)
{
    if (this.value() && this.selectedIndex == -1) {
        alert('Gelieve een geldige persoon te selecteren');
        var cbx = $("#PersonId").data("kendoComboBox").Selected(0);
 
    }
}
Could anyone help?

Thanks in advance
Tim
Top achievements
Rank 1
 answered on 20 Jan 2014
1 answer
94 views
Kendo UI Complete ASP.NET  Verison : 2013.3.1316 
download the code library  from peter post
add the datetime field in the mode


this code library post everything except datetime field.. please help

dattime filed always remians= 01/01/0001 if you change it from datepicker and then post the form to the controller



--------DateTime Filed PostBack value stays 01/01/0001 Issue-------------------

This approach does not work any more with new kendo contorls library i do'nt know if its works for the previous verions.

if you have datetime filed in your model

Model
{
 public string UserName { get; set; }
 public string UserPhone { get; set; }
 public datetime workDate { get; set; }      <--this will be 01/01/0001 or Null on postback
}

when you do this your view

 columns.Bound(item => item.workDate ).Title("Wok Date").Encoded(true).ClientTemplate("#= WorkDate #" +
                                        "<input type='hidden' name='gridItems[#= index(data) #].WorkDate' value='#= WorkDate #' />");


  <input type="submit" value="Save" id="save"/>


Fails on Postback
CreateWorkOrder(WorkOrderContainer model)
{
 var mydate =model.workDate;   <---- your mydate will be 01/01/0001 Or  null always
}

please help any one or if there is other approch to post the data to server where new entry will be made on action result

regards
Shahzad ilyas


Shahzad
Top achievements
Rank 1
 answered on 19 Jan 2014
6 answers
380 views
I'm attempting to use a custom editor template in a kendo scheduler but have 2 issues.  

1.  I have a mutliselect in the editor template, and am unable to get the selected options to bind and be posted to the server.
2.  My ajax requests are wonky.  
  2a.  What I'm seeing is when i click save it fires the datasource.create method multiple times (sometimes twice sometimes 3 times) and posts the same data to the server.
  2b.  When i attempt to delete an event the datasource.create endpoint is hit and not the datasource.destroy method.


I've attached a solution with an example.  I've neven used these custom editor templates before so i think its likely im not binding it properly.

Thanks,
Chris
  
ShareDocs
Top achievements
Rank 1
 answered on 19 Jan 2014
3 answers
319 views
When trying to edit a simple object that is part of my model in a grid in popup edit mode the dropdownlist editor doesn't appear.  It does appear when the grid is in inline edit mode.  Below is the relevant code snippets from a sample project I created to reproduce this behavior.  I can attach the sample project if need be.

public class OrderModel
    {
        public int OrderNumber { get; set; }
        public int Quantity { get; set; }
        public string Item { get; set; }
        [UIHint("SupplierEditor")]
        public SupplierModel Supplier { get; set; }
    }

    public class SupplierModel
    {
        public int SupplierID { get; set; }
        public string SupplierName { get; set; }
    }


@model KendoUIMvcApplication2.Models.SupplierModel

@(Html.Kendo().DropDownList().Name("cboSupplier")
        .DataTextField("SupplierName")
        .DataValueField("SupplierID")
        .DataSource(d => d
            .Read("GetSuppliers", "Home")
            )
        )

@(Html.Kendo().Grid<KendoUIMvcApplication2.Models.OrderModel>().Name("gridOrdersPopup").Columns(c =>
    {
        c.Bound(model => model.OrderNumber).Title("Order #");
        c.Bound(model => model.Item);
        c.Bound(model => model.Quantity);
        c.Bound(model => model.Supplier).ClientTemplate("#= Supplier.SupplierName #");
        c.Command(command => { command.Edit(); command.Destroy(); });
    })
    .DataSource (d => d
        .Ajax()
        .ServerOperation(false)
        .Read(read => read.Action("GetOrders", "Home"))
        .Create(update => update.Action("CreateOrder", "Home"))
        .Update(update => update.Action("UpdateOrder", "Home"))
        .Destroy(update => update.Action("DeleteOrder", "Home"))
        .Model(model => model.Id(m => m.OrderNumber))
        )
    .Editable(editable => editable.Mode(GridEditMode.PopUp))
    .ToolBar(toolbar => toolbar.Create())
    .Selectable(s => s.Mode(GridSelectionMode.Single))
    .Sortable()
    .Scrollable(s => s.Height(200))
    .Resizable(resize => resize.Columns(true))
    )

Vladimir Iliev
Telerik team
 answered on 17 Jan 2014
1 answer
170 views
I can't get date editing to work within my grid.

Date formatting is set to yyyy-MM-dd everywhere I can think of

In the viewmodel I have EstCommenceDate set as follows

[Required]
[DataType(DataType.Date)]
[DisplayFormat(ApplyFormatInEditMode = true, DataFormatString = "{0:yyyy-MM-dd}")]
[Display(ResourceType = typeof(Resources), Name = "OpportunityGridViewModel_EstCommenceDate", Description = "OpportunityGridViewModel_EstCommenceDate")]
[UIHint("GridDateColumn")]
public DateTime? EstCommenceDate { get; set; }

In GridDateColumn.cshtml I have
@Html.Kendo().DatePickerFor(m => m).Format("yyyy-MM-dd")

When I edit a date and try and save changes why does it give this attached error?  Why is the date in US format?

Vladimir Iliev
Telerik team
 answered on 17 Jan 2014
1 answer
381 views
Hi,
I'm trying to set the editor so it won't include the 'allday' and 'repeater' sections, but I do want an atendees multiselect like the one you use in your resource example
I've set a template with the start and end date but i'm having trouble with getting the multiselect to work and specially I'm unable to pull the atendees for each event.

I've searched the web finding interesting examples like: this but I do want to use the mvc helper

any help will be appreciated
Vladimir Iliev
Telerik team
 answered on 17 Jan 2014
2 answers
621 views
Related to this question, I want to achieve the same behavior inside the ListView instead of a kendo Grid. My attempt is here. The edit template switches to different controls based on the value in the model at the beginning of the edit. But the problem is that I can't find a way to switch the 2nd field based on the user selection in the first field.  Also if I change the first field to an 'AutoComplete' list, can I still follow the same pattern?  One answer to this question didn't solve the proper data binding.  I appreciate any help to solve this.

Thank you

Code:

<div class="row">
<div class="col-xs-6 col-md-4">
<!-- Inputs -->
<div class="demo-section">
<a class="k-button k-button-icontext k-add-button" href="#"><span class="k-icon k-add"></span>Add new record</a>
</div>

<div id="listView"></div>

<script type="text/x-kendo-tmpl" id="template">
<div class="product-view k-widget">
<div class="edit-buttons">
<a class="k-button k-button-icontext k-edit-button" href="\\#"><span class="k-icon k-edit"></span></a>
<a class="k-button k-button-icontext k-delete-button" href="\\#"><span class="k-icon k-delete"> </span></a>
</div>
<dl>
<dt>Type</dt>
<dd> #: typeTitle# </dd>
<dt>Value</dt>
<dd>
# if (typeTitle === "DateTime") { #
#: kendo.toString(name, "MM/dd/yyyy hh:mm")#
#} else { #
#:name #
# } #
</dd>
</dl>
</div>
</script>

<script type="text/x-kendo-tmpl" id="editTemplate">
<div class="product-view k-widget">
<div class="edit-buttons">
<a class="k-button k-button-icontext k-update-button" href="\\#"><span class="k-icon k-update"></span></a>
<a class="k-button k-button-icontext k-cancel-button" href="\\#"><span class="k-icon k-cancel"></span></a>
</div>
<dl>
<dt>Key</dt>
<dd>
<select data-role="dropdownlist"
data-text-field="title"
data-value-field="id"
data-source="_typeDataSource"
data-bind="value: typeTitle"
name="InputType"
data-change="dropdownlist_change"
required="required"
validationmessage="required"></select>
<span data-for="InputType" class="k-invalid-msg"></span>
</dd>
<dt>Value</dt>
<dd>
<div id="divInputType">
# if (typeTitle === "DateTime") { #
<input data-role="datetimepicker" type="text" data-bind="value: name" data-format="MM/dd/yyyy hh:mm" name="InputValue" required="required" validationmessage="required" />
#} else { #
<input type="text" data-bind="value: name" name="InputValue" required="required" validationmessage="required" />
# } #
<span data-for="name" class="k-invalid-msg"></span>
</div>
</dd>
</dl>
</div>
</script>

</div>
<div class="col-sm-6 col-md-8">
<!-- Data -->
Diagnostics Data will be shown here.
</div>
</div>

<script>
_typeDataSource = new kendo.data.DataSource({
data: [{
id: 1,
title: "String"
}, {
id: 2,
title: "Number"
}, {
id: 3,
title: "DateTime"
}]
});

_peopleDataSource = new kendo.data.DataSource({
data: [{
id: 1,
name: "John",
typeId: 1,
typeTitle: "String"
}, {
id: 2,
name: "12345",
typeId: 2,
typeTitle: "Number"
}, {
id: 3,
name: "12/20/2013",
typeId: 3,
typeTitle: "DateTime"
}],
schema: {
model: {
id: "id",
fields: {
id: {
editable: false,
nullable: true
},
name: {
validation: {
required: true
}
},
typeTitle: "typeTitle"
}
}
}
});

listView = $("#listView").kendoListView({
dataSource: _peopleDataSource,
template: kendo.template($("#template").html()),
editTemplate: kendo.template($("#editTemplate").html())
}).delegate(".k-edit-button", "click", function (e) {
listView.edit($(this).closest(".product-view"));
e.preventDefault();
}).delegate(".k-delete-button", "click", function (e) {
listView.remove($(this).closest(".product-view"));
e.preventDefault();
}).delegate(".k-update-button", "click", function (e) {
listView.save();
e.preventDefault();
}).delegate(".k-cancel-button", "click", function (e) {
listView.cancel();
e.preventDefault();
}).data("kendoListView");

$(".k-add-button").click(function (e) {
listView.add();
e.preventDefault();
});

function dropdownlist_change(e) {
var value = this.value();
// Use the value of the widget

console.log(value);
//if (value == 2) {
// console.log('here');

// var secondColumn = $('#divInputType');
// secondColumn.empty();
// //var model = grid._modelForContainer(secondColumn);

// $("<input data-bind='value: Value '/>").appendTo(secondColumn).kendoDateTimePicker();
// kendo.bind(secondColumn, model);
//}
}
</script>
Saravanan
Top achievements
Rank 1
 answered on 16 Jan 2014
1 answer
245 views
we have an issue with the upload in our MVC application that the full path is pulled back in IE while FF & Chrome only have file name.  Can any one provide any input on this?  TIA
Dimo
Telerik team
 answered on 16 Jan 2014
Narrow your results
Selected tags
Tags
Grid
General Discussions
Scheduler
DropDownList
Chart
Editor
TreeView
DatePicker
ComboBox
Upload
MultiSelect
ListView
Window
TabStrip
Menu
Installer and VS Extensions
Spreadsheet
AutoComplete
TreeList
Gantt
PanelBar
NumericTextBox
Filter
ToolTip
Map
Diagram
Button
PivotGrid
Form
ListBox
Splitter
Application
FileManager
Sortable
Calendar
View
MaskedTextBox
PDFViewer
TextBox
Toolbar
Dialog
MultiColumnComboBox
DropDownTree
Checkbox
Slider
Switch
Notification
Accessibility
ListView (Mobile)
Pager
Security
ColorPicker
DateRangePicker
Wizard
Styling
Chat
DateInput
MediaPlayer
TileLayout
Drawer
SplitView
Template
Barcode
ButtonGroup (Mobile)
Drawer (Mobile)
ImageEditor
RadioGroup
Sparkline
Stepper
TabStrip (Mobile)
GridLayout
Badge
LinearGauge
ModalView
ResponsivePanel
TextArea
Breadcrumb
ExpansionPanel
Licensing
Rating
ScrollView
ButtonGroup
CheckBoxGroup
NavBar
ProgressBar
QRCode
RadioButton
Scroller
Timeline
TreeMap
TaskBoard
OrgChart
Captcha
ActionSheet
Signature
DateTimePicker
AppBar
BottomNavigation
Card
FloatingActionButton
Localization
MultiViewCalendar
PopOver (Mobile)
Ripple
ScrollView (Mobile)
Switch (Mobile)
PivotGridV2
FlatColorPicker
ColorPalette
DropDownButton
AIPrompt
PropertyGrid
ActionSheet (Mobile)
BulletGraph
Button (Mobile)
Collapsible
Loader
CircularGauge
SkeletonContainer
Popover
HeatMap
Avatar
ColorGradient
CircularProgressBar
SplitButton
StackLayout
TimeDurationPicker
Chip
ChipList
DockManager
ToggleButton
Sankey
OTPInput
ChartWizard
SpeechToTextButton
InlineAIPrompt
TimePicker
StockChart
RadialGauge
ContextMenu
ArcGauge
AICodingAssistant
SmartPasteButton
PromptBox
SegmentedControl
+? more
Top users last month
Miljana
Top achievements
Rank 2
Iron
Iron
Joel
Top achievements
Rank 3
Bronze
Bronze
Bronze
Cynthia
Top achievements
Rank 1
John
Top achievements
Rank 1
Iron
Mozart
Top achievements
Rank 1
Iron
Veteran
Want to show your ninja superpower to fellow developers?
Top users last month
Miljana
Top achievements
Rank 2
Iron
Iron
Joel
Top achievements
Rank 3
Bronze
Bronze
Bronze
Cynthia
Top achievements
Rank 1
John
Top achievements
Rank 1
Iron
Mozart
Top achievements
Rank 1
Iron
Veteran
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?