Telerik Forums
UI for ASP.NET Core Forum
2 answers
113 views

trying to implement this demo in our .net core project targeting core 2.1. taking one step at a time - 

I have modeled my view models based on your examples and my controller after your datasource controller - i don't use services

At this point I am able to bind and return data from our database. The spreadsheet is fine at this point and all I am trying to do now is get the data into the 

Controller submit method.

i have set up my ajax call as you have in the 2018 R2 release examples - for saving changes

    function onSubmit(e) {

         $.ajax({
             type: "POST",
             url: '@Url.Action("Data_Source_Products_Submit", "Spreadsheet")',
             data: e.data,
             dataType: "json",
             success: function (result) {
                 e.success(result.Updated, "update");
                 e.success(result.Created, "create");
                 e.success(result.Destroyed, "destroy");
             },
             error: function (xhr, httpStatusMessage, customErrorMessage) {
                 alert(xhr.responseText);
             }
         });
     }

When I hit Save and debug , I can see that the data is there in the updated array (the other 2 are empty)

however when i got to the controller - the ModelState was inValid

if I add the contentType: "application/json", then  ModelState will be valid but the input model updated parameter is null

 

just the fact that i need to add the content type to the ajax call tells me there is something fundamentally different between your core project and mine

your project has so many pieces I cannot easily if i am missing something simple or something big

 

Do you have any idea why i am needing to add the content type to get the ModelState valid?

And why the Updated array is null in the controller when I can see the data in the array on the client side?

 

thanks

Jim

James
Top achievements
Rank 1
 answered on 16 Apr 2019
1 answer
965 views

Hi there,

I have a grid with an Excel Export option. here's how I decorate the Grid component.

                              .Excel(excel => excel
                                    .AllPages()
                                    .FileName(@excelFilename)
                                    .Filterable(true)
                                    .ProxyURL(Url.Action("ExcelExportSave", "Search"))
                                    .ForceProxy()
                                )

And then, in the controller I do this:

        [HttpPost]

        public ActionResult ExcelExportSave(string contentType, string base64, string fileName)
        {
            var fileContents = Convert.FromBase64String(base64);

            return File(fileContents, contentType, fileName);
        }

However, some of the queries return over a million rows. This causes the download to stall.Is there any way to export CSV or maybe just stream the contents down in chunks?

Tsvetina
Telerik team
 answered on 16 Apr 2019
6 answers
637 views

Hello,

I have been trying to figure out how to implement the "validation bubble" (see attached) like the one that is displayed in the following example: Custom validator editing

My validation messages appear either on the side of the input field, or they push everything down and display below the input field, or they show up on top of the input field where the input field is no longer visible.  I'd really like to know how to show a bubble with the small arrow above it just like in the attached picture.  I'm not sure if this is done via a theme, but the theme I'm working with doesn't seem to have this functionality.  An example would be very much appreciated.  Thanks.

Regards,

Shawn A.

Shawn
Top achievements
Rank 1
 answered on 15 Apr 2019
2 answers
119 views

Hi,

I'm trying to test out the Grid control and it will not display on my page. If I do view/source, I can see it actually.

Steps I took:

1. Installed NuGet package: Telerik.UI.forAspNet.Core.Trial

2. Updated Startup.cs with entries for json, AddKeno()

3. Updated Views/_ViewImports to include Kendo.Mvc.UI and the tag Helper

4. Added the div below to my page (I have a controller named LineItemsController with a JsonResult function named GetLineItems)
<div class="col-md-12">
        @(Html.Kendo().Grid<LineItem>()
                                .Name("BidGrid")
                                .Columns(columns =>
                                {
                                    columns.Bound(li => li.AvailableQty).Filterable(false);
                                    columns.Bound(li => li.Category);
                                    columns.Bound(li => li.Description);
                                    columns.Bound(li => li.InstalledUnitCost);
                                    columns.Bound(li => li.MaterialCost);
                                })
                                .Pageable()
                                .Sortable()
                                .Scrollable()
                                .Filterable()                               
                                .HtmlAttributes(new { style = "height:550px;" })
                                .DataSource(dataSource => dataSource
                                    .Ajax()
                                    .PageSize(20)
                                    .Read(read => read.Action("GetLineItems","LineItems"))
                                )
        )
    </div>

Viktor Tachev
Telerik team
 answered on 15 Apr 2019
1 answer
153 views

Is there anyway to use Kendo for asp.net core with Bootstrap 4 without polluting the default Bootstrap 4 styling? Is it possible to prefix all Kendo styles to not interfere with Bootstrap?

Lack of customization within the SAAS builder is making it very hard to implement Kendo UI.  At this point if we could just get Charts that would be a start.

Is there a list of styles overridden by Kendo?

Teya
Telerik team
 answered on 12 Apr 2019
4 answers
537 views

I've got a grid with column group headers that display the day of week and under each column group are the actual value columns. I want the column group to display the preset value of "Mon", "Tue", etc. but also after show the date. So the final column group header would read "Mon MM/dd/yyyy". I have the date I need to rename the column group header at run-time. How do I go about coding this?

I tried the below but it only renames the value column header and not the group.

$("#timecard th[data-field=MonST]").html("New");

 

This is my code for the group "Mon".

columns.Group(g => g.Title("Mon")
    .Columns(monday =>
    {
        monday.Bound(p => p.MonST).Filterable(false).Sortable(false).ClientTemplate("#if(MonST == 0 || MonST == null || isNaN(MonST)){MonST=null} else {##=parseFloat(MonST).toFixed(1)##}#").Width(40).Title("ST");
        monday.Bound(p => p.MonOT).Filterable(false).Sortable(false).ClientTemplate("#if(MonOT == 0 || MonOT == null || isNaN(MonOT)){MonOT=null} else {##=parseFloat(MonOT).toFixed(1)##}#").Width(40).Title("OT");
        monday.Bound(p => p.MonDT).Filterable(false).Sortable(false).ClientTemplate("#if(MonDT == 0 || MonDT == null || isNaN(MonDT)){MonDT=null} else {##=parseFloat(MonDT).toFixed(1)##}#").Width(40).Title("DT");
    })
);

 

 

 

Tsvetina
Telerik team
 answered on 12 Apr 2019
1 answer
323 views

Hi,

Sorry for a daft question. I am using VS2019, ASP.net Core 2.2, UI for ASP.net Core 2019.1.220. I am trying to bind a site map to the menu as I need security trimming, either using the Html helper or the tag helper. The issue is I am trying to follow  this page: https://docs.telerik.com/aspnet-core/html-helpers/navigation/menu/binding/sitemap-binding 

For the life of me I cannot find a reference SiteMapManager (Step 3) anywhere, have been Googling my fingers to the bone and still can't find anything! Also The example shows the call to populate in a controller, seems an odd place to put it or is the idea that the menu is only populated for example on the first call to the Home Index ?

 

Thanks

 

Chris

 

Veselin Tsvetanov
Telerik team
 answered on 12 Apr 2019
1 answer
996 views

Hello.  I wanted to know exactly how to check a dynamically generated table of dropdown lists for duplicates.  so, for example, if the user selects the first dropdown in a set of 3 cascaded dropdowns, all 3 dropdowns change value, (of course they have to since they're cascaded together.).  But, if you use a standard jquery function to check for the change event on the LAST dropdown like so:

 

$("input[id$='SkillsId']").change(function () {
         var value = $(this).val();
         $("input[id$='SkillsId']").not(this).each(function () {
             if ($(this).val() == value) {
                 alert("duplicate!");
             } else {
                 alert("no dupes.");
             }
         });
     });

 

This of course, never gets fired, because they're cascaded, which is not good at all.  So, I attached a change event to the last dropdown:

 

@(Html.Kendo().DropDownList()
                  .Name("SkillsRows[" + Model.row + "].SkillsId")
                  .Value(Model.SkillsId.ToString())
                  .HtmlAttributes(new { @style = "width:31%" })
                  .DataTextField("Description")
                  .DataValueField("Id")
                  .DataSource(source =>
                  {
                      source.Read(read =>
                      {
                          read.Action("GetSkills", "Admin")
                          .Data("cba.filterSkills");
                      })
                      .ServerFiltering(true);
                  })
                  .Events(e =>
                  {
                      e.Change("cba.onSkillsIdChanged");
                  })
                  .CascadeFrom("SkillsRows_" + Model.row + "__SkillsTypeId")
                  )

 

function onSkillsIdChanged(event) {
    var value = this.element.val();
    $("input[id$='SkillsId']").not(this).each(function () {
        if ($(this).val() == value) {
            alert("duplicate!");
        } else {
            alert("no dupes.");
        }
    });
}

 

This fires the onSkillsIdChanged() event, but the alerts never appear, and I could never obtain the ID of the element that fired the event, which is not good, but they do work in a simple example with hardcoded id's.  So, exactly what is the solution?  AND, FYI, the first 2 dropdowns with the code above work fine, and I was able to obtain both the sending element ID and selected dropdown value, but NOT the last one (3rd one).  Why is that?  This is a simple example that just doesn't work, and the documentation is no help at all.  

 

Thanks

 

Chris
Top achievements
Rank 1
 answered on 12 Apr 2019
2 answers
1.0K+ views

Hello,

I have a Kendo Grid that gets filtered by a DropDownList box located in the grid's toolbar in a ClientTemplate.  I'm trying to set the value/index of the DropDownList box to a specific value (e.g. 2), based on a value I obtain from my DB, on page load.  I was trying to achieve this by setting a ViewData value in the "List" action method that is responsible for filling the Grid with data, and then setting the DropDownList's value in $(document).ready() function in the View where the Grid is located.  The problem is that I cannot access the DropDownList by using $("#filter").data("kendoDropDownList).  This always returns "undefined".  How do I access this DropDownList box that is located inside a client template for the grid's toolbar to set it's value?

Thanks.

My Grid (partial):

@(Html.Kendo().Grid<Model>()
.Name("Grid")
.Columns(columns =>
{
     columns.Bound(c => c.Value1);
     columns.Bound(c => c.Value2);
})
.ToolBar(toolbar =>
{
     toolbar.ClientTemplateId("GridToolbarTemplate");
})
.....

 

Here's the template:

<script id="GridToolbarTemplate" type="text/x-kendo-template">
     <div>
         <label class="category-label" for="category">Filter</label>
         @(Html.Kendo().DropDownList()
                     .Name("filter")                           
                     .OptionLabel("All")
                     .DataTextField("Text")
                     .DataValueField("Value")
                     .Events(e => e.Change("thresholdChange"))
                     .HtmlAttributes(new { style = "width: 60px;" })
                     .BindTo(new List<SelectListItem>()
                     {
                         new SelectListItem() {
                             Text = "1", Value ="1"
                         },
                         new SelectListItem() {
                             Text = "2", Value ="2"
                         },

                         new SelectListItem() {
                                       Text = "3", Value ="3"
                                 }

                     })
                     .ToClientTemplate()
         )
     </div>
 </script>

 

 

 

 

 

 

 

 

Tsvetomir
Telerik team
 answered on 11 Apr 2019
4 answers
286 views

Hello,

if I set .Selectable(s => s.Mode(GridSelectionMode.Multiple)) I cannot select a text in a grid cell for copy - why?

is this by design and if yes, is there a workaround?

 

robert

Robert Madrian
Top achievements
Rank 1
Veteran
Iron
 answered on 11 Apr 2019
Narrow your results
Selected tags
Tags
+? more
Top users last month
Anislav
Top achievements
Rank 6
Silver
Bronze
Bronze
Jianxian
Top achievements
Rank 1
Iron
Marco
Top achievements
Rank 3
Iron
Iron
Iron
Jim
Top achievements
Rank 2
Iron
Iron
Nurik
Top achievements
Rank 2
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Anislav
Top achievements
Rank 6
Silver
Bronze
Bronze
Jianxian
Top achievements
Rank 1
Iron
Marco
Top achievements
Rank 3
Iron
Iron
Iron
Jim
Top achievements
Rank 2
Iron
Iron
Nurik
Top achievements
Rank 2
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?