Telerik Forums
UI for ASP.NET MVC Forum
2 answers
58 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
56 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
369 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
162 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
196 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
273 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
101 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
169 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
145 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
2 answers
711 views
Hello,

I need some help to complete below functionality.

I am trying to bind/create a template column, so when the grid loads it can call an html helper or controller action to get the value/text for that column. Which means, i am trying to bind a non modal or datasource property  to one of the grid columns.

Goal: Bind one of the columns in kendo grid with external text.

My grid looks something like this,

 @(Html.Kendo().Grid<Model>()
          .Name("Grid")
          .AutoBind(false)
          .Columns(columns =>
              {
                  columns.Bound(row => row.Id).Hidden(true);
                  columns.Bound(row => row.Name);

                 columns.Template(@<text>@Html.GetSomeText("SomeContext")</text>).Title("title");

                 columns.Template(@<text>@Html.Action("GetSomeText", "controller", new {ctx = SomeContext})</text>);
               }

As you can see above, I tried couple of ways to get the text for the column - Html helper and Action Method, but in both the cases, server side code is not even being triggerd and column remains empty in the grid.

Any help is much appreciated.

Thanks,
Balwant
Petur Subev
Telerik team
 answered on 18 Mar 2013
Narrow your results
Selected tags
Tags
+? more
Top users last month
Jay
Top achievements
Rank 3
Bronze
Iron
Iron
yw
Top achievements
Rank 2
Iron
Iron
Stefan
Top achievements
Rank 2
Iron
Iron
Iron
Kao Hung
Top achievements
Rank 1
Iron
Bohdan
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Jay
Top achievements
Rank 3
Bronze
Iron
Iron
yw
Top achievements
Rank 2
Iron
Iron
Stefan
Top achievements
Rank 2
Iron
Iron
Iron
Kao Hung
Top achievements
Rank 1
Iron
Bohdan
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?