Telerik Forums
UI for ASP.NET Core Forum
7 answers
2.8K+ views

Hi there
Is there anyway to set the PDF VIewer zoom to 'Fit to Width' instead of 'Automatic Width' on startup?

Thanks

Richard

 

 

 

Sotiris
Top achievements
Rank 1
Veteran
Iron
 answered on 30 Mar 2021
1 answer
102 views
Is it possible to change the look of the first, previous next and last buttons to a string representation instead of the < << >> > buttons? If so can someone point me to some resource that shows how to do it? 
Anton Mironov
Telerik team
 answered on 29 Mar 2021
1 answer
289 views
Hi, 
i use nested grid. The inner grid too (grid name:  YemekTipGrid_#=Id#) I want to create a dynamic button

columns.Bound(b => b.Id).Width(205).Title(Localizer["View_Common_Operation"]).ClientTemplate("#=operationButtonsInner(data)#");
this works fine for the grid above.Seems to work for the inner grid but the data of the above grid is coming
shown in telerikforum_3.jpg.  data-id = 2 seen here is the first address of the upper grid. However, the expected value is 7 instead of 2 How can I get the PK IDs of the grid object at the bottom

@(Html.Kendo().Grid<ListYemekTipDto>()
              .Name("YemekTipGrid")
              .Columns(columns =>
              {
                  //columns.Bound(b => b.Id).Title("").ClientHeaderTemplate("<input type='checkbox' id='ck-check-all' />").ClientTemplate(("<input type='checkbox' selector=#=ID# class='ck-secim' ID='#=ID#' name='Sec' />")).Filterable(false);
                  columns.Bound(b => b.Tip).Title(Localizer["View_YemekTip_Model_Tip"]);
                  columns.Bound(b => b.Ucret).Title(Localizer["View_YemekTip_Model_Ucret"]);
                  columns.Bound(b => b.ParentYemekTipId).Title(Localizer["View_YemekTip_Model_ParentId"]);
                  columns.Bound(b => b.Not).Title(Localizer["View_YemekTip_Model_Not"]);
                  columns.Bound(b => b.Aciklama).Title(Localizer["View_YemekTip_Model_Aciklama"]);

                  columns.Bound(b => b.KayitDurumu).Title(Localizer["View_Common_KayitDurumu"]).Width(50).ClientTemplate("<span id='badge_#=Id#' class='badgeTemplate'></span>");
                  columns.Bound(b => b.Id).Width(205).Title(Localizer["View_Common_Operation"]).ClientTemplate("#=operationButtons(data)#");
              })
              .ToolBar(toolbar =>
              {
                  toolbar.Search().Text(Localizer["Grid_Common_Search"]);
                  //toolbar.Excel().Text(Localizer["Grid_Common_Excel"]);
                  //toolbar.Pdf().Text(Localizer["Grid_Common_Pdf"]);
                  //toolbar.Custom().Text(Localizer["Grid_Common_NewRecord"]).IconClass("fa fa-plus").HtmlAttributes(new { @class = "modal-action", data_type = "get", data_url = Url.Action("Ekle", "YemekTip", new { area = "Yonetim" }), data_grid = "#YemekTipGrid", data_title = Localizer["View_Common_CreateOperation"], data_buttons = "true", data_savetext = Localizer["View_Common_Create"] });
              })
              .Pageable()
              .Sortable()
              .Filterable()
              .Navigatable()
              .ColumnMenu()
              .ClientDetailTemplateId("templateInner")
              .HtmlAttributes(new { style = "height:430px;" })
              .Resizable(r => r.Columns(true))
              .Reorderable(r => r.Columns(true))
              .Groupable(g => g.ShowFooter(false))
              //.Events(events => events.DataBound("onDataBound"))
              .DataSource(dataSource => dataSource
                .Ajax()
                .Batch(true)
                .PageSize(15)
                .AutoSync(true)
                .ServerOperation(false)
                .Events(events => events.Error("error_handler"))
                .Read(read => read.Action("Grid", "YemekTip", new { area = "Yonetim" }).Type(HttpVerbs.Post))
              ).Events(events => events.DataBound("dataBound"))
              )

    <script id="templateInner" type="text/kendo-tmpl">
        @(Html.Kendo().Grid<ListYemekTipDto>()
                .Name("YemekTipGrid_#=Id#")
                .Columns(columns =>
                {
                    columns.Bound(b => b.Tip).Title(Localizer["View_YemekTip_Model_Tip"]);
                    columns.Bound(b => b.Ucret).Title(Localizer["View_YemekTip_Model_Ucret"]);
                    columns.Bound(b => b.ParentYemekTipId).Title(Localizer["View_YemekTip_Model_ParentId"]);
                    columns.Bound(b => b.Not).Title(Localizer["View_YemekTip_Model_Not"]);
                    columns.Bound(b => b.Aciklama).Title(Localizer["View_YemekTip_Model_Aciklama"]);
                    //columns.Bound(b => b.KayitDurumu).Title(Localizer["View_Common_KayitDurumu"]).Width(50).ClientTemplate("<span id='badge_#=Id#' class='badgeTemplate'></span>");

                    columns.Bound(b => b.Id).Width(205).Title(Localizer["View_Common_Operation"]).ClientTemplate("#=operationButtonsInner(data)#");

                })
                .DataSource(dataSource => dataSource
                    .Ajax()
                    .Batch(true)
                    .PageSize(15)
                    .AutoSync(true)
                    .ServerOperation(false)
                    .Events(events => events.Error("error_handler"))
                    .Read(read => read.Action("HierarchyBindingGrid", "YemekTip", new { area = "Yonetim", Id = "#=Id#" }).Type(HttpVerbs.Post)))
                    .Pageable()
                    .Sortable()
                    .Filterable()
                    .Navigatable()
                    .ColumnMenu()
                    .Resizable(r => r.Columns(true))
                    .Reorderable(r => r.Columns(true))
                    .Groupable(g => g.ShowFooter(false))
                    .Events(events => events.DataBound("dataBound"))
                .ToClientTemplate()
        )
    </script>

   function operationButtonsInner(data) {
            console.log("operationButtonsInner",data);
           var template = "";

            template += "<a class='btn btn-default btn-outline btn-xs modal-action mr-5' data-toggle='modal' data-rel='tooltip' data-placement='top' title='@Html.Raw(Localizer["View_Common_UpdateOperation"])' data-url='" + guncelleUrl + "' data-type='get' data-id='" + data.Id +"' data-title='@Html.Raw(Localizer["View_Common_UpdateOperation"])'  data-savetext='@Html.Raw(Localizer["View_Common_Update"])' data-buttons='true'><i class='fa fa-pencil' aria-hidden='true'></i></a>";
            template += "<a class='btn btn-default btn-outline btn-xs modal-action mr-5' data-toggle='modal' data-rel='tooltip' data-placement='top' title='@Html.Raw(Localizer["View_Common_DeleteOperation"])' data-url='" + silUrl + "' data-type='delete' data-id='" + data.Id +"' data-title='@Html.Raw(Localizer["View_Common_DeleteOperation"])'  data-savetext=' @Html.Raw(Localizer["View_Common_Delete"])' data-message='@Html.Raw(Localizer["View_Common_Delete_Message"])'><i class='fa fa-trash' aria-hidden='true'></i></a>";
            template += "<a class='btn btn-default btn-outline btn-xs modal-action mr-5' data-toggle='modal' data-rel='tooltip' data-placement='top' title='@Html.Raw(Localizer["View_Common_PreviewOperation"])' data-url='" + goruntuleUrl + "' data-type='get' data-id='" + data.Id + "' data-title='@Html.Raw(Localizer["View_Common_PreviewOperation"])'><i class='fa fa-eye' aria-hidden='true'></i></a>";

            if (data.KayitDurumu == @((int)EntityStatus.ACTIVE))
            {
                template += "<a class='btn btn-default btn-outline btn-xs modal-action mr-5' data-toggle='modal' data-rel='tooltip' data-placement='top' title='@Html.Raw(Localizer["View_Common_PassiveOperation"])' data-type='put' data-url='" + durumDegistirUrl + "' data-id=" + data.Id + " data-value='" + @((int)EntityStatus.PASSIVE) + "' data-title='@Html.Raw(Localizer["View_Common_PassiveOperation"])' data-message='@Html.Raw(Localizer["View_Common_PassiveMessage"])' data-savetext='@Html.Raw(Localizer["View_Common_PassiveOperation"])' ><i class='fa fa-unlock' aria-hidden='true'></i></a>";
            }
            if (data.KayitDurumu == @((int)EntityStatus.PASSIVE))
            {
                template += "<a class='btn btn-default btn-outline btn-xs modal-action mr-5' data-toggle='modal' data-rel='tooltip' data-placement='top' title='@Html.Raw(Localizer["View_Common_ActiveOperation"])' data-type='put' data-url='" + durumDegistirUrl + "' data-id=" + data.Id + " data-value='" + @((int)EntityStatus.ACTIVE) + "' data-title='@Html.Raw(Localizer["View_Common_ActiveOperation"])' data-message='@Html.Raw(Localizer["View_Common_ActiveMessage"])'  data-savetext='@Html.Raw(Localizer["View_Common_ActiveOperation"])' ><i class='fa fa-lock' aria-hidden='true'></i></a>";
            }
            return template;
         }
 
Nikolay
Telerik team
 answered on 26 Mar 2021
4 answers
180 views

Is there a way to configure steps server-side, like you can with the grid via LoadSettings?

If not, how do you configure the steps dynamically?

For example if the configuration of the steps comes from a database?

Stoyan
Telerik team
 answered on 25 Mar 2021
3 answers
114 views

Hi,

When adding a textarea to a form, I get different html rendered result:

 

<kendo-textarea name="reason-reject" rows="5" placeholder="Specify rejection reason" on-change="">
 
</kendo-textarea>
 
@(Html.Kendo().TextArea()
    .Name("invitation")
    .Placeholder("Enter your text here.")
    .Rows(10)
    .MaxLength(200)
    .HtmlAttributes(new { style = "width: 100%", required = true, data_required_msg = "Please enter a text.", data_max_msg= "Enter value between 1 and 200" })
    )

 

Even using the simple form of widget from the samples, generated invalid html.... Can you provide any guidance ?

Is is possible with taghelper, mark the control as mandatory ? 

Any help will be highly appreciated,

Manuel

 

Anton Mironov
Telerik team
 answered on 25 Mar 2021
3 answers
215 views

Hello,

 

In old Kendo.Mvc I was using following method to generate sever side Template for column.

Now I'm migrating project to ASP Net Core and this method is missing, is it moved to somewhere else?

public virtual GridTemplateColumnBuilder<TModel> Template( Func<TModel, object> template );

 

columns.Template( c => @Html.ActionLink( c[column_name].ToString(), "actionName",
            new { encrypted_id = Shared.EncryptId( c[column_id] ) } )
            .ToHtmlString() ).Title( "Column Title" );

Anton Mironov
Telerik team
 answered on 25 Mar 2021
5 answers
199 views

When a vertical menu is rendered, the arrow denoting a sub-menu starts out in the wrong position, left aligned against the menu item text, and then moves to its correct right aligned position.

 

Sometimes this is barely perceivable, but other times is very noticeable, mostly during navigation. See the attached GIF for an example of the issue.

I suspect it has something to do with page resources loading (e.g. CSS).

I am unable to reproduce this with Kendo UI in the Dojo, but this is probably because the menu is not rendered on page load.

It is mostly noticeable in Chrome, but can be seen in Edge and IE (it's difficult to tell with Edge/IE because their rendering in general is terrible).

Code used for the menu:-

@(Html.Kendo().Menu()
    .Name("menu")
    .Orientation(MenuOrientation.Vertical)
    .HtmlAttributes(new
    {
        style = "width: 200px;"
    })
    .Items(items =>
    {
        items.Add().Text("Meters").Action("Index", "Meter").Items(x =>
        {
            x.Add().Text("Create").Action("Create", "Meter");
        });
 
        items.Add().Text("Meter Groups").Action("Index", "MeterGroup").Items(x =>
        {
            x.Add().Text("Create").Action("Create", "MeterGroup");
        });
 
        items.Add().Text("Meter Types").Action("Index", "MeterType").Items(x =>
        {
            x.Add().Text("Create").Action("Create", "MeterType");
        });
 
        items.Add().Text("Messages").Action("Index", "Message");
    })
)
Neli
Telerik team
 answered on 24 Mar 2021
1 answer
124 views
What is the best way to display a sidebar gallery of my custom shapes for the diagram and allow the user to drag the items over to a diagram? There is not alot of documentation available for .Net Core.
Tsvetomir
Telerik team
 answered on 24 Mar 2021
1 answer
101 views

I'm having a problem with Kendo .Pagable. We have a webapplication that displays entries in a grid. The user can choose between 25, 50, 100, 200 entries per site. But whenever the user enters the entry edit page and goes back to the overview page it gets reset to 25 entries per page.

I could not find out how to persist the state (let's say 100 entries per page) for the grid on reload. Can you help me out?

Here the code snippet 

01.GRID.DataSource(dataSource => dataSource
02.          .Ajax()
03.          .PageSize(25)
04.          .Model(m => { m.Id(a => a.Id); })
05.          .Read(read => read
06.              .Action("Read", "Overview")
07.              .Data("additionalGridData"))
08.          .Sort(x => x.Add(y => y.Id))
09.      )
10.      .AutoBind(false)
11.      .Filterable()
12.      .Sortable(c=>c.SortMode(GridSortMode.MultipleColumn).AllowUnsort(true).ShowIndexes(true).Enabled(true))
13.      .Pageable(p => p.PageSizes(new[] {25, 50, 100, 200}))

Thanks in advance!

Tsvetomir
Telerik team
 answered on 23 Mar 2021
7 answers
2.7K+ views

My apologies if this is the wrong forum for this, but I am having some trouble with a dropdownlist validation

<div class="form-group">
        <label asp-for="RoleModuleId" class="control-label col-md-2">Module</label>
        @(Html.Kendo().DropDownListFor(c => c.RoleModuleId)
              .OptionLabel("-- Select a Module --")
              .HtmlAttributes(new { style = "width:21%", id = "moduleDropdown", required = "required" })
              .BindTo(Model.Modules.OrderBy(c => c.Name))
              .DataTextField("Name")
              .DataValueField("Id"))
    </div>
    <div class="form-group">
        <label asp-for="Name" class="control-label col-md-2">Name</label>
        @(Html.Kendo().TextBox()
            .Name("Name")
            .HtmlAttributes(new { style = "width: 100%", placeholder = "Name of role", required = "required" })
        )
    </div>

With the TextBox if there is nothing selected it will give a little warning message and have the box flash red, and it will prevent the form from submitting. Similarly if nothing is selected for the dropdownlist it will prevent the form from being submitted, but will give no indication. This comes across that there is something wrong with the form, and I believe could cause some confusion.

 

Is this intended behavior or am I missing something?

 

Be well,

Bradley

Petar
Telerik team
 answered on 22 Mar 2021
Narrow your results
Selected tags
Tags
+? more
Top users last month
Will
Top achievements
Rank 2
Iron
Motti
Top achievements
Rank 1
Iron
Hester
Top achievements
Rank 1
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Thomas
Top achievements
Rank 2
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Will
Top achievements
Rank 2
Iron
Motti
Top achievements
Rank 1
Iron
Hester
Top achievements
Rank 1
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Thomas
Top achievements
Rank 2
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?