Telerik Forums
UI for ASP.NET MVC Forum
6 answers
1.3K+ views
Hi,
I have a problem with the management of seconds with datetime picker with the "modern" type component: they are not displayed on popup (use of "G" format). Worse, the seconds are initialized with the current seconds (and not 0).
I can understand that there is a problem with the management of AM / PM hours, but that is not my case (24H display)
Is there a solution? apart from going back to "classic" mode, because for touch, the new version is more practical, and without using keyboard input (touchscreen mode)

On the other hand, is there a solution to use this component on a smartphone in landscape mode? (today, the popup is too high and goes out of the screen, or doesn't appear). I tried to put the tabs on the left and the buttons on the right via CSS but without success …

Regards
P.S. : I use kendo ASP.NET MVC 2021.1.224
Anton Mironov
Telerik team
 answered on 06 Apr 2021
5 answers
1.1K+ views

Hi All,

Just wondering where to find sample to invoke item command for checked item on my kendo grid using my custom button?

Also how to show that row is selected when I check the checkbox?

Lastly how to unchecked my header template checkbox when I change page?

columns.Bound(column => column.ProfileID)
.ClientTemplate("<input class='box' type='checkbox' value='#=ProfileID#' />")
.ClientHeaderTemplate("<input type='checkbox' id='selectAll' onclick='toggleSelection()' />")
.Width(40)
.Sortable(false)
.Filterable(false);

Thanks in Advance

Ryan

Mihaela
Telerik team
 answered on 05 Apr 2021
1 answer
141 views
"grid.options.pageable" never contains all values. In my case, I am looking for the values of "numeric" and "previousNext".
Mihaela
Telerik team
 answered on 05 Apr 2021
2 answers
103 views

I have a project that uses Kendo UI version 2019 R3 SP 1.

I got some issues when I do the sorting on the content that contains rich text editor (RTE).

I made some demo in the dojo (https://dojo.telerik.com/@septovan_nalysa/IsEgIxAQ)

You can open the demo try to move one of 2 contents.

The issues are the RTE that you moved:

1. becomes like a read-only/disabled field;

2. has empty value.

I tried to change the Kendo UI version 2021 R1 SP2 but I'm still facing the same issues.

 

Does anyone can help me?
Thanks.

Anton Mironov
Telerik team
 answered on 02 Apr 2021
4 answers
2.0K+ views

I am having some issues with the MVC Wrappers for Kendo UI. It seems that IEnumerable does not support any aggregate values other than count. The exception that I get is: No generic method 'Sum' on type 'System.Linq.Enumerable' is compatible with the supplied type arguments and arguments. No type arguments should be provided if the method is non-generic.  I am using System.LInq.Dynamic but this issue occurs without using a Dynamic query.

I am not sure how to get around this issues nor am I sure if it is a flaw with Kendo.
Controller

public ActionResult Index() { return View(); }
public ActionResult Read([DataSourceRequest] DataSourceRequest request) { return GetView(request); }
private IEnumerable<dynamic> GetData() { var db = new NwEntities(); return db.Products.Select("new(ProductID,ProductName,UnitPrice)"); }
private JsonResult GetView(DataSourceRequest request) { return Json(GetData().ToDataSourceResult(request)); }

View

@model IEnumerable<dynamic>
@(
 Html.Kendo().Grid(Model).Name("Grid")
    .DataSource(ds =>
        ds.Ajax()
        .Model(m =>
        {
            m.Id("ProductID");
            m.Field("ProductName", typeof(string));
            m.Field("UnitPrice", typeof(decimal));
        })
        .Aggregates(aggregate => aggregate.Add(a => "UnitPrice").Count().Sum())
        .Read(r => r.Action("Read", "Home"))
    )
    .Columns(columns =>
    {
        columns.Bound("ProductID");
        columns.Bound("ProductName");
        columns.Bound("UnitPrice").Format("{0:c}");
    })
    .Groupable()
)

I have spent a week trying to get this to work with no luck and this is a critical issue.

Tsvetomir
Telerik team
 answered on 02 Apr 2021
1 answer
351 views

Hi there. Here's my setup;

I have a grid and in the grid I bind to a column. The column has a template applied to it.

View
                    .Columns(current =>
                    {
                        current.Bound(p => p.CurrentMaterial).EditorTemplateName("ddl_Mixing_Materials_Current");
                        current.Group(g1 => g1.Title("Volumes")
                            .Columns(volume =>
                            {
                                volume.Bound(p => p.CurrentVol). EditorTemplateName("kIntegerNoSpinnerNoNegativesNamed"); <---//This one!
                                volume.Command(p => p.Custom("-20").Click("Remove20"));
                            })
                        );

Template

@model int?

@(Html.Kendo().NumericTextBoxFor(m => m)
      .Name("NumericTextBox") <-- I know this will confuse the bounding - I changed just to make next step clearer
      .HtmlAttributes(new { style = "width:100%" })
      .Decimals(0)
      .Placeholder("")
      .Min(0)
      .Max(500) <-- this is what I need to set after data binding!
      .Spinners(false)
)

 

So the issue is, I need to set the max of each column depending on the object bound to it. Each object has a 'maxVolume' that I want to use to set the 'max' value in the template. However - I looked at the API page and I tried to access the numberTextBox like it suggests, but the textbox is always 'undefined'. Here's the script and how I'm trying to access the NumericTextBox

Script

function dataBound(e) {
        var grid = this;
        grid.tbody.find("tr[role='row']").each(function () {
            var model = grid.dataItem(this);
            var maxValue = model.MaxVolume;
            alert(maxValue); <-- All good

            var test2 = $(this).find("#NumericTextBox");
            alert(test2); <-- Object found
            var numericTextBox2 = $('#CurrentVol').data('numerictextbox');
            alert(numericTextBox2); <-- 'Undefined'
            var numericTextBox3 = $(this).find("#NumericTextBox").data('kendoNumericTextBox');
            alert(numericTextBox3); < -- Still 'undefined'
        });
    }

So I'm clearly missing something. Is there some extra bit of traversal I need to do in my script because of the looping through grid rows I do? Am I looking for the wrong .data() type?

Any help would be great. thanks.

Anton Mironov
Telerik team
 answered on 02 Apr 2021
1 answer
168 views
I have a kendo spreadsheet with 1000 rows. It has a column with 1000 unique values. When I tried to give filter option to the column, the filter menu takes time to get displayed. It works fine with columns that have less values. This might have been due to the 1000 options that get displayed in the 'Filter by value' section. Is there any way to disable the Filter by value section and have only the Filter by condition section.
Aleksandar
Telerik team
 answered on 02 Apr 2021
4 answers
2.5K+ views

Hi Team,

I am using the Kendo DateTimePicker and validator to validate the dates. Please find the below code. The issue I am having is that I see the "error message" for all the fields even thought rules returns true for those field. For example, I see the error message for the fields that have return value "false" which is fine. However, after running the validator, once I click on each field, I see the error message for that field. Even though these field have return value "true" from the function I have attached. I do not understand why I see the error message for all the fields. 

1) What I want is I have two conditions in the function (if, else if). If these conditions get true, I want to display the error message. Otherwise, no error message needs to display because those dates are valid.

2) Is there a way to clear/reset the error message if there is any for a specific date field.

I really appreciate your help team. Please get back to me as soon as you can, I am waiting for your relpy.

function executeMaxMinValidationOnEachDate(datesArray) {

    //$("#validateEditableFields").kendoValidator({
    var minDate = 0;
    var maxDate = 2;
    var validator = $("#validateEditableFields").kendoValidator({
        rules: {
            datepicker: function (input) {
                var currDate = kendo.parseDate(input.val()).getTime();
                if (maxDate === 10) {
                    if (input.is("[data-role=datetimepicker]") && currDate < datesArray[minDate]) {
                        return false;
                    }
                }
                else if (input.is("[data-role=datetimepicker]") &&
                    (currDate < datesArray[minDate] || currDate > datesArray[maxDate])) {
                    minDate++;
                    currentDate++;
                    maxDate++;
                    return false;
                    //return input.data("kendoDateTimePicker").value();
                } else {
                    minDate++;
                    currentDate++;
                    maxDate++;
                    return true;
                }
            }
        },
        messages: {
            datepicker: "Please enter valid date!$$$$"
        }
    }).data("kendoValidator");
    validator.validate();
}


Mayurbhai
Top achievements
Rank 1
Veteran
 answered on 01 Apr 2021
5 answers
1.1K+ views

The Boostrap grid system gives wrong result in a Window.
The grid seems to have only 9 columns.

My View :

@(Html.Kendo().Window()
    .Name("window")
    .Title("My window")
    .Width(400)
    .Content(@<text>
    <div class="row">
      <div class="col-md-3">
        First col
      </div>
      <div class="col-md-3">
        Second col
      </div>
      <div class="col-md-3">
        Third col
      </div>
      <div class="col-md-3">
        Fourth col
      </div>
    </div>
    </text>)
)

The result is shown in the png file.

Any suggestions will be very appreciated.

Neli
Telerik team
 answered on 31 Mar 2021
3 answers
511 views

 @(Html.Kendo().TreeView()
                .Name("treeviewDetails")
                .Items(treeview =>
                {
                    treeview.Add().Text("Information")
                        .Expanded(true)
                        .Items(root =>
                        {
                            root.Add().Text("Priority" + ": " + InOnwHours);
                            root.Add().Text("Due Date" + ": " + "Today");
                            root.Add().Text("Return emails" + ": " + "example@gmail.com");
                        });

}     

 

How i can format the part of text in  root.Add().Text text ?  i need show the text after ":"  in different color, style and size. (for example example@gmail.com  in red) see attached image.

 

Thank you for help.

Dimitar
Telerik team
 answered on 31 Mar 2021
Narrow your results
Selected tags
Tags
Grid
General Discussions
Scheduler
DropDownList
Chart
Editor
TreeView
DatePicker
Upload
ComboBox
MultiSelect
ListView
Window
TabStrip
Menu
Installer and VS Extensions
Spreadsheet
AutoComplete
TreeList
Gantt
PanelBar
NumericTextBox
Filter
ToolTip
Map
Diagram
Button
PivotGrid
Form
ListBox
Splitter
Application
FileManager
Sortable
Calendar
View
MaskedTextBox
PDFViewer
TextBox
Toolbar
MultiColumnComboBox
Dialog
DropDownTree
Checkbox
Slider
Switch
Notification
ListView (Mobile)
Pager
Accessibility
ColorPicker
DateRangePicker
Wizard
Security
Styling
Chat
MediaPlayer
TileLayout
DateInput
Drawer
SplitView
Barcode
ButtonGroup (Mobile)
Drawer (Mobile)
ImageEditor
RadioGroup
Sparkline
Stepper
TabStrip (Mobile)
GridLayout
Template
Badge
LinearGauge
ModalView
ResponsivePanel
TextArea
Breadcrumb
ExpansionPanel
Licensing
Rating
ScrollView
ButtonGroup
CheckBoxGroup
NavBar
ProgressBar
QRCode
RadioButton
Scroller
Timeline
TreeMap
TaskBoard
OrgChart
Captcha
ActionSheet
Signature
DateTimePicker
AppBar
BottomNavigation
Card
FloatingActionButton
Localization
MultiViewCalendar
PopOver (Mobile)
Ripple
ScrollView (Mobile)
Switch (Mobile)
PivotGridV2
FlatColorPicker
ColorPalette
DropDownButton
AIPrompt
PropertyGrid
ActionSheet (Mobile)
BulletGraph
Button (Mobile)
Collapsible
Loader
CircularGauge
SkeletonContainer
Popover
HeatMap
Avatar
ColorGradient
CircularProgressBar
SplitButton
StackLayout
TimeDurationPicker
Chip
ChipList
DockManager
ToggleButton
Sankey
OTPInput
ChartWizard
SpeechToTextButton
InlineAIPrompt
TimePicker
StockChart
RadialGauge
ContextMenu
ArcGauge
AICodingAssistant
+? more
Top users last month
Edmond
Top achievements
Rank 1
Iron
fabrizio
Top achievements
Rank 2
Iron
Veteran
RobMarz
Top achievements
Rank 2
Iron
Fakhrul
Top achievements
Rank 1
Iron
Tejas
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Edmond
Top achievements
Rank 1
Iron
fabrizio
Top achievements
Rank 2
Iron
Veteran
RobMarz
Top achievements
Rank 2
Iron
Fakhrul
Top achievements
Rank 1
Iron
Tejas
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?