Telerik Forums
UI for ASP.NET MVC Forum
3 answers
140 views

Are there any plans on updating the Telerik.Web.Spreadsheet.dll to work with .Net Core?

I'm working on an ASPNET CORE project and I need a way for a user to select an excel file from a dropdown and then load it into the spreadsheet control.

 

Thanks,

Rumen
Telerik team
 answered on 14 Sep 2016
1 answer
110 views

Dear kendo ui team.

You publish really helpful sample projects. Taking a closer look you use unofficial APIs to solve the problems. This means you don't support those solutions in typescript and tehre is no documentation for them to understand what else could be done with those APIs. That's really unfortunate.

One of those helpful examples is found here. kendo.timezone and kendo.date seem to be unofficial APIs, since they are not includede in the typescript definition.

<script>   
    function getAdditionalData() {
        var scheduler = $("#scheduler").data("kendoScheduler");
 
        var timezone = scheduler.options.timezone;
        var startDate = kendo.timezone.convert(scheduler.view().startDate(), timezone, "Etc/UTC");
        var endDate = kendo.timezone.convert(scheduler.view().endDate(), timezone, "Etc/UTC");
 
        //optionally add startTime / endTime of the view
        var startTime = kendo.date.getMilliseconds(scheduler.view().startTime());
        var endTime = kendo.date.getMilliseconds(scheduler.view().endTime());
        endTime = endTime == 0 ? kendo.date.MS_PER_DAY : endTime;
 
        var result = {
            Start: new Date(startDate.getTime() - (startDate.getTimezoneOffset() * kendo.date.MS_PER_MINUTE) + startTime),
            End: new Date(endDate.getTime() - (endDate.getTimezoneOffset() * kendo.date.MS_PER_MINUTE) + endTime)
        }
 
        return result;
    }
</script>

Using those APIs in your official sample projects makes those APIs somehow official. Would be nice if you honor that in your documentation and typescript definitions.

Kind regards

Bernd

 

Stamo Gochev
Telerik team
 answered on 14 Sep 2016
4 answers
872 views
I'm having issue with mvc grid export to excel (using 2015.1.318 trial mvc version).   grid populates fine.  export to excel works with smaller records.. but when downloading bigger size of file, it errors as "Failed to load resource: the server responded with a status of 500 (Internal Server Error)"  however, read method /Report/GetGridData controller fine.  it's dynamically creating columns from datatable.   Does anyone have any clue what I might be doing wrong here ?  

2015.1.318 trial mvc version
MVC5
VS2012

--- controller
        [HttpPost]
        public ActionResult GetGridData([DataSourceRequest] DataSourceRequest request, string spName, string program, string fromDate, string toDate)
        {
            DataTable _dataTable = new DataTable();
            ReportData reportData = new ReportData();
            user = UserManager.FindByNameAsync(User.Identity.Name).Result;
            _dataTable = reportData.GetSPData(spName, user.Id, program, fromDate, toDate);
            return Json(_dataTable.ToDataSourceResult(request), JsonRequestBehavior.AllowGet);
        }

--- cshml

                                @(Html.Kendo().Grid<dynamic>()
                                .Name("abcGrid")
                                .Columns(columns =>
                                {
                                    foreach (System.Data.DataColumn column in Model.Columns)
                                    {
                                        var c = columns.Bound(column.ColumnName).Title(column.ColumnName).Width(150);
                                    }
                                })
                                .Excel(excel => excel
                                    .AllPages(true)
                                    .FileName("abcGridExport.xlsx")
                                    .ProxyURL(Url.Action("Excel_Export_Save", "Grid"))
                                )
                                .Pageable()
                                .AutoBind(false)
                                .Sortable()
                                .ToolBar(tools => tools.Excel())
                                .Filterable()
                                .DataSource(dataSource => dataSource
                                    .Ajax()        
                                    .Model(model =>
                                        {
                                            foreach (System.Data.DataColumn column in Model.Columns)
                                            {
                                                var field = model.Field(column.ColumnName, column.DataType);
                                            }                
                                        })
                                    .Read(read => read.Action("GetGridData", "Report").Data("readparameter"))
                                )
                            )
Steve
Top achievements
Rank 1
 answered on 13 Sep 2016
3 answers
445 views

Hi! I'm trying to do the following:

I have a grid of groups, and each group can have a bunch of items. The items have two fields right now (url and name, ie two text fields) . I'd like to create a new group, and in the popup editor, being able to add items to it.

The group is something like:

public class Group

{

  public long Id {get; set;}

  public string Name {get; set;}

  public List<Item> Items {get; set;}

}

And the items are like:

public class Item

{

   public long Id {get; set;}
   public string Name {get; set;}

   public string Url{get; set;}

}

I tried to use a ListView but it didnt quite work (seems the API is way, way less developed than the grid's for example), what do you think its the best way to do this? Maybe another grid with inline editing?

Ideally what I'd want is for the nested Item editor to add items to the group being created, and once that group is submitted, then persist everything in the DB.

Danail Vasilev
Telerik team
 answered on 13 Sep 2016
2 answers
138 views

Recently I met a issue that when I batch update my grid, and it's always call the action I not assign to ?  And I have no idea why the grid keep calling Index action when I press the save changes button. here is the code below, my update controller and action is IV21080W and SenToTurnkey. No matter what I change the action, the grid just keep calling Index action.  this issue just pendding me lots of days.

.DataSource(dataSource => dataSource.Ajax().PageSize(15).Batch(true)
.Events(events => { events.Error("IV21080WErrors"); events.RequestEnd("IV21080WCRUDevents"); })
.Update("SentToTurnkey", "IV21080W")
.Read("Read", "IV21080W").Filter(x => x.Add(z => z.INVOICEDATE).IsEqualTo(DateTime.Parse("2016/09/01")))
.Model(model => { model.Id(m => m.KEY_NO); model.Field(m => m.errorType).Editable(false); model.Field(m => m.INVOICENUMBER).Editable(false); model.Field(m => m.INVOICEDATE).Editable(false); model.Field(m => m.INVOICETIME).Editable(false); model.Field(m => m.AMOUNT).Editable(false); model.Field(m => m.TAXAMOUNT).Editable(false); model.Field(m => m.TOTALAMOUNT).Editable(false); })
)
.Editable(editable => editable.Mode(GridEditMode.InCell))
.AutoBind(true)
.Sortable()
.Filterable()
.Scrollable(s => s.Height("auto"))
.Pageable(pageable => pageable.Refresh(false).PageSizes(false).ButtonCount(5))
.ToolBar(toolbar => { toolbar.Excel(); toolbar.Save().SaveText("SentToTurnkey"); })
.Excel(excel => excel.FileName("IV21080W.xlsx").Filterable(true).AllPages(true).ProxyURL(Url.Action("Save", "ILISFinPublic")))

ITGF
Top achievements
Rank 1
 answered on 13 Sep 2016
9 answers
1.1K+ views
I've noticed that we have the option of doing a custom sort here: [url]http://docs.telerik.com/kendo-ui/api/web/grid#configuration-columns.sortable.compare[/url].

I'm using the MVC wrappers, but cannot figure out the syntax to make it work in my grid, or find an example.  Could you provide me with an example of this functionality using the MVC wrapper?
Dimiter Madjarov
Telerik team
 answered on 13 Sep 2016
4 answers
574 views
Hi all,

I use a ViewModel when binding to a grid.
However when using the filtering function I get the following:

Invalid property or field - 'UserName' for type: ErrorLog

Username is only a property in the ErrorLogViewModel

The code to fill my view model is:
public ActionResult ListErrors([DataSourceRequest]DataSourceRequest request)
        {
            IQueryable<ErrorLog> errorLogs = (IQueryable<ErrorLog>)db.ErrorLogs.Include(e => e.User).OrderByDescending(e => e.ErrorLogId);
            DataSourceResult result = errorLogs.ToDataSourceResult(request, errorLog => new ErrorLogViewModel
                {
                    ErrorLogId = errorLog.ErrorLogId,
                    Message = errorLog.AdditionalMessage,
                    Timestamp = errorLog.Timestamp,
                    UserName = errorLog.User.UserName
                });
            return Json(result);
        }

Thanks,
Keith. 









Maria Ilieva
Telerik team
 answered on 12 Sep 2016
2 answers
108 views

hello Support,

    We are using Spreadsheet and found one issue. This issue also exist in Online Demo. Enter some words in cell that not any format, save as Json or Excel file. Next, import the saved Json or Excel file again, you will find the words has redundant Underline format.

    Seemly it is bug for Spreadsheet widget. Could you please give us some advice? We are using this widget in our project and it is emergency.

Thanks

Mark

 

   

Stefan
Telerik team
 answered on 09 Sep 2016
5 answers
1.3K+ views

Hi,

I am trying to build a grid that has a detail template displaying child records. One of the columns in the grid (both the main grid and sub-grid) should display a dropdown menu. This is all mostly straightforward but I have a couple of issues/questions.

1. The properties of the child objects do not seem to be available within the context of the detail template. How can I access those properties?

2. I cannot seem to figure out how to add the dropdown menu in the grid column. I've tried to apply examples from the demos but keep getting errors like "Invalid Template" when attempting to use a client template or "Cannot convert lambda expression" when I try to use a foreach loop to add submenu items.

Product: Telerik MVC UI

Version: 2016.2.714

 

Please take a look at the attached sample solution and point me in the right direction. (I could not add the Content and Scripts folders as they cause me to exceed the 2MB upload limit; however those folder are out of the box Telerik MVC UI scaffolded so I hope you can add them). Also see the Razor View code below.

@{
    ViewBag.Title = "Home Page";
}
<div class="container-fluid">
    <div class="row">
        <div class="col-xs-18 col-md-12">
@(Html.Kendo().Grid<TelerikMvcApp1.Models.Shop>()
        .Name("grid")
        .Columns(columns =>
        {
            columns.Bound(e => e.ShopId).Width(110);
            columns.Bound(e => e.ShopName);
            columns.Template(@<text></text>).ClientTemplate(
                Html.Kendo().Menu()
                    .Name("menu_#=ShopId#")
                    .Items(menu =>
                    {
                        menu.Add().Text("Pay Affiliates").Items(nested =>
                        {
                            // How does one loop through the affiliates here?
                            nested.Add()
                                .Text("[How to get affiliate name here]?");
                               // .Action("ActionName", "ControllerName", new { ShopId = "#=ShopId#", AffiliateId = "#=AffiliateId#" });
                                });

                        })
                    .ToClientTemplate().ToHtmlString()
                );
        })
        .Sortable()
        .Pageable()
        .Scrollable()
        .ClientDetailTemplateId("affiliates-template")
        .HtmlAttributes(new { style = "height:600px;" })
        .DataSource(dataSource => dataSource
            .Ajax()
            .PageSize(6)
            .Read(read => read.Action("Shops_Read", "Grid"))
        )
        .Events(events => events.DataBound("dataBound"))
)
      </div>
    </div>
</div>
<script id="affiliates-template" type="text/kendo-tmpl">
    @(Html.Kendo().Grid<TelerikMvcApp1.Models.Affiliate>()
            .Name("grid_#=ShopId#") // template expression, to be evaluated in the master context
            .Columns(columns =>
            {
                columns.Bound(o => o.AffiliateId).Width(110).ClientTemplate(" \\#= AffiliateId \\#"); ;
                columns.Bound(o => o.AffiliateName).ClientTemplate(" \\#= AffiliateName \\# promotes \\#= ShopName \\#");
            })
            .DataSource(dataSource => dataSource
                .Ajax()
                .PageSize(10)
                .Read(read => read.Action("Affiliates_Read", "Grid", new { ShopId = "#=ShopId#" }))
            )
            .Pageable()
            .Sortable()
            .ToClientTemplate()
    )
</script>
<script>
    function dataBound() {
        this.expandRow(this.tbody.find("tr.k-master-row").first());
    }
</script>

Viktor Tachev
Telerik team
 answered on 09 Sep 2016
1 answer
93 views

Requirements

Telerik Product and Version

Kendo

Supported Browsers and Platforms

IE

Components/Widgets used (JS frameworks, etc.)


Hello Telerik Team,

 

We are looking for a Kendo-MVC control equal to the below link:-

http://demos.telerik.com/aspnet-ajax/splitter/examples/sp_firstlook/defaultcs.aspx

we need to overlay on another control same like the above example. we have already seen the Kendo slider which does not fit into our requirement.

 

Please let us know ASAP.

Rumen
Telerik team
 answered on 09 Sep 2016
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?