Telerik Forums
UI for ASP.NET Core Forum
1 answer
162 views

Hello Telerik Support Team (or to whom it may concern otherwise)

 

I have a boolean property bound to a Grid control column.
I would like to have a checkbox in that column that represents the boolean value of the model.
Here's a screenshot of how it currently looks (the 'Ja'/'Nein' is just a Client Template that i added temporarly, that one should be a checkbox)

Here's the screenshot:
https://i.imgur.com/ScvwCLo.png

Here's the code of the View:
https://pastebin.com/9WED8qAN

Here's the viewmodel behind the grid:
https://pastebin.com/gfY8d6dH

How can I do this?

Of course I googled around. But I only found javascript solutions that circumvented the usual asp.net core MVC logic. Plus none of the examples I found actually worked. So I'd like to know how I can do this in my particular case.

 

Thanks in advance.

And of course, if you need some more code, I can provide it on a need to know basis.

 

 

Marcel Härry
Top achievements
Rank 1
 answered on 10 Nov 2017
1 answer
158 views

Hello,

With the following filter configuration how can I show a tooltip in the filter input that reflects the configured operator?

Column config:

columns.Bound(c => c.Reference).Filterable(f => f.Cell(c => c.Operator("equals").ShowOperators(false)));

Grid config:

.Filterable(f => f.Mode(GridFilterMode.Row))

The filter input markup would contain the following attribute:

title="Is equal to"

 

Thanks

 

Preslav
Telerik team
 answered on 08 Nov 2017
3 answers
309 views

I am using a ListView on .Net Core 2.0 the problem is the TagName attribute, no matter what i write inside it, it always render inside a div, here is my code, all works as expected except the TagName. The client template works, but i have <li> inside <div> instead of <ul>, html attributes render correctly.

Anyone knows where i am doing wrong?

@(Html.Kendo().ListView<MyModel>()
    .Name("LV_Notifiche")
    .TagName("ul")
    .HtmlAttributes(new { @class = "dropdown-menu-list scroller", style = "height: 250px;" })
    .ClientTemplateId("notificaTemplate")
    .DataSource(dataSource => dataSource
        .Ajax()
        .ServerOperation(false)
        .Read(read => read.Action("Notifiche_Read", "Notification"))
    )
    .Deferred()
)
Konstantin Dikov
Telerik team
 answered on 06 Nov 2017
1 answer
245 views

Hello,

I am trying to get a grid to work with checkbox instead of the "true"/"false".

I found the faq for ASP.NET (https://docs.telerik.com/aspnet-mvc/helpers/grid/faq#how-to-display-checkboxes-in-ajax-bound-grids) but nothing similar for .net core.

When I try to use this on my asp.net core mvc project, I get always the error, that the given variable is not defined.

 

In general, can the ASP.net MVC examples be used on ASP.net core MVC?

Regards

Patrick

Stefan
Telerik team
 answered on 02 Nov 2017
1 answer
343 views

Hello,

I have a hierarchical grid and I want to export it to pdf, but when I do this, only 2 pages are created, the rest is cut.

Can anybody tell me what I have to set, so that the complete grid is exported?

I also have another problem with the grid. The ProxyURL-Function does not work. The according method in code behind is never be executed and I don't know why. 

Here is the code:

<div class="col-sm-12" id="main">
            @(Html.Kendo().Grid<CMG_Configuration_Manager.Models.MachineInfo>()
        .Name("grid")
        .ToolBar(tools => tools.Pdf())
        .Pdf(pdf => pdf
            .AllPages()
            .AvoidLinks()
            .PaperSize("A4")
            .Scale(0.8)
            .Margin("2cm", "1cm", "1cm", "1cm")
            .Landscape()
            .TemplateId("page-template")
            .FileName("Kendo UI Grid Export.pdf")
            .ProxyURL(Url.Action("Pdf_Export_Save", "Home"))
             
        )
   
        .HtmlAttributes(new { style = "height: 800px; width:1000px" })
        .Scrollable(scrollable => scrollable.Height("auto"))
        .Groupable()
        .Sortable()
        .ClientDetailTemplateId("TemplateMaterial")
        .DataSource(dataSource => dataSource
            .Ajax()
            //.PageSize(10)
            .Read(read => read.Action("getSpGrid", "Home"))
        )
        .Events(events => events.DataBound("dataBound"))
            )
   
<script id="TemplateMaterial" type="text/kendo-tmpl">
    @(Html.Kendo().Grid<CMG_Configuration_Manager.Models.MaterialInfo>()
            .Name("grid_#=msn_pkfk_serialnr_vchar#") // template expression, to be evaluated in the master context
            .DataSource(dataSource => dataSource
                .Ajax()
                .Read(read => read.Action("HistorianBinding_Material", "Home", new { SerialNr = "#=msn_pkfk_serialnr_vchar#" }))
            )
            .Events(events => events.DataBound("dataBound"))
            .Sortable()
            .ToClientTemplate()
             
            
    )
//And the Code in HomeController
 
[HttpPost]
        public ActionResult Pdf_Export_Save(string contentType, string base64, string fileName)
        {
            var fileContents = Convert.FromBase64String(base64);
 
            return File(fileContents, contentType, fileName);
        }
Stefan
Telerik team
 answered on 31 Oct 2017
3 answers
614 views

Hello, I want to create a grid with multi level hierachy, but the grid only shows to levels of hierachy. Here is the code of my view:

<div class="col-sm-12" id="main">
            @(Html.Kendo().Grid<CMG_Configuration_Manager.Models.MachineInfo>()
        .Name("grid")
        .ToolBar(tools => tools.Pdf())
        .Columns(columns =>
        {
            columns.Bound(o => o.msn_pkfk_serialnr_vchar);
            columns.Bound(o => o.mtp_pkfk_gang_vchar);
            columns.Bound(o => o.mtp_pkfk_mcid_vchar);
            columns.Bound(o => o.msb_kunde_vchar);
        })
        .HtmlAttributes(new { style = "height: 800px; width:1000px" })
        .Scrollable(scrollable => scrollable.Height("auto"))
        .Groupable()
        .Sortable()
        .ClientDetailTemplateId("TemplateMaterial")
        .Pageable()
        .DataSource(dataSource => dataSource
            .Ajax()
            .PageSize(10)
            .Read(read => read.Action("getSpGrid", "Home"))
        )
        .Events(events => events.DataBound("dataBound"))
            )
        </div>
    </div>
     
</div>
<script id="TemplateMaterial" type="text/kendo-tmpl">
    @(Html.Kendo().Grid<CMG_Configuration_Manager.Models.MaterialInfo>()
            .Name("grid_#=msn_pkfk_serialnr_vchar#") // template expression, to be evaluated in the master context
            .ClientDetailTemplateId("TemplateFacility")
            .DataSource(dataSource => dataSource
                .Ajax()
                .PageSize(5)
                .Read(read => read.Action("HistorianBinding_Material", "Home", new { SerialNr = "#=msn_pkfk_serialnr_vchar#" }))
            )
            .Sortable()
            .ToClientTemplate()
 
    )
</script>
<script id="TemplateFacility" type="text/kendo-tmpl">
    @(Html.Kendo().Grid<CMG_Configuration_Manager.Models.FacilityInfo>()
            .Name("grid_#=bgp_pkfk_bgpnr_vchar#") // template expression, to be evaluated in the master context
            .ClientDetailTemplateId("TemplateModule")
            .DataSource(dataSource => dataSource
                .Ajax()
                .PageSize(5)
                .Read(read => read.Action("HistorianBinding_Facility", "Home", new { GroupName = "#=bgp_pkfk_bgpnr_vchar#" }))
            )
            .Sortable()
            .ToClientTemplate()
 
    )
</script>

 

The grid shows the first and second level. At each row of second level is this little arrow to expand the data (where the third level should show up), but when i press the arrow the following error occurs:

Uncaught TypeError: Cannot read property 'replace' of undefined
    at Object.compile (kendo.all.min.js:25)
    at Object.d [as template] (jquery.min.js:2)
    at eval (eval at <anonymous> (jquery.min.js:2), <anonymous>:1:4106)
    at Object.n [as syncReady] (kendo.aspnetmvc.min.js:25)
    at eval (eval at <anonymous> (jquery.min.js:2), <anonymous>:1:7)
    at eval (<anonymous>)
    at jquery.min.js:2
    at Function.globalEval (jquery.min.js:2)
    at Ha (jquery.min.js:3)
    at n.fn.init.after (jquery.min.js:3)

Can anybody help or has an idea to do the trick on .net Core MVC?

Regards

Patrick

Stefan
Telerik team
 answered on 30 Oct 2017
0 answers
230 views

Hi,

 I want to perform sending email operation with attachments,subject,To and From on button click.

I have gone through the below link

https://www.telerik.com/forums/open-email-and-attach-grid-as-pdf-or-excel(It does not help as it has either gmail or outlook as email option)

The second option I found is https://www.telerik.com/forums/how-to-send-email-with-attachment. But need some help with the Plugins.I want to know whether this is a free plugins and also are there any other options i have to implement my requirement.

Thanks,

Indhu

Indhumathi
Top achievements
Rank 1
 asked on 26 Oct 2017
2 answers
141 views

I Have unchecked the ComboBox items by using clearCheckedItems() inside a Clear button.But Now I am trying to clear the selected Values without the clear Button.Is there any way I can clear the checked Values for the ComboBox.

 

Thanks,

Indhu

Indhumathi
Top achievements
Rank 1
 answered on 26 Oct 2017
1 answer
122 views

Using the sample at:  http://demos.telerik.com/aspnet-core/multiselect/index  

  1. Set focus into the Optional field
  2. Start typing "Nan
  3. Use the down arrow to select the 2nd Nancy
  4. Tab out

The selected record is not added to the selected values.  The only way I have found to actually add it, is by using the mouse.  This greatly slows down our data entry staff.  Why does it not behave the same way as the combobox, or autocomplete field?

For example, go to http://demos.telerik.com/aspnet-core/autocomplete/index type in "Den", down arrow to select Denmark and tab, Denmark is now populated in the autocomplete field.  Same occurs with combo boxes.

 

Ivan Danchev
Telerik team
 answered on 23 Oct 2017
1 answer
778 views
I would like to allow a dropdownlist to show values that were previously selected but are now removed from the dropdownlist source.  Instead of displaying blank.  The dropdownlist is in a grid column.

Grid:
...
columns.ForeignKey(p => p.CurrentCategory, @Model.LookupCategory, "CategoryName", "CategoryName").Width(160);
...



Template editor
@using System.Collections
 
@(
 Html.Kendo().DropDownListFor(m => m)      
        .BindTo((SelectList)ViewData[ViewData.TemplateInfo.GetFullHtmlFieldName("") + "_Data"])
        .ValuePrimitive(true)       
        .AutoWidth(true)
)


So to explain in more detail:  The CurrentCategory column is a text column (not an id column) and the user can select from a list of items found in the LookupCategory.  However if an item is removed from the LookupCategory the value should still be displayed in instances where the user had already selected that value for the CurrentCategory.  

Currently if a row contains a CurrentCategory value that is not in the LookupCategory list it is displayed as blank.

Perhaps I have to use a combobox instead? 
Viktor Tachev
Telerik team
 answered on 23 Oct 2017
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?