Telerik Forums
UI for ASP.NET MVC Forum
1 answer
72 views
We use Kendo menu to create main menu items. Some of the menu items have a text box for user to enter search data. The menu is working on IE (version 9.0.8112.16421) but not in Chrome (version 36.0.1985.125). We are using version 2014.1.415.340 of the Kendo.Mvc.dll assembly.

Here is the code for creating the menu:

@(Html.Kendo().Menu()
        .Name("MainMenu2")
        .Items(mainMenu =>
        {
            mainMenu.Add()
                .Text("Order Maintenance");
            mainMenu.Add()
                .Text("Admin")
                .Items(menuItem =>
                {
                    menuItem.Add()
                       .Text("Branch");
                    menuItem.Add()
                        .Text("Container");
                    menuItem.Add()
                        .Text("Employee");
                    menuItem.Add()
                        .Text("Event");
                    menuItem.Add()
                        .Text("Product");
                });
            mainMenu.Add()
                .Text("Invoicing");
            mainMenu.Add()
                .Text("Go To Order")
                .Content(@<text>
                            <table>
                                <tr>
                                    <td>
                                        <input id="DirectOrderNumber" type="text" />
                                        <br />
                                        <span>Order Number</span>
                                    </td>
                                    <td>
                                        <input id="DirectOrderNumberGoButton" type="button" value="Go" />
                                    </td>
                                </tr>
                            </table>
                          </text>
                        );
                        
            mainMenu.Add()
                .Text("Go To Container")
                .Content(@<text>
                            <table>
                                <tr>
                                    <td>
                                        <input id="DirectContainerNumber" type="text" />
                                        <br />
                                        <span>Container Number</span>
                                    </td>
                                    <td>
                                        <input id="DirectContainerNumberGoButton" type="button" value="Go" />
                                    </td>
                                </tr>
                            </table>
                          </text>
                        );
                
            mainMenu.Add()
                .Text("Go To Invoice")
                .Content(@<text>
                            <table>
                                <tr>
                                    <td>
                                       <input id="DirectInvoiceNumber" type="text" />
                                        <br />
                                        <span>Invoice Number</span>
                                    </td>
                                    <td>
                                        <input id="DirectInvoiceNumberGoButton" type="button" value="Go" />
                                    </td>
                                </tr>
                            </table>
                          </text>
                        );
        }))


Please advise how it can be fixed.

Thanks
Iliana Dyankova
Telerik team
 answered on 30 Jul 2014
3 answers
448 views
We are using kendo ui mvc grids for our development.. We have a requirement for importing and exporting excel data to/from kendo ui mvc grid... I search with the help of google regarding this alot..but unfortunately could not able to find enough references for this... Can you please give me a support to complete this task...
Alexander Popov
Telerik team
 answered on 30 Jul 2014
18 answers
539 views
Yours Bootstrap theme works fine side by side with Twitter Bootstrap 2. There were a few problems, but I quickly resolve them with very little css code. Bootstrap 3 contains many breaking changes and of course Kendo UI Bootstrap theme does not work now at all.
Dimo
Telerik team
 answered on 30 Jul 2014
1 answer
152 views
Hello everybody,

I'm new to Telerik and SignalR. Right now we are working on a project for a customer who wants to rewrite his app that was using old Telerik. There is one element that I really need help with. They want to have universal grid that will accept all kind of data, so every user can define their own grid for example for ShopItems, so they will choose for example: which columns to display, in what kind of order etc. How grid should look like is supposed to be defined in xml profile file, so we will have section, which columns to display, from which table. On top of that they want to have SignalR or WebSockets, so the user knows about updates. My question is how can I accomplished all of that? How should I get the data, so it will be optimal ? Is there a way to use Linq with that? I studied examples and got to the moment when I can use dynamic columns, and bind it by ajax, but I still don’t know how to get only data that I need based on list of tables and columns. I will be glad for any help. If you have any questions, please ask
Vladimir Iliev
Telerik team
 answered on 30 Jul 2014
2 answers
93 views
Hi, I've created a Grid within a TabStrip and I load the data using
Ajax. This works when I use a view but when I place the grid in a
partial view the browser asks if I want to save the json file being
returned. Obviously I've missed something simple but I can't see what?


Simon
Top achievements
Rank 1
 answered on 30 Jul 2014
1 answer
421 views
I have a kendo grid in  a partial View bound to Ajax data source.
When the partial view is rendered, it only displays an empty grid without data in it.
Can't i do an server side Ajax binding (json) for the grid in a partial View ?

This only works when the grid is on a view associated with Home controller and not in a partial view.
How do i get it to work in a partial view ? 


Below is what i have in the Partial View.

@using Kendo.Mvc.UI

<div id="Main">
    Kendo Grid Partial View Demo
</div>
<br />
<div id="Grid">

    @(Html.Kendo().Grid<Mvc4SampleApplication.Models.Product>()
      .Name("grid")
      .Pageable(pager => pager
            .Messages(messages => messages.Empty("No data")))
      .DataSource(dataSource => dataSource // Configure the grid data source
          .Ajax()// Specify that ajax binding is used
          .Read(read => read.Action("Products_Read", "Home")) // Set the action method which will return the data in JSON format
          //.Model(model => model.Id(product => product.ProductID))
               .Model(model =>
               {
                   //The unique identifier (primary key) of the model is the ProductID property
                   model.Id(product => product.ProductID);
                   // Declare a model field and optionally specify its default value (used when a new model instance is created)
                   model.Field(product => product.ProductName).DefaultValue("N/A");
                   // Declare a model field and make it readonly
                   model.Field(product => product.UnitsInStock).Editable(false);
               }
              )
       )
      .Columns(columns =>
      {
          // Create a column bound to the ProductID property
          columns.Bound(product => product.ProductID);
          // Create a column bound to the ProductName property
          columns.Bound(product => product.ProductName).ClientTemplate("<strong>#: ProductName #</strong>");
          // Create a column bound to the UnitsInStock property
          columns.Bound(product => product.UnitsInStock);

          // Define a template column - it needs a templated razor delegate
          columns.Template(@<text>  @Html.ActionLink("About", "Home", new { id = item.ProductID }) </text>);
      })
      .Pageable() // Enable paging
      .Sortable() // Enable sorting                           
    )
</div>

 

And below is the code to get Json Data for kendo grid in the Home Controller in my MVC app.

public ActionResult Products_Read([DataSourceRequest]DataSourceRequest request)
        {
            List<Product> ProductList = new List<Product>();

            for (int i = 1; i <= 10; i++)
            {
                Product p = new Product();
                p.ProductID = i;
                p.ProductName = "Product_" + i;
                p.UnitsInStock = 5;

                ProductList.Add(p);
            }
            {
                IEnumerable<Product> products = ProductList;
                DataSourceResult result = products.ToDataSourceResult(request);
                return Json(result);
            }
        }

Any Help will be greatly appreciated.
Thanks in Advance!

Vladimir Iliev
Telerik team
 answered on 30 Jul 2014
1 answer
350 views
HI dear forum members,

is it possible to allow editing and displaying <script> tags with the Kendo UI Editor? What happens is, that any <script> tag that I edit (with the HTML editor) gets replaced with a <telerik:script> tag when written to the page.

What is this behaviour supposed to do/prevent?

Of course I know that this can be a security risk, but in this case our user (CMS user) has a good reason for wanting to do this and no easy workaround...

Kind regards,
Wolfgang
Alexander Popov
Telerik team
 answered on 30 Jul 2014
1 answer
140 views
Hello, I work with kendo grid (via AngluarJS, "kendo.directives").
It work great for Chrome, and IE 11&10&9.
I try to test it IE 8...
The data in grid wasn't appear and this error was appear in console: (full error attached 1.jpg)
***************************************************************************
Error: Invalid template:'<tr data-uid="#=data.uid#" role='row'><td  role='gridcell'><span ng-bind='dataItem.patientFullName'>#: data.patientFullName#</span></td><td  role='gridcell'><span ng-bind='dataItem.mrn'>#: data.mrn#</span></td></tr>';}return o;'
***************************************************************************
I also try to test your own example of Kendo & AngularJS: 'http://demos.telerik.com/kendo-ui/grid/angular'
and the grid is not appear once I test it with IE8 (screenshot attached 2.jpg) Error in console:
***************************************************************************
TypeError: Array.prototype.slice: 'this' is not a JavaScript object
***************************************************************************

Do I miss something or AngularJS with kendo is not supported for IE8?
There is a way to make it work with IE8?

Thanks in advance.
Atanas Korchev
Telerik team
 answered on 29 Jul 2014
3 answers
217 views
Hello Kendo UI Experts,

I had a unique Req to place icons on Far  "Right"

Basically I want to place three to four clickable icons on Far right to each Node.

-Root
       NodeA         Icon1   Icon2  Icon3
       NodeB         Icon1   Icon2  Icon3


Is that possible to do that easily in Kendo UI ?

Thanks in Advance.
RN.
Iliana Dyankova
Telerik team
 answered on 29 Jul 2014
3 answers
316 views
Hi,

I am trying to implement a Grid with inline editing capability. Everything works fine except for the Create functionality. I am using a string for the Model Id.

.Model(model =>
{
    model.Id<string>(p => p.SalesRep.Id);
}

Here is what happens.. 
1) Click on Add New Record
2) Add a record in the client
3) Update any information
4) Clicking Update fires the Update action instead of create.

This is the example I am following: http://demos.telerik.com/aspnet-mvc/grid/editing-inline

I am not sure why the update action is being fired instead of create.

Could this be because of the Model Id is  a string. 

Below is a code snippet of the kendo grid. 
@(Html.Kendo().Grid<SalesRepViewModel>()
                                   .Name("SalesRepsGrid")
                                   .Columns(columns =>
                                   {
                                       columns.Bound(p => p.SalesRep).ClientTemplate("#=data.SalesRep.Name#");
                                       columns.Bound(p => p.SplitPercentage).Width(100);
                                       columns.Command(command => { command.Edit(); command.Destroy(); }).Width(172);
                                   })
                                   .ToolBar(toolbar => toolbar.Create())
                                   .Editable(editable => editable.Mode(GridEditMode.InLine))
                                   .DataSource(dataSource => dataSource
                                      .Ajax()
                                      .Events(events => events.Error("error_handler"))
                                      .Model(model =>
                                      {
                                          model.Id<string>(p => p.SalesRep.Id);
                                          model.Field(p => p.SalesRep.Id).Editable(false);
                                          model.Field(p => p.SplitPercentage).Editable(true);
                                          model.Field(p => p.SalesRep).DefaultValue(
                                                         ViewData["defaultSalesRep"] as NamedReferenceBindingModel<string>);
                                           
                                      })
                                      .Read(read => read.Action("SalesReps_Read", "PurchaseAgreement"))
                                      .Create(update => update.Action("SalesReps_Create", "PurchaseAgreement", new {                 purchaseAgreementId = Model.Id }))
                                      .Update(update => update.Action("SalesReps_Update", "PurchaseAgreement", new { purchaseAgreementId = Model.Id }))
                                      .Destroy(destroy => destroy.Action("SalesReps_Destroy", "PurchaseAgreement", new { purchaseAgreementId = Model.Id }))
                                     )
                              )

Most of the code above is same telerik grid inline editing example except for the model.

Any thoughts?



Uday
Top achievements
Rank 1
 answered on 28 Jul 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
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
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?