Telerik Forums
UI for ASP.NET MVC Forum
2 answers
435 views

I am currently developing a mobile-first page using a listview with a template of k-card-list so it looks good on a phone(vertical).  I would like to display the same info horizontally(almost like a grid) if the user is on a smaller device.

There is a ton of real estate wasted on a large screen that I would like to take advantage of.

What is the preferred method of doing this?

I have attached a couple of screenshots.

Below is my current template:

<script type="text/x-kendo-tmpl" id="template">
    <div class="k-card-list">
        <div class="k-card" style="min-width: 300px;">
            <div class="k-card-header">
                <div><h4>Service Date: #= kendo.toString(kendo.parseDate(ServiceDate), "MM/dd/yyyy")#</h4></div>
                <div><h4>Store No: #:StoreNumber#</h4></div>
                <div><h4>Store Name: #:StoreName#</h4></div>
                <div><h4>Visit Type: #:VisitTypeName#</h4></div>
            </div>
            <div class="k-card-body">
                <div>Round Trip Miles: ${ ActualTotalMileage == null ? '' : ActualTotalMileage }</div>
                <div>Compensable Miles: ${ ActualCompensableMileage == null ? '' : ActualCompensableMileage }</div>
                <div>Hours: ${ ActualHours == null ? '' : ActualHours }</div>
                <div>Minutes: ${ ActualMinutes == null ? '' : ActualMinutes }</div>
                <div>Comments: ${ CommentText == null ? '' : CommentText }</div>
            </div>
            <div class="k-card-actions k-card-actions-stretched">
                <span class="k-card-action">
                    <span class="k-button k-flat k-primary k-edit-button">
                        # var miles = ActualTotalMileage#
                        # if (miles > 0) { #
                        Update Expense Claim
                        # } else { #
                        Create Expense Claim
                        #} #
                    </span>
                </span>
            </div>
        </div>
        <hr class="k-hr" />
    </div>
</script>

Tsvetomir
Telerik team
 answered on 17 Jan 2020
4 answers
338 views
We are using Kendo Grid in cshtml pages with option for inline editing of selective columns.

In inline edit mode, if I change a value of one column and click save without using tab or focusing on any other editable column, the change is not saved.

This issue is happening only in Firefox and Chrome browsers and not in Internet Explorer.

Please advise a solution or probable scenarios when this can happen.
Jon
Top achievements
Rank 1
 answered on 16 Jan 2020
1 answer
976 views

Hello,

I used kendo upload widget in my project MVC project. How to pass the files through ajax to MVC method without submitting the form?  I tried couple of ways but failed to get the files. Could someone help? Please see my sample code below:

 

---------In .cshtml file -----------

            <div >

                @(Html.Kendo().Upload()

                        .Name("files")

                        .Multiple(false)

                        .HtmlAttributes(new { aria_label = "files" })

                        .Validation(validation => validation.AllowedExtensions(new string[] {".xlsx" }))

                )

 

            @(Html.Kendo().Button()

            .Name("UploadFile")

            .Content("Process Files")

            .Events(event => event.Click("onUploadFile "))

            )

             </div>

 

------In . js file:-------

 

Function onUploadFile(){

        var upload = $("#files").data("kendoUpload"),

          files = upload.getFiles();

 

      $.post("TestMethod" ,

      { files: files },  <-----------------------------------I try to pass parameter here.

     function (data, status) {...}

      );

}

 

------In server side:-------

  public JsonResult TestMethod (IEnumerable<HttpPostedFileBase> files)

        {  ....

            return Json(null, JsonRequestBehavior.AllowGet);

        }

Petar
Telerik team
 answered on 16 Jan 2020
5 answers
595 views

HI

I have a question about DateTimePicker.

When the inputed time is 11:15, then dropdown the time list, 
Why the DateTimePicker do not scroll to the nearest time automatically ?

Maybe there have the same problem of TimePicker too.

See attachment.

Best regards

Chris

 

 

 

Alex Hajigeorgieva
Telerik team
 answered on 15 Jan 2020
1 answer
474 views

Need to filter cards in a blade(div) based on the value inside the card. Needed this for ASP.NET MVC.

For example, if we have many cards, base on the value inside the cards, need to filter or sort. Please let know whether is it possible and is there any demo available for that?

Dimitar
Telerik team
 answered on 15 Jan 2020
3 answers
587 views

I have a grid with several foreign key columns which display combo-box editor templates. The user enters and selects an item, which sets the id on that column for that record in the grid.

If the user unfocuses the cell without selecting an option, the built-in validation message (shown in the attached screenshot) 'X must be a number' appears. This occurs when the input does not load any data (i.e. they type a name that doesn't exist in the database and so auto-complete doesn't find anything). It seems the validation skips the 'required' message and goes to this invalid-type message. We would like to change or bypass this so that the user doesn't see this user-unfriendly message.

Is there a way to (1) somehow force the combo-box to select an option when losing focus in this case where there was no valid auto-complete option (since normally it does auto-select said option), or (2) to somehow override this error message?

Alex Hajigeorgieva
Telerik team
 answered on 13 Jan 2020
1 answer
166 views

When you hover over the legend it displays all the points for the series you are hovering over.  See attached image.  Is there a way to turn this off?

 

<div>
    <div id="chart">
 
        @(Html.Kendo().Chart<CashInvestedAreaChart>()
                .Name("chartCashInvested")
                .DataSource(ds => ds.Read(read => read.Action("CashInvestedChartData", "PracticeAnalytics")))
                .Transitions(false)
                .Theme("bootstrap")
                .Legend(l => l.Visible(true)
                        .Position(ChartLegendPosition.Bottom))
                .ChartArea(c => c.Margin(10, 8, 0, 10).Background("transparent").Height(280))
                .SeriesDefaults(s => s
                    .Area()
                    .Line(l => l.Style(ChartAreaStyle.Smooth))
                    .Stack(false))
                .CategoryAxis(axis => axis
                    .Categories(m => m.Date)
                    .Line(l => l.Visible(false))
                    .Labels(l => l.Visible(false))
                    .MajorGridLines(l => l.Visible(false))  
                    )
                .Tooltip(t => t.Visible(true).Template("#= series.name # <br /> #= kendo.toString(kendo.parseDate(category), 'MM/dd/yyyy') #: #= kendo.format('{0:C}', value) #"))
                .Series(series =>
                {
                    series.Area(model => model.MarketValue).Name("Market Value").Color("#60A7F5").Opacity(1);
                    series.Area(model => model.CashInvested).Name("Cash Invested").Color("#35608F").Opacity(1);
                })
                .ValueAxis(axis => axis
                    .Numeric()
                    .Labels(labels => labels.Template("#= ciFormatMillions(value) #" ) )
                    .AxisCrossingValue(-10)
                    .Line(line => line.Visible(false))
                )
                .Events(e => e.Render("scaleChart"))
        )
    </div>
Nikolay
Telerik team
 answered on 13 Jan 2020
21 answers
4.6K+ views
In our application we want the filter on a date column to prompt the user for a start date and an end date, with the filter returning rows where the field in question falls between (or on) those two dates.

Initial Approach

Our initial approach was to restrict date types to use gte and lte operators, and add the "extra : true" filterable option on the column. This came close, but presented the following problems: A) Each date input could use either the gte (Start) or lte (End) operator, providing undesired flexibility and the option for the user to create a filter that would never return results, and B) Presented a logical comparison (And / Or) that we don't want.

Better Approach

A better approach was found on this StackOverflow question. This question has an answer by Matthew Erwin that gets us very close: it allows us to completely re-style the filter entirely, so we can present simply a Start Date input and an End date input. However, what I can't get working is associating the right filter operation with the right input (gte for the Start date, lte for the End date). My custom filter is as follows:

$scope.dateFilter = {
    extra: true,
    operators: {},
    ui: function (element) {
        var parent = element.parent();
        while (parent.children().length > 1)
            $(parent.children()[0]).remove();
 
        parent.prepend(
            "Start Date:<br/><span class=\"k-widget k-datepicker k-header\">" +
            "<span class=\"k-picker-wrap k-state-default\">" +
            "<input data-bind=\"value: filters[0].value\" class=\"k-input\" type=\"text\" data-role=\"datepicker\"" +
            " style=\"width: 100%\" role=\"textbox\" aria-haspopup=\"true\" aria-expanded=\"false\" aria-disabled=\"false\" " +
            " aria-readonly=\"false\" aria-label=\"Choose a date\">" +
            "<span unselectable=\"on\" class=\"k-select\" role=\"button\">" +
            "<span unselectable=\"on\" class=\"k-icon k-i-calendar\">select</span></span></span></span>" +
 
            "<br/>End Date:<br/>" +
            "<span class=\"k-widget k-datepicker k-header\"><span class=\"k-picker-wrap k-state-default\">" +
            "<input data-bind=\"value: filters[1].value\" class=\"k-input\" type=\"text\" data-role=\"datepicker\"" +
            " style=\"width: 100%\" role=\"textbox\" aria-haspopup=\"true\" aria-expanded=\"false\" " +
            " aria-disabled=\"false\" aria-readonly=\"false\" aria-label=\"Choose a date\">" +
            "<span unselectable=\"on\" class=\"k-select\" role=\"button\">" +
            "<span unselectable=\"on\" class=\"k-icon k-i-calendar\">select</span></span></span></span>"
        );
    }
};

With this approach, the Odata filter option is generated for each of the dates, however it uses the eq Equal To operator, so no values are ever returned. We aren't building filters specifically on the data source.Is there a simple way I can associate each of those date inputs with a specific filter operator? Is there a better way to approach this subject? It seems like filtering dates based on a Start - End range would be commonly desired.

Other Details

We are using AngularJS, and WebAPI with Odata.
Alex Hajigeorgieva
Telerik team
 answered on 13 Jan 2020
1 answer
1.0K+ views

Hi,

I have an editor grid that has one editable cell. I want that cell to always be the input box (numeric text box in this case) instead of going back to a regular dirty cell after clicking out. So basically always keeping cells in edit mode.How can I achieve this? See attached image for example of what I mean.

 

Tsvetomir
Telerik team
 answered on 10 Jan 2020
4 answers
631 views
I'm using a Kendo Editor in TextArea mode, is there a way I can configure the styles (font, size, color) it applies to the content by default?
Petar
Telerik team
 answered on 10 Jan 2020
Narrow your results
Selected tags
Tags
Grid
General Discussions
Scheduler
DropDownList
Chart
Editor
TreeView
DatePicker
ComboBox
Upload
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
Dialog
MultiColumnComboBox
DropDownTree
Checkbox
Slider
Switch
Notification
Accessibility
ListView (Mobile)
Pager
Security
ColorPicker
DateRangePicker
Wizard
Styling
Chat
DateInput
MediaPlayer
TileLayout
Drawer
SplitView
Template
Barcode
ButtonGroup (Mobile)
Drawer (Mobile)
ImageEditor
RadioGroup
Sparkline
Stepper
TabStrip (Mobile)
GridLayout
Badge
LinearGauge
ModalView
ResponsivePanel
TextArea
Breadcrumb
ExpansionPanel
Licensing
Rating
ScrollView
ButtonGroup
DropDownButton
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
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
SmartPasteButton
PromptBox
SegmentedControl
LLM Kit
+? more
Top users last month
Tien
Top achievements
Rank 1
Iron
Krasimir
Top achievements
Rank 3
Bronze
Iron
Iron
Cedar
Top achievements
Rank 1
Iron
Emil
Top achievements
Rank 1
Iron
Kyle Watson
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Tien
Top achievements
Rank 1
Iron
Krasimir
Top achievements
Rank 3
Bronze
Iron
Iron
Cedar
Top achievements
Rank 1
Iron
Emil
Top achievements
Rank 1
Iron
Kyle Watson
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?