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

Hello, 

I am trying to use a DDL (This happens to both HTML Helper & Tag Helper) With a 'Option-Label'. however, every time this is applied it causes the DDL to deformat. Please see the attached pictures. Do you have any idea why this is happening? 

Misho
Telerik team
 answered on 05 Feb 2019
5 answers
435 views

I have an issue where the DIV on the bottom of the edit templates is not filling the width of the window.  Please see attached.

I have added the following .css which seems to control it but if the width is set to "auto" or "100%" it looks like the attachment.  If I change to to a specific pixel width it sizes but as I remember this should not need to be manually handled.

<style>
   div.k-edit-buttons.k-state-default{
     /*width:560px;*/
     width:100%;
    }
</style>

 

The grid does have the height and width set in the column declarations

.Editable(editable => editable.Mode(GridEditMode.PopUp).TemplateName("Template").Window(x => x.Width(600).Height(500)))

 

Please advise

 

Reid
Top achievements
Rank 2
 answered on 05 Feb 2019
2 answers
232 views

Have a grid and context menu defined in a partial view.  When the grid is positioned where the page is scrolled to the top then the context menu opens at point of right mouse click.  But as soon as page is scrolled down and grid is partially moved up and hidden from view, then the context menu is not positioned correctly on the y axis.

 

@using Kendo.Mvc.UI

@using NEP_Deconstruction.Data
@{
    const string ValuesSuffix = "-Values";
}

@(Html.Kendo().Grid<NEP_Deconstruction.Data.Models.ApprovalViewModel>()
                    .Name("approval_grid")
                    .Columns(columns =>
                    {
                        columns.Bound(o => o.ID)
                            .EditorTemplateName("IntegerReadonly");
                        columns.Bound(o => o.ApprovalNumber)
                            .EditorTemplateName("IntegerReadonly");
                        columns.Bound(o => o.SourceCount)
                            // other column definitions
                        columns.Bound(o => o.Comment);

                        columns.Command(command =>
                        {
                            command.Edit().Text(" ").IconClass("k-icon k-i-edit").HtmlAttributes(new { style = "min-width: auto" });
                            command.Destroy().Text(" ").IconClass("k-icon k-i-delete").HtmlAttributes(new { style = "min-width: auto" });
                        }).Width(/*210*/ 125);
                    })
                    .ToolBar(toolbar => { toolbar.Create(); /*toolbar.Save();*/ })
                    .Editable(editable =>
                    {
                        editable.TemplateName("ApprovalPopupEditor");
                        editable.Mode(GridEditMode.PopUp);
                    })
                    .Resizable(c => c.Columns(true))
                    .Reorderable(c => c.Columns(true))
                    .Filterable()
                    .Groupable()
                    .Pageable(p => p.Numeric(false).PreviousNext(false))
                    .Selectable()
                    .Sortable()
                    .Scrollable(scrollable => scrollable.Virtual(true).Endless(true))
                    .ColumnMenu()
                    .HtmlAttributes(new { style = "height:430px;" })
                    .DataSource(dataSource => dataSource
                        .Ajax()
                        .Batch(true)
                        .PageSize(100)
                        .ServerOperation(true)
                        .Events(events => events.Error("error_handler")
                                                .RequestStart("approval_grid_requeststart"))
                        .Model(model =>
                        {
                            // ***
                            // various default values set
                        })
                        .Read(read => read.Action("Read", "Approval"))
                        .Create(create => create.Action("Create", "Approval"))
                        .Update(update => update.Action("Update", "Approval"))
                        .Destroy(destroy => destroy.Action("Destroy", "Approval"))
                    )
                    .Events(events => events.Change("approval_grid_change")
                                            .DataBound("approval_grid_databound")
                                            .Edit("approval_grid_edit")
                                            .Save("approval_grid_save"))
)
@(Html.Kendo().ContextMenu()
                    .Name("approval_menu")
                    .Target("#approval_grid")
                    .Filter("tr[role='row']")
                    .Orientation(ContextMenuOrientation.Vertical)
                    .Items(items =>
                    {
                        items.Add()
                        .Text("Refresh");
                        //.ImageUrl(Url.Content("~/shared/web/toolbar/reply.png"))
                        items.Add()
                        .Text("Edit");
                        items.Add()
                        .Text("Delete");
                    })
                    .Events(e => e.Select("approval_menu_select"))
)

 

Edward
Top achievements
Rank 1
 answered on 04 Feb 2019
1 answer
524 views

I have found many examples of cascading from DropDownListFor to DropDownListFor using the CascadeFrom() event. However, I need to get a similar effect from using a DropDownListFor to a MultiSelectFor. Since the MultiSelectFor does not have the CascadeFrom() event,  how would I go about making it work? 

Example
- The user selects an item from the DropDownListFor.
- The MultiSelectFor DataSource will be updated based on the selected item of the DropDownListFor.
- The MultiSelectFor will be enabled/disabled based on DropDownListFor.

Found the following JS sample but it does not seem to really apply to asp.net core.
https://docs.telerik.com/kendo-ui/controls/editors/multiselect/how-to/cascade/cascade-from-ddl


Any help will be greatly appreciated.

Hilton
Top achievements
Rank 1
 answered on 04 Feb 2019
4 answers
1.0K+ views

Is there a way to ignore a model property when posting to an action from a grid? Delete, create, update etc. The property needs to be loaded with the grid in the read action but not posted to the delete, create and update actions.

Eli
Top achievements
Rank 1
Veteran
 answered on 01 Feb 2019
1 answer
138 views

Hello,

 

I'm running a .net core 2.1 mvc application.

I built a custom theme from the theme builder with the bootstrap 4 template (not many changes to this base template).

When i updated from 2018.3.1017 to 2019.1.115 i started having problems with datepickers with weeknumbers. See attached files.

If i downgrade to 2018.3.1017 the dates fit as expected in the datepicker.

 

Best regards,

Sebastian

Preslav
Telerik team
 answered on 01 Feb 2019
2 answers
111 views

Hi,

I have used the telerik theme with Scss but today I found a problem with the autocomplete. After the file is compiled the generated class is

.k-autocomplete {
  padding-right: calc( calc( 0.75rem + 17px)); }
  .k-rtl .k-autocomplete, .k-autocomplete[dir="rtl"] {
    padding-left: calc( calc( 0.75rem + 17px));
    padding-right: 0; }

This is not the only class that generates this. The above is not a valid use of calc function in IE

 

Dan
Top achievements
Rank 1
Iron
Iron
Veteran
 answered on 01 Feb 2019
1 answer
109 views

Hi - 

Is there a recommended approach to using this component in mobile?  In my tests the component gets clipped when viewing on iPhone or similar device.

Thanks,

Matt

Boyan Dimitrov
Telerik team
 answered on 31 Jan 2019
1 answer
666 views

When exporting a ASP.NET Core Kendo Grid to Excel, we need to add a Custom Header and Footer to the Excel Spreadsheet.  Please note, this does not mean we want to add a row to the Spreadsheet with Column Headers, this means we want to use what Excel calls "Custom Header" and "Custom Footer".  The kendo ooxml export of the grid into an Excel spreadsheet does not seem to expose properties to set the Custom Header and Footer.  As a note, these are custom headers and footers that do not show up with viewing the document in Excel, but DO print, when printing the document, so it can show disclaimers and things.

 

So, we are trying to open the Kendo exported ooxml on the Server Side to add the custom HeaderFooter elements, using the DocumentFormat.OpenXML Library in C#, before returning the file back to the user/client.  After we convert the exported base64 string into a byte array and load it into a MemoryStream, we can successfully use the MemoryStream to create a SpreadsheetDocument object, however all the Workbook parts are empty.  When we try to create a new SpreadsheetDocument, create new workbook parts, and try to insert our exported Sheet we received from Kendo, we get various errors on missing Root Elements or Perhaps other Parent Nodes.

Does anyone have an example of either converting a Grid exported ooxml Excel Sheet into a DocumentFormat.OpenXML Excel sheet in order to add <HeaderFooter> or a way of doing this on the client side, using the ooxml before we go to the Server?

Thank you,

Alan

Alex Hajigeorgieva
Telerik team
 answered on 31 Jan 2019
2 answers
426 views

Hello,

i'm trying to insert a view that includes a grid into a window but i get this error: GridAusiliOspite_Read_Parameters is not defined (but i've defined it in the View)

there is my code... 

Thanks in advance

View to render inside window:

<div class="col-sm-10 col-sm-offset-1">
        @(Html.Kendo().Grid<AusiliKendoGrid>().Name("GridAusili")
                        .Columns(columns =>
                        {
                            columns.Bound(p => p.Nome).ClientTemplate("#=Nome.Descrizione#");
                            columns.Bound(p => p.DataInizio);
                            columns.Bound(p => p.DataFine);
                            columns.Bound(p => p.Owner);
                            columns.Bound(p => p.GGpulizia);
                            columns.Command(command => command.Destroy());
                        })
                        .ToolBar(toolbar =>
                        {
                            toolbar.Create();
                            toolbar.Save();
                        })
                        .Pageable()
                        .Navigatable()
                        .Sortable()
                        .Editable(editable => editable.Mode(GridEditMode.InCell))
                        .DataSource(dataSource => dataSource
                            .Ajax()
                            .Batch(true)
                            .PageSize(20)
                            .ServerOperation(true)
                            .Events(events => events.Error("error_handler"))
                            .Model(model => {
                                model.Id(p => p.Id);
                                //model.Field(p => p.Nome);
                                model.Field(p => p.Nome).DefaultValue(ViewData["DefaultAusilio"] as SGL.Models.EditorTemplatesModel.NomeAusiliModel);
                            })
                        .Create(create => create.Action("GridAusiliOspite_Create", "SchedaInserimento").Data("GridAusiliOspite_Create_Parameters"))
                        .Read(read => read.Action("GridAusiliOspite_Read", "SchedaInserimento").Data("GridAusiliOspite_Read_Parameters"))
                        .Update("GridAusiliOspite_Update", "SchedaInserimento")
                        .Destroy("GridAusiliOspite_Destroy", "SchedaInserimento")
                        )
        )
    </div>
 
 
<script>
function error_handler(e) {
            if (e.errors) {
                var message = "Errors:\n";
                $.each(e.errors, function (key, value) {
                    if ('errors' in value) {
                        $.each(value.errors, function () {
                            message += this + "\n";
                        });
                    }
                });
                alert(message);
            }
        }
 
function GridAusiliOspite_Create_Parameters() {
            return {
                id_ospite: '@ViewData["idOspite"]'
            };
        }
 
 function GridAusiliOspite_Read_Parameters() {
            return {
                id_ospite: '@ViewData["idOspite"]'
            };
        }
    </script>

View where the window should appear:

<kendo-window name="window"
                                  title="Ausili"
                                  draggable="true"
                                  resizable="true"
                                  width="600"
                                  on-close="onClose"
                                  content-url="@Url.Action("Ausili", "SchedaInserimento")"
                                  actions="actions">
                         
                        <popup-animation enabled="false" />
                    </kendo-window>
                    <button type="button" class="col-sm-2 btn-sm btn-light" onclick="addAusili()">Ausili <i class="fab fa-accessible-icon"></i></button>

 

function addAusili() {
 
            $("#window").data("kendoWindow").open();
 
        }
Alberto Zanetti
Top achievements
Rank 1
 answered on 31 Jan 2019
Narrow your results
Selected tags
Tags
+? more
Top users last month
Miljana
Top achievements
Rank 2
Iron
Iron
Joel
Top achievements
Rank 3
Bronze
Bronze
Bronze
Cynthia
Top achievements
Rank 1
John
Top achievements
Rank 1
Iron
Mozart
Top achievements
Rank 1
Iron
Veteran
Want to show your ninja superpower to fellow developers?
Top users last month
Miljana
Top achievements
Rank 2
Iron
Iron
Joel
Top achievements
Rank 3
Bronze
Bronze
Bronze
Cynthia
Top achievements
Rank 1
John
Top achievements
Rank 1
Iron
Mozart
Top achievements
Rank 1
Iron
Veteran
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?