Telerik Forums
UI for ASP.NET MVC Forum
1 answer
130 views
                <div id="tabstrip">
                    <ul>
                        <li>
                            Report #1 <span><a class="k-button" href="#"><span class="k-icon k-i-close"></span></a></span>
                        </li>
                        <li>
                            Report #2 <span><a class="k-button" href="#"><span class="k-icon k-i-close"></span></a></span>
                        </li>
                    </ul>
                    <div>Content of Report #1</div>
                    <div>Content of Report #2</div>
                </div>

I've gotten most of it, but I cannot get the k-I-close icon & the k-button in the tab.

                      @(Html.Kendo().TabStrip()
                      .Name("tabstrip")     
                      .Items(items =>
                          {
                              items.Add().Text("Report #1")
                                   .Content("Content of Report #1");
                              items.Add().Text("Report #2")
                                   .Content("Content of Report #2");
                          })
                      )

Any help would be appreciated.
Dimo
Telerik team
 answered on 10 Jan 2014
5 answers
741 views
I've made a Grid that formerly got his data from the Model.
I also had a custom collumn here that i created using columns.template which worked properly.

For sorting and search reasons a changed the datasource to a json from a viewmodel.
When i used this method my data also loaded but the template only displayed an empty column.

This is my code of the Grid:

                        @(Html.Kendo().Grid<KdG.ProjectPortofolio.IntranetApp.ViewModels.Projects.ListProjectViewModel>() 
                              .Name("Grid")
                                        .DataSource(ds => ds.Ajax()
                                                          .Read(r => r.Action("Read", "Project"))
                                        )
                              .EnableCustomBinding(false)
                              .ToolBar(toolBar => toolBar.Custom()
                                    .Text("Exporteer naar Excel")
                                    .HtmlAttributes(new { @class = "export",@id="test" })
                                    .Url(Url.Action("ExportToExcel", "Project",new { page = 1, pageSize = "~", filter = "~", sort = "~" }))
                                    

                              )
                              .Columns(columns =>
                              {
                                  columns.Bound(p => p.Name).Filterable(filterable => filterable.UI("nameFilter")).Title("Naam");
                                  columns.Bound(p => p.Status).Filterable(filterable => filterable.UI("statusFilter")).Title("Status");
                                  columns.Bound(p => p.Category).Title("Categorie");
                                  columns.Bound(p => p.StartDate).Title("Start");
                                  columns.Bound(p => p.EndDate).Title("Einde");
                                  columns.Bound(p => p.AreaOfStudy).Title("Studiegebied");
                                  columns.Bound(p => p.ProjectLeader).Title("Projectleider");
                                  columns.Template(

                                      @<text>
                                        @Html.IconActionLink("glyphicon glyphicon-info-sign", null, "Details", "Project", new { id = item.Id }, new { @class = "btn btn-default btn-xs float FloatLeft" })
                                      </text>);
                              })
                              .Filterable(f => f.Extra(false).Operators(o => o.ForString(s => s
                                  .Clear()
                                  .Contains("Bevat")
                                  .DoesNotContain("Bevat Niet")
                                  .EndsWith("Eindigd met")
                                  )))
                             
                             .Pageable()
                             .Groupable()
                             .Sortable()//Enable paging
)

Thanks in advance
Dimiter Madjarov
Telerik team
 answered on 10 Jan 2014
3 answers
69 views
At Runtime:
Kendo.Mvc.UI.Fluent.EditorToolFactory&#39; does not contain a definition for &#39;ViewHtml&#39; and no extension method &#39;ViewHtml&#39; accepting a first argument of type &#39;Kendo.Mvc.UI.Fluent.EditorToolFactory&#39; could be found (are you missing a using directive or an assembly reference?)

Kendo.Mvc.dll
Version 2013.2.918.340

What gives?
Daniel
Telerik team
 answered on 10 Jan 2014
2 answers
89 views
I have a weird problem with grid paging.
Whenever i select apge 11 it does not work. I still see page i was before. e.g. on page 10 i press next - i still see page 10.

The grid setup: PageSize(10), pageable.ButtonCount(5)
Total data count: 112

Loaded dynamically by ajax:
Json result looks like (generated with kendo function extionsion ToDataSourceResult()):
{
  "Data": [
    ... 10 items ...
  ],
  "Total": 112,
  "AggregateResults": null,
  "Errors": null
}

I have logged the DataResults - and i saw, that the correct items are send back to the client, but they are not displayed (but only on page 11 - all other pages show the correct items, even page 12, when ein press the last page button).
Is there a bug in kendo ui grid? (i'm using the latest kendo ui version 2013.3.1119)
Oliver
Top achievements
Rank 1
 answered on 09 Jan 2014
2 answers
283 views
I need the parent's item while binding the child item setting it's action.  I need to pass the categoryName from the category (parent) on the child action call.  Is this possible?  If so, how?  Any help is very much appreciated!

Here is the panelbar code:
@(Html.Kendo().PanelBar()
.Name("MainMenu")
.ExpandMode(PanelBarExpandMode.Single)
.BindTo(Model, mappings =>
    {
        mappings.For<GMCWeb.Areas.bi.Models.ReportCategory>(binding => binding
            .ItemDataBound((item, category) =>
                {
                    item.Text = "<div class='row'><div class='col-md-9'>" + category.categoryName + "</div><div class='col-md-3 menu-arrow'><i class='fa fa-arrow-circle-right fa-2x'></i></div></div>";
                    item.Encoded = false;
                })
                .Children(category => category.reportCategories));
        mappings.For<GMC.CustomerInformation.DashboardParameters.ReportCategoryInformation>(binding => binding
            .ItemDataBound(
            (item, reportCategory) =>
               {
               item.Text = reportCategory.ReportCategoryName;
               item.Enabled = !reportCategory.Disabled;
               item.Action("GetReports", "Home", new RouteValueDictionary { { "category", category.categoryName } });
               }));    
    }))
Donna Stewart
Top achievements
Rank 1
 answered on 08 Jan 2014
10 answers
610 views
My application is in ASP.NET MVC 5 using Razor views and remote data stored in a SQL Server database.

I have a Kendo Grid which contains a list of Users. This list of users then becomes a resource list in a Kendo Scheduler.

The problem I have is when I add a new user to the grid, open the scheduler then open the task editor the new user does not appear in the resource list; the new user appears in the grid and is created in the database. If I exit the application and then re-run it the user is present in the scheduler resource dropdown. In other words the resource datasource is not being refreshed when the scheduler is displayed.

Now the complication:
The user grid sits in a Partial View: The grid has a toolbar template consisting of a 'Create New User' button(editing is via a popup)  and a Kendo button which calls a script to display a Kendo Window; the window is model and configured via .LoadContentsFrom to display the scheduler view.

I have tried several methods, found on this forum, to get the scheduler resources to update before opening the task editor without success.

Your help would be appreciated

Alan
Alan
Top achievements
Rank 2
 answered on 08 Jan 2014
4 answers
100 views
Hey,

I've been using your MVC wrappers for some time and I absolutely love them!
I just migrated a project on which I was using the Telerik Extensions for ASP.NET MVC to use Kendo UI. There have been some problems, but in the end it works like a charm.

I'm just faced with an issue I can't resolve...
On a "Details" page, I have a static, server-bound grid with a column which has a specific EditorTemplate, itself using a Kendo DropDownList.

All my controls use the deferred JS output to keep all the JS clean and at the bottom of the page.
My issue is that the initalization script of the DropDownList is outputted right after the <input> and not at the bottom of the page where I call the DeferredScripts() function.

Let me show you some code that may clear up what I'm trying to explain.

My Models:
public class MyParentViewModel
{
    public IEnumerable<MyChildViewModel> Children
    {
        get;
        set;
    }
}
 
public class MyChildViewModel
{
    public String DummyString
    {
        get;
        set;
    }
 
    public Boolean? DummyBoolean
    {
        get;
        set;
    }
}
My view:
@model MyParentViewModel
 
@(
    Html.Kendo().Grid(Model.Children)
        .Name("Children")
        .Deferred()
        .Columns(c =>
        {
            c.Bound(x => x.DummyString);
            c.Bound(x => x.DummyBoolean);
        });
)
The EditorTemplate associated to the DummyBoolean property:
@model Boolean
 
@(
    Html.Kendo().DropDownListFor(x => x)
        .Deferred()
        .Items(items =>
        {
            items.Add().Selected(value == false).Text("Non").Value(Boolean.FalseString);
            items.Add().Selected(value == true).Text("Oui").Value(Boolean.TrueString);
        })
        .HtmlAttributes(new { style = "width:100px; line-height:normal;" })
)
And that's the outputted HTML:
<div class="k-widget k-grid k-secondary" id="Groupements" data-role="grid">
    <table role="grid">
        <colgroup>
            <col style="width:20%">
            <col>
        </colgroup>
        <thead class="k-grid-header">
            <tr>
                <th class="k-header" data-field="DummyString" data-title="DummyString" scope="col">
                    <span class="k-link">DummyString</span>
                </th>
                <th class="k-header" data-field="DummyBoolean" data-title="DummyBoolean" scope="col">
                    <span class="k-link">DummyBoolean</span>
                </th>
            </tr>
        </thead>
        <tbody>
            <tr>
                <td>Groupement #1</td>
                <td>
                    <input disabled="disabled" id="DummyBoolean" name="DummyBoolean" style="width:100px; line-height:normal;" type="text" value="True">
                    <script>
                        jQuery(function () { jQuery("#DummyBoolean").kendoDropDownList({ "dataSource": [{ "Text": "Non", "Value": "False", "Selected": false }, { "Text": "Oui", "Value": "True", "Selected": true }], "dataTextField": "Text", "dataValueField": "Value" }); });
                    </script>
                </td>
            </tr>
            <tr class="k-alt">
                <td>Groupement #2</td>
                <td>
                    <input disabled="disabled" id="DummyBoolean" name="DummyBoolean" style="width:100px; line-height:normal;" type="text" value="True">
                    <script>
                        jQuery(function () { jQuery("#DummyBoolean").kendoDropDownList({ "dataSource": [{ "Text": "Non", "Value": "False", "Selected": false }, { "Text": "Oui", "Value": "True", "Selected": true }], "dataTextField": "Text", "dataValueField": "Value" }); });
                    </script>
                </td>
            </tr>
        </tbody>
    </table>
</div>
As you can see, we only have here the DropDownLists' initialization scripts.
The table's is at the bottom of the page where I expect it to be.

Is there anything I'm missing?
Thanks in advance.
Sincerely,
Mickaël Derriey
Alexander Popov
Telerik team
 answered on 08 Jan 2014
5 answers
447 views
I'm initialising a chart in MVC razor syntax, and am unable to find a way of specifying the schema of returned data from an AJAX bound DataSource, as specified in the DataSource documentation:

schema: {
    data: "results" // twitter's response is { "results": [ /* results */ ] }
}

As I'm not autobinding my chart, I've tried setting the schema property in JS before calling the read() method on the DataSource , but this doesn't seem to make any difference:

chart.dataSource.options = { schema: { data: "results" } };

Is this functionality possible using the ASP.NET wrappers?
Orrin
Top achievements
Rank 1
 answered on 07 Jan 2014
1 answer
62 views
I just downloaded and installed a trial of Kendo UI Complete for ASP MVC.  I am running VS 2012.  I Opened the examples project (Kendo.MVC.Examples) and tried out some of the mobile components.  Most of them seem to be broken.  For example, when you try out the drawer.

http://localhost:56541/razor/mobile/drawer/index
Your port number might be different.1

Click on the button that opens the drawer (upper left corner).  A javascript error is thrown.
Uncaught Error: Syntax error, unrecognized expression: #!
The error is thrown from jQuery and is complaining about the bang symbol after the hash.

I am trying to create my own prototype app from your example code and am encountering the same issues.

Thanks for your help.
Kiril Nikolov
Telerik team
 answered on 07 Jan 2014
1 answer
107 views
Hello,

I've tried this on the online demo at : 

http://demos.kendoui.com/web/editor/all-tools.html

click the View Html tool, edit the first img tag and add onerror="imgError()" to it.

Click update button. View Html again and my change has now disappeared. Why is that ?
I've first noticed it locally and I thought I did something wrong, then I tried it on the online demo section and the same behaviour happens. 

Things get even weirder if you add something like onerror="alert('The image could not be loaded.')"

if you view html again this is what you get : 

<img alt="Editor for ASP.NET MVC logo" be="" could="" image="" loaded.');"="" not="" src="http://www.kendoui.com/Image/kendo-logo.png" style="display:block;margin-left:auto;margin-right:auto;" the="" />

Looks like a big bug to me.
Alex Gyoshev
Telerik team
 answered on 06 Jan 2014
Narrow your results
Selected tags
Tags
+? more
Top users last month
Rob
Top achievements
Rank 3
Iron
Iron
Iron
Atul
Top achievements
Rank 1
Iron
Iron
Alexander
Top achievements
Rank 1
Veteran
Iron
Serkan
Top achievements
Rank 1
Iron
Shawn
Top achievements
Rank 1
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Rob
Top achievements
Rank 3
Iron
Iron
Iron
Atul
Top achievements
Rank 1
Iron
Iron
Alexander
Top achievements
Rank 1
Veteran
Iron
Serkan
Top achievements
Rank 1
Iron
Shawn
Top achievements
Rank 1
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?