Telerik Forums
UI for ASP.NET MVC Forum
3 answers
453 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
541 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
154 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
95 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
427 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
357 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
221 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
320 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
5 answers
118 views
I'm trying to use a grid using the server-side binding like in the documentation. But when I click on the header of a column to sort I get the following javascript exeption

Unhandled exception at line 28, column 11311 in http://localhost:64716/bundles/kendo?v=Mt_vnIDxltOGpsu7Y4JtLwq860FIgJ_8g1LouxzoGkE1
0x800a138f - JavaScript runtime error: Unable to get the property "0" a reference null or undefined.

From what I gather from the developer tools it is the  return this._data[i] that throw the exception because this.data is undefined.
Rosen
Telerik team
 answered on 28 Jul 2014
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?