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

I've had this issue for years with the Telerik grid when trying to use the built in ColumnMenu in the same grid as template columns. I want to make a template column for a custom button. The column and button work fine, however if the template column is not the last column in the grid it causes the ColumnMenu items to all be off by one. ie: you click one of the columns to hide it in the ColumnMenu and it will hide the one above it in the list instead. It's like the column menu doesnt know to account for the template columns.

The only workaround I've found is to place the template column as the last column in the grid or to make a bound column and set its title to a blank and set sorting/paging both false, however this still then leaves a blank entry in the column menu and is not desirable. Am I missing something when using template columns and the ColumnMenu in the same grid?

Code for my template column:

columns.Template("<button type=\"button\" class=\"btn btn-grid\" data-id=\"#=Id#\"><i class=\"fas fa-fw fa-pencil-alt\"></i></button>");

 

Heres is some code of a grid (I chopped a lot of code out of this grid to simplify it and verified this still has the issue), all of my grids across many projects share this issue. This grid is using version 2020.2.617 and the bootstrap theme.

@(Html.Kendo().Grid<TagGridViewModel>().Name("gridTags")
.Columns(columns =>
{
columns.Template("<button type=\"button\" class=\"btn btn-grid\" data-id=\"#=Id#\"><i class=\"fas fa-fw fa-pencil-alt\"></i></button>");
columns.Bound(c => c.TagId).Filterable(f => f.Cell(cell => cell.ShowOperators(false).SuggestionOperator(FilterType.Contains).MinLength(2))).ClientTemplate($"<a class=\"grid-link\" href=\"{Url.Action("Details", "Tags")}/#=Id#\">#:{nameof(TagGridViewModel.TagId)}#</a>");
columns.Bound(c => c.AddDate).Filterable(false);
columns.Bound(c => c.UpdateDate).Title("Updated").Filterable(false).ClientTemplate($"#={nameof(TagGridViewModel.UpdateDateDisplay)}#");
})
.ColumnMenu(true)
.DataSource(dataSource => dataSource.Ajax().PageSize(25)
.ServerOperation(false)
.Read(read => read.Action("DetailsTagsGridRead", "Clients", new { clientId = Model.Location.ClientId, locationId = Model.Location.Id }))
.Events(events => events.Error("gridError"))
)
)
Aleksandar
Telerik team
 updated answer on 08 Jun 2021
1 answer
116 views

Hello

when mixing Text() and TemplateId() for the headers in a LayoutGrid, it is working fine until Text() is used the first time. After that the header uses the content of the previous header.

The complete example (just copy / paste it):

<div class="demo-section list-wrapper">
    <h3 class="title">
        Reorder Items
    </h3>
    <script id="ll" type="text/x-kendo-template">
        <ul>
            <li class="list-left">Item 1</li>
            <li class="list-left">Item 2</li>
            <li class="list-left">Item 3</li>
        </ul>
    </script>

    <script id="lr" type="text/x-kendo-template">
        <ul>
            <li class="list-right">Item a</li>
            <li class="list-right">Item b</li>
            <li class="list-right">Item c</li>
        </ul>
    </script>

    <script id="header-template" type="text/x-kendo-template">
        <strong>List 2</strong>
    </script>

    <script id="header-template-1" type="text/x-kendo-template">
        <strong>Liste 1</strong>
    </script>
</div>


@(Html.Kendo().TileLayout()
    .Name("tilelayout")
    .Columns(4)
    .Containers(c => {
        c.Add().Header(h => h.TemplateId("header-template-1")).BodyTemplateId("ll");
        c.Add().Header(h => h.TemplateId("header-template")).BodyTemplateId("lr");
        c.Add().Header(h => h.Text("Header for List")).BodyTemplateId("ll");
        c.Add().Header(h => h.TemplateId("header-template")).BodyTemplateId("lr");
    })
    .Resizable()
    .Reorderable()
)

 

I would expect for the headers:

- Liste 1

- List 2

- Header for List

- List 2

 

I get this:

The last one is wrong.

Of course, I can use TemplateId() for all of them.

If it is by design, add a note to the documentation, please.

Best regards

Christine

Aleksandar
Telerik team
 answered on 08 Jun 2021
1 answer
240 views

I have attached the code plus the error message.

 

kendo support us in 2 ways to declare control in razor view.
- @(
Html.Kendo().DatePicker
)
- @{
Html.Kendo().DatePicker()
.Render();
}

 

but with the second if I add HtmlAttribute with 4 attribute inside, it will get error.
 ex: @{
Html.Kendo().DatePicker()
.HtmlAttribute(new {a="id1", b ="id2", c="id3", d="id4"})
.Render();
}
Mihaela
Telerik team
 answered on 07 Jun 2021
3 answers
205 views

How to localize "Retry", "Cancel" buttons of the Spreadsheet messages?

 

I added that to the head of the page, but didn't help

<script src="https://kendo.cdn.telerik.com/2021.1.330/js/cultures/kendo.culture.fr-FR.min.js")"></script>
<script src="https://kendo.cdn.telerik.com/2021.1.330/js/messages/kendo.messages.fr-FR.min.js"></script>

The question is also on SO: question

Stoyan
Telerik team
 answered on 04 Jun 2021
1 answer
397 views

    We are using telerik.web.ui  (version 2010.2.713.35 ) controls for displaying results in data grid format in our ASP.Net web application .

We have a new requirement to show the signature image in result grid for each record. Currently we store the signature image as base64 format in our database .we are able to convert base 64 to memory stream.

  We want to understand does any of your image control support to bind image from memory stream instead of Url.please refer below png file for reference.


 

 

Mihaela
Telerik team
 answered on 04 Jun 2021
1 answer
131 views

Hello,

I am trying to have a groupable Kendo grid with help of your demo.

https://demos.telerik.com/aspnet-core/grid/grouppaging

My question is, is there a way to implement it with custom data binding and not ajax data binding? when I try to do that, there's an error saying that GroupPaging() cannot be resolved.

 

Thank you in advance.

Mihaela
Telerik team
 answered on 03 Jun 2021
1 answer
145 views

In the Ajax control, you have the ability to filter a list and, if the term is not found, execute a command on the new term you typed in. This is in the Ajax demo at https://demos.telerik.com/aspnet-ajax/combobox/examples/functionality/autocompleteclientside/defaultcs.aspx?_ga=2.149674102.1173080875.1622059656-840544784.1585530237 in the Autocomplete example at the top. I am not seeing this functionality replicated in the documentation for .NET Core. Is it possible to do something like this using a Tag Helper? If so, how would one go about it?

Thanks!

Laurie

p.s. For example, if I enter antoine@telerik.com (not found in the list), and click Submit, the message "You have selected the following email: antoine@teleri.com" will be displayed.

Stoyan
Telerik team
 answered on 02 Jun 2021
1 answer
1.3K+ views

Hi eveyone,

How can i remove the Form Clear Button?

Thanks

Petar
Telerik team
 answered on 02 Jun 2021
1 answer
304 views
I have attached the error, using the kendo tooltip error, and a sample of my code as well.
Petar
Telerik team
 answered on 02 Jun 2021
1 answer
1.8K+ views

I need to pass parameter with grid to controller just i want to pass  

BusId , FlightId , griddata to controller 

 

this funtion send only griddata  i want to add BusId , FlightId to save it in one table

   function SaveData(e) {

        var List = []

        BusId: $("#BusId").val() form DropdownList (1) cascadeDrop

       FlightId: $("#Flights").val()  form DropdownList (2) cascadeDrop

       var griddata = $("#Grid").data("kendoGrid"); From Selected Grid

        var rows = griddata.select(); which i selected form grid
        rows.each(function (e) {
            var dataItem = griddata.dataItem(this);
            List.push(dataItem);
        });
       
           $.ajax({
                 type: "POST",
                 url: "@Url.Action("Create", "Employee")",
                 dataType: "text",
                 data: JSON.stringify(List),
                 contentType: "application/json; charset=utf-8",
                 processData: false,

               success: function (data) {

               },

               error: function (e) {

}

   viewModel

   public class EmpViewModel
    {
        public int BusId{ get; set; }

        public int FlightId{ get; set; }

       public List<Employee>AllEmployee{ get; set; }
    }

 

Controller

public IActionResult Create([FromBody] IEnumerable<Employee> empList)
        {

        }

                                                                  
Stoyan
Telerik team
 answered on 01 Jun 2021
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?