Telerik Forums
UI for ASP.NET MVC Forum
1 answer
120 views

I'm trying to use the Kendo UI Breadcrumb component.  I have it set up like so:

 

            @(Html.Kendo().Breadcrumb()
            .Name("breadcrumb")
            .BindToLocation(true)
            .Navigational(true)
            )

 

This works fine, except when routing to a page multiple levels down in my web app.  For example, my project structure is:

Pages/Index.cshtml
Pages/Core/Page2.cshtml

So Pages/Index.cshtml  shows just the Home icon.  Great.

But pages/Core/Page2.cshtml shows this in the breadcrumbs:  HomeIcon > > Page2  instead of HomeIcon > Page2

How do I make the breadcrumb not display that blank space where a folder isas part of the path?  I don't want to hard code the breadcrumbs -- that sort of defeats the purpose. 

Patrick | Technical Support Engineer, Senior
Telerik team
 answered on 18 Feb 2022
0 answers
123 views

We're using Telerik.UI.for.AspNet.Mvc5.2021.2.511 to input 2 dates.

var culture = System.Globalization.CultureInfo.CurrentCulture.ToString();

<script src="~/Scripts/kendo/2021.2.511/cultures/kendo.culture.@(culture).min.js"></script>

kendo.culture("@culture");


<div class="form-group">
              @Html.LabelFor(m => m.StartDate, new { @class = "col-md-2 control-label" })
             <div class="col-md-10 k-content">
                  @(Html.Kendo().DatePicker()
                        .Name("StartDate")
                       //.Min(DateTime.Today)
                       .Max(new DateTime(2030, 12, 31))
                       .Value(DateTime.Today.AddDays(1))
                      .Events(e => e.Change("startChange"))
                       .Culture(culture)
                  .HtmlAttributes(new { @data_val = "false", validationMessage = @DisplayText.Get("InvalidDateWarning") })
                  )
                </div>
              </div>

             <div class="form-group">
                 @Html.LabelFor(m => m.EndDate, new { @class = "col-md-2 control-label" })
                   <div class="col-md-10 k-content">
                      @(Html.Kendo().DatePicker()
                        .Name("EndDate")
                         .Min(DateTime.Today)
                         .Max(new DateTime(2030, 12, 31))
                        .Value(DateTime.Today.AddDays(1))
                        .Events(e => e.Change("endChange"))
                        .Culture(culture)
                         .HtmlAttributes(new { @data_val = "false", validationMessage = @DisplayText.Get("InvalidDateWarning") })
                   )
                 </div>
              </div>

When this is run locally in VS it works as expected, but once it's published to the server it complains of an invalid date. Using the debug tools in the browser it shows the attached. The Kendo cultures are correct and the input culture is correct and the date value is correct, so I'm at a loss as to what's going wrong.

Originally we were using the suggested Validation framework, but the same scenario was happening, it worked locally but not once published. This happens in both Chrome and Edge.

Has anyone ever experienced this before?

I've tried the same code now against different languages and it seems to be specific to Czech, so far.

It's the spaces.

Telerik, Is this a bug?

Steve
Top achievements
Rank 1
 updated question on 16 Feb 2022
1 answer
281 views

I'm using Kendo UI for aspnet core MVC. And whenever I use the search with a numeric value I get an exception:

Provided expression should have string type (Parameter 'stringExpression')

It works however great with strings. So for example: "test" works but 5 throws an exception.

My search in my grid is configured like this


.Search(s => { 
                    s.Field(c => c.IncidentEvent, "contains"); 
                    s.Field(c => c.CourseNumber, "contains"); 
                    s.Field(c => c.CourseCode, "contains");
                    s.Field(c => c.ActivityType, "contains");
                    s.Field(c => c.SeverityType, "contains");

All my fields are of string type. However I expect kendo grid to be able to parse integers as well when doing a search.

Is there a way around this? How can I get my search to work with numbers as well?


Ivan Danchev
Telerik team
 answered on 15 Feb 2022
1 answer
205 views

I'm trying to use the custom command functionality in the grid component. When giving my custom command a template, the click event isn't triggered. the template is basically just a span so I can use my icon.

If I don't give an onclick event to the span, the click event is never triggered. But if I do give an onclick event it is triggered but I cannot access the dataItem object. So I am not able to retrieve the row data.

 

 

Eyup
Telerik team
 answered on 11 Feb 2022
1 answer
202 views

I am having trouble with font sizing with the UI for Telerik. I posted before about setting font sizes for the datepicker and dropdowns which now work great.

Now I am having trouble setting the font size for the textbox control with floating label.

<div class="demo-section k-content">
    <h4>Set value</h4>
    @(Html.Kendo().TextBox()
        .Name("textbox")
        .Placeholder("Name")
        .Label(label => label
            .Content("Name")
            .Floating(true)
        )
        .HtmlAttributes(new { style = "width: 100%" })
    )

    <style>
        .k-floating-label-container {
            width: 100%;
        }
    </style>
</div>

I have modified CSS but the floating label looks incorrect when font size is adjusted through CSS. I would like size 14px font for both the input text and the floating label. How can I achieve this? Currently increasing the font size of the floating label makes the label not "float" far enough to the top, and obscures the textbox. Any help is appreciated.

Here is some examples of the extremely small text occuring on all UI inputs...

Textbox with filtering:

Datepicker:

This is really becoming a problem.

I still need a fix for the floating textbox, but I am wondering if there is a more universal fix that can be applied in the universal CSS. Please help, this is my only complaint with the UI so far.

I am losing time trying to adjust font sizes.

 

Eyup
Telerik team
 answered on 10 Feb 2022
7 answers
453 views
I need to know how to change the Event Editor title, for example if I am using the scheduler to set appointments not events so I need to change the title of Editor from Event to Appointment, is there a way to perform that?
Samir
Top achievements
Rank 1
Iron
 answered on 10 Feb 2022
1 answer
141 views

 

How to restrict multiple key press events while entering characters in kendo grid auto populate text box
eg. If enter 3 characters in auto populate textbox its is hitting 3 times action method. How to avoid multiple
server action calls. Please find the pseudo code as below :

@(Html.Kendo().Grid<Model>().Name("Grid")
.AutoBind(Model.AutoPopulateResults)
.Columns(columns =>
{
columns.Bound(theMember => theMember.LastName).Width(30).Filterable(ftb => ftb.Cell(cell => cell.Operator("contains").ShowOperators(false).MinLength(3).SuggestionOperator(FilterType.Contains)));
}
.DataSource(dataBinding => dataBinding.Ajax()
.Read(read => read.Action("ActionMethod", "Controller").Data("SearchParameters"))
.Events(events => events.Error("handleAjaxErrorFromGrid"))
.ServerOperation(true)
.Filterable(ftb => ftb.Mode(GridFilterMode.Row))
.Events(events => events.Change("GridRowSelected")
.Filter("GridRowonFiltering"))

 

 

 

Eric
Top achievements
Rank 1
Veteran
Iron
 answered on 09 Feb 2022
1 answer
135 views

Hello,

I currently open up a selected word document which is displayed on the editor and I am able to edit it however I can not save the edited document.

I am using the Kendo Editor Control to edit documents and would like to know if there are any ways to save the text that was edited on the editor ? I could not find any demos on how its done. 

 

Kind Regards 

Anisha

Eyup
Telerik team
 answered on 09 Feb 2022
4 answers
295 views

Hello all.

Some of my events are not all day events but they have a multiple days length. Example duration "2.00:30:00". But such events are not rendered in the scheduler calendar views. Only in the agenda view.

How can I persuade the day/week/workweek views to show such events?

Kind regaards

Bernd

Josselin
Top achievements
Rank 1
Iron
 answered on 09 Feb 2022
1 answer
1.9K+ views

I am experiencing two issues. 

  1. Every time I type a character in the filter box at the top of any of my columns, my Ajax Read method ("_CustomBinding") is called 2 times.  The first call populates the type ahead of the filter box, and the second one refreshes the grid.  I do not want the grid to refresh until the enter key is pressed in the filter box, not on each key press.  How do I disable the call to refresh the grid on every key press in the filter box?
  2. From the Kendo examples, I cannot find a way to differentiate between the Ajax Read call for populating the grid and populating the type ahead data in the filter boxes at the top of the columns.  I need to be able to differentiate between these two uses for a couple of reasons.
  1. My grid performs all of the paging on the server.  When I type into a column filter box, the call to the binding method includes the page number and page size.  This causes my database query to limit the results to only records for the current page, which is not what I want.  The auto fill should include values for all pages.  I see in your online example that you do not apply paging at the database level, which is why it includes results across pages. 
  2. If I were successful at ignoring the paging when fetching the type ahead data, it would pull back way too many records.  I need to be able to differentiate between type ahead calls and ones for populating my grid data so that I can apply a distinct select for only the one column needed on my database query to properly fetch just the data needed for display in the type ahead, so I won’t have performance issues.

 

Please, advise me as to how I can overcome these issues.  Thank you.

I have a very complicated Kendo Grid.  Here is just part of it:

 

@(Html.Kendo().Grid<ProspectiveAdvantage.ViewModels.MemberListingModel>().Name("Members").TableHtmlAttributes(new { @class = "tblPatient" })

    .AutoBind(Model.AutoPopulateResults)

    .Columns(columns =>

    {

        columns.Bound(theMember => theMember.LastName).Width(30).Filterable(ftb => ftb.Cell(cell => cell.Operator("contains").ShowOperators(false).MinLength(3).SuggestionOperator(FilterType.Contains)));

        columns.Bound(theMember => theMember.FirstName).Width(30).Filterable(ftb => ftb.Cell(cell => cell.Operator("contains").ShowOperators(false).MinLength(3).SuggestionOperator(FilterType.Contains)));

        columns.Bound(theMember => theMember.DisplayClientMemberId).HeaderTemplate("Patient ID").Width(30).Filterable(ftb => ftb.Cell(cell => cell.Operator("contains").ShowOperators(false).MinLength(3).SuggestionOperator(FilterType.Contains)));

        columns.Bound(theMember => theMember.DisplayBirthDate).HeaderTemplate("DOB").Format("{0:MM/dd/yyyy}").Width(30).Filterable(ftb => ftb.Cell(cell => cell.Operator("contains").ShowOperators(false).MinLength(3).SuggestionOperator(FilterType.Contains)));

…

                .DataSource(dataBinding => dataBinding.Ajax()
                .Read(read => read.Action("_CustomBinding", "PCPandCA").Data("members_FetchSearchParameters"))
                .Events(events => events.Error("handleAjaxErrorFromGrid"))
                 .ServerOperation(true)
                 .PageSize(Model.PageSize).Model(model => { model.Id(e => e.MemberID); model.Field(f => f.FirstName); })
                 //default sort DisplaySignatureDue column by ascending
                 .Sort(sort => {
                     if (!AssessmentExpired) { sort.Add("DisplaySignatureDue").Ascending();}
                     if (AssessmentExpired) { sort.Add("DisplayExpiredDate").Ascending();}
                 })
    )
 
    .Pageable(pageable => pageable
        .PageSizes(true)
        .Refresh(true)
    )
    .Sortable()
    .NoRecords("No records found.")
    .Selectable()
    .Filterable(ftb => ftb.Mode(GridFilterMode.Row))
    .Events(events => events.Change("handleGridRowSelected").DataBinding("handleDataBinding").DataBound("handleDataBound").Filter("onFiltering"))
    .HtmlAttributes(new { style = "cursor:pointer;border: 0px;height: 380px;display: flex;overflow-y: scroll;" })
)

 

 

Yanislav
Telerik team
 answered on 09 Feb 2022
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?