Telerik Forums
Kendo UI for jQuery Forum
4 answers
1.0K+ views
I am admittedly new to MVC and this may be something very simple that I am missing, but I am at a complete loss as to what else to do other than post here.  I have a model with a basic property called height:

public class BasicInformation
{
        [Display(Description = "Patient's height", Name = "Height (Inches):")]
        [Required(AllowEmptyStrings = false, ErrorMessage = "Height requires a value to be entered.")]
        [Range(12, 96)]
        public double Height { get; set; }
}


I am creating a new basic information and passing to the view when I call the view:
BasicInformation bi = new BasicInformation();
  
return View("Step2", bi);


Now in my view I am binding to this model using:

@(Html.Kendo().NumericTextBoxFor<double>(model => model.Height)
.Name("txtHeight")
.Decimals(0)
.Format("##")
)

My problem is that when I pass the model object to my next method, the value for height has not been updated.  The min & max seems to be working based on the range attribute from the model so it seems as though that part is connected properly.  Also if I use the basic html controls (see below) then it works fine.

@Html.EditorFor(model => model.Height)

Please explain what I am doing wrong or have not set on the Telerik control to have it save the value on the model.

Thanks in advance,
Lee 
Tsvetomir
Telerik team
 answered on 03 Mar 2020
11 answers
1.1K+ views
Hi - I'm just trying to include a dropdownlist as a column in my grid.  However, each field for ddl contactId is initially displayed as 'undefined' in the grid - as soon as I click on a contactId cell the correct contact is displayed, and as soon as I leave the cell the data reverts back to 'undefined' - I've looked at all the examples and in the forums - not sure what the problem is...any suggestions greatly appreciated 

Thanks a lot


    initGrid: function (eventId) {

        $("#gridInvitations").kendoGrid({
            autoBind: true,
            editable: true,
            columns:
                        [{ field: 'invitationId', title: 'invitationId', width: "100px", hidden: false },
                         { field: 'eventId', title: 'eventId', hidden: false },
                         {
                             field: "contactId",
                             title: "Contact",
                             width: "225px",
                             editor: INV.contactDropDownEditor,
                             template: "#=contactId.FullName#"
                         },
                         { field: 'inviteSentDate', title: 'Invitation Sent', format: "{0: yyyy-MM-dd HH:mm:ss}" },
                         { field: 'rsvpStatus', title: 'RSVP', hidden: false },
                         { field: 'rsvpDate', title: 'RSVP Date', format: "{0: yyyy-MM-dd HH:mm:ss}" },
                         { field: 'rsvpComments', title: 'RSVP Comments' }
                        ],

            dataSource: INV.createGridDataSource()
            
        });

    },

   
    createGridDataSource: function (eventId) {

        var dataSource = new kendo.data.DataSource({
            
            transport: {
                read: {
                    url: "/invitations/invitations.svc/tblInvitations",
                    dataType: "json"
                }
            },
            
            
            schema: {
                data: "d"
            }
          
            
        });

        return dataSource;

    },


     contactDropDownEditor: function (container, options) {
            
            $('<input name="contactId" required data-text-field="FullName" data-value-field="contactId" data-bind="value:' + options.field + '"/>')
                .appendTo(container)
                .kendoDropDownList({
                    autoBind: false,
                    dataSource: {                        
                        transport: {
                            read: {
                                url: "/contact/contacts.svc/contacts_getList",
                                dataType: "json"
                            }
                        },
                        schema: {
                            data: "d"
                        }
                    }           
                });
    }
Neil
Top achievements
Rank 1
 answered on 03 Mar 2020
1 answer
1.5K+ views

I'm kind of new to JQuery, Json, MVC and all so my problem is probably simple to fix but for some reason, I can't seems to find the answer.

I'm trying to use the Kendo DropDownList to call an MVC action that takes a parameters and sends a query to an ElasticSearch server. So far I have this code :

$('#myInput').kendoDropDownList({
    template: $("#inputTemplate").html(),
    dataValueField: 'Id',
    dataTextField: 'FullName',
    filter: 'contains',
    minLength: 3,
    dataSource: {
        serverFiltering: true,
            transport: {
                read: {
                    url: '@(Url.Action("ElasticSearch", "Participant"))',
                    dataType: 'json',
                    contentType:'application/json; charset=utf-8',
                    data:  {
                        critere: 'bob'
                    }
                }
           }

      }
});

 

This is actually working .... if I only want to search for "bob". But I can't figure out how to send the text from the seach field in the dropdownlist each time that I type something.

What am I missing here?

Ivan Danchev
Telerik team
 answered on 02 Mar 2020
4 answers
937 views
The application has a restriction for the name of the file to be maximum of 40 characters. Since this validation is done on the server is there a way to display the server upload error just like the file extension/ max file size.
Dan
Top achievements
Rank 1
Iron
Iron
Veteran
 answered on 02 Mar 2020
5 answers
989 views

I've looked at the DevExpress HTML grid, and when switching pages when AJAX-bound, the vertical scroll is put to the top.  I don't know anyone who would want to stay vertically scrolled to the bottom when switching to another grid page.

When using Kendo AJAX-bound grid and switching pages, the vertical scrollbar stays where it was on the previous page.  Is this a bug or did you just let that be something we have to do ourselves?

Nikolay
Telerik team
 answered on 02 Mar 2020
1 answer
8.7K+ views
Hello,

I couldn't see anything in the API docs.  Is there a way to programmatically sort a table after the grid has been rendered?  We'd like to show the default sort order
Aleksandar
Telerik team
 answered on 02 Mar 2020
2 answers
156 views

Hi, Dev Team!

I use Cards with "k-card-deck" class. How i can do stretched link in every "k-card" inside "k-card-deck"?

 

need something like that:

 

<div class="k-card-deck">

   <div class="k-card">

</div>

   <div class="k-card"></div>

</div>

Petar
Telerik team
 answered on 28 Feb 2020
7 answers
834 views
Do you have an example of using the Kendo Grid control for javascript that sets the options to serverAggregates = true?  I have been trying to make this work and sadly only can get the client aggregation working.  I have read numerous configuration settings and other forums that make suggestions.  An example would be more affective showing both the data source options and the grid options working together.
Angel Petrov
Telerik team
 answered on 28 Feb 2020
3 answers
1.4K+ views
There is new feature on the grid - filter row. It is very nice, but I have a problem of adjusting the width of the filter text box. For example in the following demo all columns are large enough:
http://demos.telerik.com/kendo-ui/grid/filter-row
However, if we set the OrderId column to be smaller to 100px, the filter text box is larger, and there seems to be no easy way to make it fit in smaller column.
See, it hides the filter button, and text box is longer: 


I was thinking of either doing it using the cell.template, but then I don't know how to reproduce that entire filter box behavior. Another option would be to somehow add some css to control width of that particular text-field. 
Any suggestions?


Silviya Stoyanova
Telerik team
 answered on 28 Feb 2020
5 answers
2.0K+ views
Can I add a callback function to the dataSource sync() method? I want code to wait until after the sync() is finished before proceeding because subsequent code is querying the data that is updated by the sync().

I don't want to use the dataSource's change event because I need to stay in scope where I manually call the sync() method.
Vivek
Top achievements
Rank 1
 answered on 28 Feb 2020
Narrow your results
Selected tags
Tags
Grid
General Discussions
Charts
Data Source
Scheduler
DropDownList
TreeView
MVVM
Editor
Window
DatePicker
Spreadsheet
Upload
ListView (Mobile)
ComboBox
TabStrip
MultiSelect
AutoComplete
ListView
Menu
Templates
Gantt
Validation
TreeList
Diagram
NumericTextBox
Splitter
PanelBar
Application
Map
Drag and Drop
ToolTip
Calendar
PivotGrid
ScrollView (Mobile)
Toolbar
TabStrip (Mobile)
Slider
Button (Mobile)
Filter
SPA
Drawing API
Drawer (Mobile)
Globalization
LinearGauge
Sortable
ModalView
Hierarchical Data Source
Button
FileManager
MaskedTextBox
View
Form
NavBar
Notification
Switch (Mobile)
SplitView
ListBox
DropDownTree
PDFViewer
Sparkline
ActionSheet
TileLayout
PopOver (Mobile)
TreeMap
ButtonGroup
ColorPicker
Pager
Styling
MultiColumnComboBox
Chat
DateRangePicker
Dialog
Checkbox
Timeline
Drawer
DateInput
ProgressBar
MediaPlayer
ImageEditor
TextBox
OrgChart
Effects
Accessibility
PivotGridV2
ScrollView
BulletChart
Licensing
QRCode
ResponsivePanel
Switch
Wizard
CheckBoxGroup
TextArea
Barcode
Breadcrumb
Collapsible
Localization
MultiViewCalendar
Touch
RadioButton
Stepper
Card
ExpansionPanel
Rating
RadioGroup
Badge
Captcha
Heatmap
AppBar
Loader
Security
TaskBoard
Popover
DockManager
FloatingActionButton
CircularGauge
ColorGradient
ColorPalette
DropDownButton
TimeDurationPicker
ToggleButton
TimePicker
BottomNavigation
Ripple
SkeletonContainer
Avatar
Circular ProgressBar
FlatColorPicker
SplitButton
Signature
Chip
ChipList
VS Code Extension
AIPrompt
PropertyGrid
Sankey
Chart Wizard
OTP Input
SpeechToTextButton
InlineAIPrompt
StockChart
ContextMenu
DateTimePicker
RadialGauge
ArcGauge
AICodingAssistant
+? more
Top users last month
Rob
Top achievements
Rank 3
Bronze
Iron
Iron
Sergii
Top achievements
Rank 1
Iron
Iron
Dedalus
Top achievements
Rank 1
Iron
Iron
Lan
Top achievements
Rank 1
Iron
Doug
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Top users last month
Rob
Top achievements
Rank 3
Bronze
Iron
Iron
Sergii
Top achievements
Rank 1
Iron
Iron
Dedalus
Top achievements
Rank 1
Iron
Iron
Lan
Top achievements
Rank 1
Iron
Doug
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?