Telerik Forums
UI for ASP.NET MVC Forum
1 answer
292 views
Hi,

In my model I have the following property:
/// <summary>
 /// Get or set property for EffDt property.
 /// </summary>
 [DataMember]
[UIHint("EffDateEditor")]
public DateTime? EffDt { get; set; }

whereas my editor template is as follows:
@model DateTime?
@(Html.Kendo().DatePickerFor(m => m).Format("dd-MMM-yyyy"))

Lastly my grid partial has the following:
columns.Bound(p => p.EffDt)
                    .Format("{0:dd-MMM-yyyy}")
                    .Title("Effective Date")
                    .Sortable(false)
                    .Filterable(false)
                    .Width(120);

Now whether I add new data or edit existing data the date column is always throwing validation error as can be seen in the attached file.

Please help this is urgent.
Vladimir Iliev
Telerik team
 answered on 19 Mar 2013
2 answers
74 views
.Clear() seems to clear all tools. Anyway to clear a single tool?
Rod
Top achievements
Rank 1
 answered on 19 Mar 2013
1 answer
67 views
The combination of a Kendo-Menu together with own <ul> Tags on the view causes render problems in Internet Explorer 8, if you hover the mouse over the first Kendo-Menu-Entry. On hovering, the view seems to be refreshed and the content is cleared. So you get an empty view.

This bug only happens in Internet Explorer 8. The only workaround I found so far is to avoid <ul> tags in the view.

@Kendo-Team: Can you reproduce the bug or do you need any additional informations?

Petur Subev
Telerik team
 answered on 19 Mar 2013
2 answers
397 views
Hi there

Architecturally I'm a tad confused, but do confess to being new to both MVVM and KendoUI, but the sell from Telerik is that Kendo UI is really easy to start implementing and that the MVC server wrappers help you out by creating javascript for you.

What I'm confused about is how to use both of these together, or even if one should. The only reference I can find anywhere is here, but it doesn't really help. I've also looked through the examples but the relationship is still not clear.

If I understand it, the MVVM framework runs in the client browser in order to abstract responsibilities but also to bind the ViewModel to the data (using 'Observable').

On the other hand, the MVC wrappers seem to create widgets which are bound to datasources.

Do these two technologies work together and if so, in what scenarios should they be used thus? What are the advantages? In some sense it appears to me as though using the MVC wrappers and binding to datasources negates the need for a client-side MVVC pattern.

Are there any simple example projects of using the MVC server wrappers and the Kendo MVVC framework, that provides a clear understanding of the benefits, please?

Thanks so much,

Paul.
Paul
Top achievements
Rank 1
 answered on 19 Mar 2013
1 answer
183 views
So is this the only way to pass the value that has been selected back to the server ...seems like way too much glue code , I have to have a hidden field, then need to use JS to fill that field etc etc

Jay

<body>
    @using (Html.BeginForm("Index", "Home", FormMethod.Post))
    {
        @Html.HiddenFor(m => m.StartDate)
 
        @(Html.Kendo().Calendar()
                  .Name("calendarStart")
                  .Value(DateTime.Now)
              )
         
        @Html.HiddenFor(m => m.EndDate)
 
        @(Html.Kendo().Calendar()
                  .Name("calendarEnd")
                  .Value(DateTime.Now)
                  )
         
        <button name="button" value="save">Save Date</button>
    }
 
    <script>
        $(document).ready(function () {
 
            var calendarStart = $("#calendarStart").data("kendoCalendar");
            $("#StartDate").val((moment(calendarStart.value()).format("YYYY-MM-DD")));
 
            calendarStart.bind("change", function (e) {
                $("#StartDate").val((moment(this.value())).format("YYYY-MM-DD"));
             
            });
 
            var calendarEnd = $("#calendarStart").data("kendoCalendar");
            $("#EndDate").val((moment(calendarEnd.value()).format("YYYY-MM-DD")));
 
            calendarEnd.bind("change", function (e) {
                $("#EndDate").val((moment(this.value())).format("YYYY-MM-DD"));
            });
 
        });
    </script>
</body>
Petur Subev
Telerik team
 answered on 19 Mar 2013
3 answers
228 views
I am using a Kendo Window for my application, and I want to remove the default Close button from the header. I am using the Clear() method, which by definition should clear out all actions. But when I run my application, the close button is still present on the window.

Here is the Razor code that builds the wondow. Notice the Actions section. Any help would be greatly appreciated! 
@(Html.Kendo().Window()
    .Name("LoadingWindow")
    .Visible(false)
    .Title("Loading...")
    .Modal(true)
    .Height(150)
    .Width(300)
    .Actions(a => a.Clear())
    .Content(@<text>
                  <div id="loading-details">Loading Data. Please wait.
                      <div id="divLoaderGif">
                          <img src="@Url.Content("~/Content/themes/ajax-loader.gif")" alt="Loading... Please wait..." />
                      </div>
                  </div>
              </text>)
)
Dimiter Madjarov
Telerik team
 answered on 19 Mar 2013
1 answer
341 views
I'm having problems to add/edit/delete rows on a grid loaded from DataTable

I have something like the following code:
@(Html.Kendo().Grid<object>()
        .HtmlAttributes(new { style = "height: 80%;" })
        .Name("grid-records")
        .Columns(columns =>
        {
            columns.LoadSettings(Model.GridColumns);
            foreach (GridColumnSettings item in Model.GridColumns)
            {
                ModelFieldDescriptor modelField = new ModelFieldDescriptor();
                modelField.Member = item.Member;
                modelField.MemberType = item.MemberType;
                modelField.DefaultValue = null;
                modelField.IsEditable = true;              
                columns.Container.DataSource.Schema.Model.Fields.Add(modelField);
            }
            //columns.Command(command => { command.Edit(); command.Destroy(); }).HtmlAttributes(new { style = "float:right;" });
            columns.Command(command => command.Custom("ViewDetails"));
        })
        .Groupable()
        .Pageable()
        .Sortable()
        .Scrollable()
        .Filterable(Web.Helpers.KendoI18n.SetGridFilterableSettings)
        //.Editable(editable => editable.Mode(GridEditMode.InLine))
        .DataSource(dataSource => dataSource
            .Ajax()
            .Events(events => events.Error("error_handler"))
            .Read(read => read.Action("GetRecords", "Records", new { currentTableId = Model.CurrentTableId }))
            //.Update(update => update.Action("UpdateRecordFromGrid", "Design"))
            //.Destroy(destroy => destroy.Action("DeleteRecordFromGrid", "Design"))
        )
    )
In the above code if I uncomment the "commented lines" .. the exception is:

"Templates can be used only with field access, property access, single-dimension array index, or single-parameter custom indexer expressions." 

Could you tell me what I should do to enable CRUD operations on this case?

Thanks
Petur Subev
Telerik team
 answered on 18 Mar 2013
1 answer
127 views
Is it possible to have only create and destroy button BUT NO EDIT button shown in a grid?

I have tried not to include edit command but on addition, the update and cancel buttons are not shown.

regards
Iliana Dyankova
Telerik team
 answered on 18 Mar 2013
1 answer
214 views
Hi!
I have problem with client-side validation.  Even after I set Culture and it shows proper date format, when I submit page client-side validation fires error "The field Datum očitavanja must be a date.". Here is my code in view:

@model ISPIS.Models.TerenskiRezultatFK
 
@section headCultureContent {
    <script src="@Url.Content("~/Scripts/kendo.culture.sr-Latn-RS.min.js")"></script>
}
  
<script type="text/javascript">
    //set culture of the Kendo UI
    kendo.culture("sr-Latn-RS");
</script>
  
 
@{
    ViewBag.Title = "Create";
    Culture = "sr-Latn-RS";
}
<div class="editor-label">
    @Html.LabelFor(model => model.DatumOcitavanja)
</div>
<div class="editor-field">
 
    @(Html.Kendo().DateTimePicker()
    .Name("DatumOcitavanja")
    .Value(DateTime.Now)
    /*.Culture("sr-Latn-RS")*/
    .Format("dd.MM.yyyy HH:mm")
    .HtmlAttributes(new { style = "width:220px" })
    )
 
    @Html.ValidationMessageFor(model => model.DatumOcitavanja)
</div>
Please for some instruction. Thanks!
Vladimir Iliev
Telerik team
 answered on 18 Mar 2013
2 answers
166 views
@* Html contains html string from model *@

<script id="news-item-template" type="text/x-kendo-template">
    <div class="wrapper">
        <figure class="img-indent indent-top1 img-indent-none-mp">
            <img src="${imgPath}" alt="" />
        </figure>
        <div class="extra-wrap clear-ml">
                ${Html}
        </div>
        <div class="edit-buttons">
            <a class="k-button k-button-icontext k-edit-button" href="\\#"><span class="k-icon k-edit"></span>Edit</a>
            <a class="k-button k-button-icontext k-delete-button" href="\\#"><span class="k-icon k-delete"></span>Delete</a>
        </div>
    </div>
</script>

    <div class="container_12">
        <div class="wrapper">
            <div class="grid_7 left">
                <div class="box">
                <h3>Latest News</h3>

                    <div class="k-toolbar k-grid-toolbar">
                        <a class="k-button k-button-icontext k-add-button" href="#"><span class="k-icon k-add"></span>Add new record</a>
                    </div>

                    @(Html.Kendo().ListView<MyClub.Models.xtbl_NewsItem>(Model)
                        .Name("listView")
                        .TagName("div")
                        .ClientTemplateId("news-item-template")
                        .DataSource(dataSource => dataSource
                            .Model(model => model.Id("Id"))
                            .PageSize(3)
                            .Create(create => create.Action("NewsCreate", "Home"))
                            .Read(read => read.Action("NewsRead", "Home"))
                            .Update(update => update.Action("NewsUpdate", "Home"))
                            .Destroy(destroy => destroy.Action("NewsDestroy", "Home"))
                        )
                        .Pageable()    
                        .Editable()
                    )

                </div>
            </div>
        </div>
    </div>


Dimiter Madjarov
Telerik team
 answered on 18 Mar 2013
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
MultiColumnComboBox
Dialog
DropDownTree
Checkbox
Slider
Switch
Notification
Accessibility
ListView (Mobile)
Pager
ColorPicker
DateRangePicker
Security
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
SegmentedControl
+? more
Top users last month
Boardy
Top achievements
Rank 2
Veteran
Iron
Benjamin
Top achievements
Rank 3
Bronze
Iron
Veteran
ivory
Top achievements
Rank 1
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
ClausDC
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Boardy
Top achievements
Rank 2
Veteran
Iron
Benjamin
Top achievements
Rank 3
Bronze
Iron
Veteran
ivory
Top achievements
Rank 1
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
ClausDC
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?