Telerik Forums
Kendo UI for jQuery Forum
1 answer
252 views
I am using Razor and have screens where I can upload multiple files.  These will not be async, but for every file that is selected I need to put that file in a category.

I thought I could use the template to put the dropdown in after the file was selected.  Then they would select the dropdown next to each file and set them correctly.  Then they would click save, but how can I post that data back and tie it to each file if I have multiple files.  Thank you.
Petur Subev
Telerik team
 answered on 02 Jan 2014
1 answer
112 views
The validation is working good, but does not display the error message in the grid cell.
I have tried couple of options, even though it enters into the logic and fails the validation, no message is displayed.

  $.extend(true, kendo.ui.validator, {
                rules: {
                    // custom rules
                    OrgSchoolID: function (input) {
                                //console.log("Custom Validator fired");
                                // all of the input must have a value
                                //return $.trim(input.val()) !== "";
                                if (input.is("[name=OrgID_FK]") && input.val() === "")
                                    return false;
                                else
                                    return true;

                            },
                },
                messages: { //custom rules messages
                    OrgSchoolID: function (input) {
                        // return the message text
                        return "OrgName is required!";
                    }
                }
            });
===============================================================================================================================

I tried this options as well, even though it steps into correctly during debug and returns fail, the Error message is not displayed

 OrgID_FK: {
                        editable: true,
                        type: "number",
                        validation: {
                                IsOrgIDValid: function (input) {
                                            console.log("Validation fired for ORgID Column");
                                            if (input.is("[name=OrgID_FK]") && input.val() === "") {
                                                console.log("Validation failed for OrgID_FK");
                                                input.attr("data-IsOrgIDValid-msg", "OrgName is required!");
                                                return false;
                                            }
                                            return true;
                                        }
                                  
                            } // validation
                    }, // OrgID_FK
Nikolay Rusev
Telerik team
 answered on 02 Jan 2014
1 answer
98 views
Hi,

I have a problem with databinding on Android.

This works on iOS but doesn't work on Android.

I don't know what's happening, so i need help.

Some specific configuration is required for android?

Thanks for all
Kiril Nikolov
Telerik team
 answered on 02 Jan 2014
2 answers
143 views
I'm using the dropdown template to control rendering of the list items within the dropdown - http://www.kendoui.com/documentation/ui-widgets/dropdownlist/configuration.aspx#template.  However, I'm interested in controlling the rendering of the selected item within the dropdown after selection.  Is this possible and do you have an example?

Thanks,
Jeff
Alexander Popov
Telerik team
 answered on 02 Jan 2014
1 answer
350 views
I am trying to make sure that my drawer always closes after a click.  Right now I have my drawer items set with data-link's to change to different views.  My issue is say I am on a view called "Preview" and I open the drawer and click the button for "Preview".  Since it is already on the "Preview" page the drawer stays open, which could lead some users to not be sure if it is responding (they may not realize they are already looking at the view they want to navigate too).

I've tried added onclick events to call the drawer.hide() method, which screws up all navigation.  If I am on a "Preview" view and want to go to "Contacts" view, the hide method on click screws the views up and cannot open the drawer again unless I refresh the page.

Is there any way to ensure hide is always called when the drawer is clicked? (even if the view doesn't change).

Thanks
Kiril Nikolov
Telerik team
 answered on 02 Jan 2014
1 answer
6.4K+ views
Hello


I am trying to find a way to set the Grid data-uid to the primary key in my datasource so that i can find the row programmatically.

I do not require users to select rows in the grid, it needs to be done via script.

I have looked though the grid datasource documentation and there seems to be no way to set it.


Thanks
Alexander Popov
Telerik team
 answered on 02 Jan 2014
4 answers
157 views
I am getting Modelvalidation , ErrorMessage = "The value 'Wed Dec 25 2013 00:00:00 GMT-0600 (Central Standard Time)' is not valid for EffectiveDate."
1) How to handle dates, so that i can avoid such errors. Even though i like how you are able to send timezone along with Date,
    what changes will i have to make to the models datatype to make it work.
 
The response from the WebAPI is 
{"$id":"1","Message":"Therequestisinvalid.","ModelState":{"$id":"2","orgschool.EffectiveDate":["Thevalue'WedDec25201300:00:00GMT-0600(CentralStandardTime)'isnotvalidforEffectiveDate."],"orgschool.TerminationDate":["Thevalue'MonDec30201300:00:00GMT-0600(CentralStandardTime)'isnotvalidforTerminationDate."]}}

2) Also i would like to know how can i display the errors in their respective fields, in the grid

======================================================================================================================
WebApiConfig has the following settings
           config.EnableQuerySupport();
           var json = config.Formatters.JsonFormatter;
            json.SerializerSettings.PreserveReferencesHandling = Newtonsoft.Json.PreserveReferencesHandling.Objects;
            json.SerializerSettings.ReferenceLoopHandling = Newtonsoft.Json.ReferenceLoopHandling.Ignore;
            config.Formatters.Remove(config.Formatters.XmlFormatter);
            // Web API routes
            config.MapHttpAttributeRoutes();
            config.EnableCors(new EnableCorsAttribute("*", "*", "*"));
======================================================================================================================
The header post is as follow

Request URL:http://localhost:3103/api/OrgSchool/PostOrgSchool
Request Method:POST
Status Code:400 Bad Request
Request Headersview source
Accept:application/json, text/javascript, */*; q=0.01
Accept-Encoding:gzip,deflate,sdch
Accept-Language:en-US,en;q=0.8
Connection:keep-alive
Content-Length:2927
Content-Type:application/x-www-form-urlencoded; charset=UTF-8
Host:localhost:3103
Origin:http://localhost:1205
Referer:http://localhost:1205/KendoOrgSchools.html
User-Agent:Mozilla/5.0 (Windows NT 6.3; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/31.0.1650.63 Safari/537.36
Form Dataview sourceview URL encoded
$id:2
OrgSchoolsID_PK:3
OrgID_FK:15
SchoolCode:PBS-KHN
SchoolName:modified
Description:hkjlhkj
MailAttentionOfName:hjkh
Address1:hjhjk
Address2:jhjk
CountryID_FK:3
StateID_FK:1
CityID_FK:1
PinZipCode:3dgg
EffectiveDate:Wed Dec 25 2013 00:00:00 GMT-0600 (Central Standard Time)
TerminationDate:Mon Dec 30 2013 00:00:00 GMT-0600 (Central Standard Time)
CreatedByUserID_FK:1
DateCreated:0001-01-01T00:00:00
UpdatedByUserID_FK:1
DateUpdated:0001-01-01T00:00:00
RowStatusID_FK:1
City[$id]:3
City[CityID_PK]:1
City[StateID_FK]:1
City[Code]:KH
City[Name]:KhN
City[Description]:
City[EffectiveDate]:
City[TerminationDate]:
City[CreatedByUserID_FK]:1
City[DateCreated]:2013-12-07T00:00:00
City[UpdatedByUserID_FK]:1
City[DateUpdated]:2013-12-07T00:00:00
City[RowStatusID_FK]:1
City[User]:
City[RowStatu]:
City[State][$id]:4
City[State][StateID_PK]:1
City[State][CountryID_FK]:3
City[State][Code]:PB
City[State][Name]:PNJB
City[State][Description]:
City[State][EffectiveDate]:
City[State][TerminationDate]:
City[State][CreatedByUserID_FK]:1
City[State][DateCreated]:2013-12-07T00:00:00
City[State][UpdatedByUserID_FK]:1
City[State][RowStatusID_FK]:1
City[State][Cities][0][$ref]:3
City[State][Country][$id]:5
City[State][Country][CountryID_PK]:3
City[State][Country][Code]:IN
City[State][Country][Name]:India
City[State][Country][Desription]:India
City[State][Country][EffectiveDate]:
City[State][Country][TerminationDate]:
City[State][Country][CreatedByUserID_FK]:1
City[State][Country][DateCreated]:2013-12-07T00:00:00
City[State][Country][UpdatedByUserID_FK]:1
City[State][Country][RowsStatusID_FK]:1
City[State][Country][User]:
City[State][Country][RowStatu]:
City[State][Country][User1]:
City[State][Country][OrgSchools][0][$ref]:2
City[State][Country][States][0][$ref]:4
City[State][OrgSchools][0][$ref]:2
City[State][RowStatu]:
City[State][User]:
City[State][User1]:
City[User1]:
City[OrgSchools][0][$ref]:2
Country[$ref]:5
Org[$id]:6
Org[OrgID_PK]:15
Org[OrgCode]:PBS updated
Org[OrgName]:PNJB Education Board
Org[OrgDescription]:
Org[EffectiveDate]:
Org[TerminationDate]:
Org[CreatedByUserID_FK]:1
Org[DateCreated]:0001-01-01T00:00:00
Org[UpdatedByUserID_FK]:1
Org[DateUpdated]:0001-01-01T00:00:00
Org[RowStatusID_FK]:1
Org[User]:
Org[RowStatu]:
Org[User1]:
Org[OrgSchools][0][$ref]:2
User:
RowStatu:
State[$ref]:4
User1:
Date:Invalid Date
Response Headersview source
Access-Control-Allow-Origin:*
Cache-Control:no-cache
Content-Length:340
Content-Type:application/json; charset=utf-8
Date:Fri, 27 Dec 2013 16:44:24 GMT
Expires:-1
Pragma:no-cache
Server:Microsoft-IIS/8.0
X-AspNet-Version:4.0.30319
X-Powered-By:ASP.NET
X-SourceFiles:=?UTF-8?B?QzpcVXNlcnNcbnNzaWRfMDAwXERvY3VtZW50c1xWaXN1YWwgU3R1ZGlvIDIwMTNcUHJvamVjdHNcU2Nob29sTWFuYWdlbWVudFxTY2hvb2xNYW5hZ2VtZW50LkhUTUw1XGFwaVxPcmdTY2hvb2xcUG9zdE9yZ1NjaG9vbA==?=


N
Top achievements
Rank 1
 answered on 01 Jan 2014
1 answer
247 views
I am using VS2013 + ASP.NET MVC4 + Razor + Kendo Grid 2013.1.219

I am using sample from link
(Custom popup to foreign key)

After lot of work and fixes, its finally working except datetime column is not working. Its passing null dates in create. I have tried setting up below:
[DataType(DataType.DateTime)]
or custom template.
columns.Bound(p => p.Begin_dm).Title("Begin Date").Width(250).Format("{0:MM-dd-yyyy H:mm:ss}").EditorTemplateName("DateTime");
columns.Bound(p => p.End_dm).Title("End Date").Width(250).Format("{0:MM-dd-yyyy H:mm:ss}").EditorTemplateName("DateTime");

Here is my modal:
public class ProviderMaintenanceSMS    
    {
        [ScaffoldColumn(false)]
        public int? PMID { get; set; }
        //[ScaffoldColumn(false)]
        [Required]
        [UIHint("GridForeignKey")]
        public int ProviderID { get; set; }
        [Required]
        //[DataType(DataType.DateTime)]
        public DateTime? Begin_dm { get; set; }
        [Required]
        //[DataType(DataType.DateTime)]
        public DateTime? End_dm { get; set; }
        //[ScaffoldColumn(false)]
        //public DateTime Create_dm { get; set; }
    }

View:
@using SystemDashboard;
@using Kendo.Mvc.UI;

@*model IEnumerable<SystemDashboard.ProviderMaintenanceSMS>*@


@(Html.Kendo().Grid<SystemDashboard.ProviderMaintenanceSMS>()
    .Name("grid1")
    .Columns(columns =>
    {
        columns.Bound(p => p.PMID).Hidden();
        columns.ForeignKey(p => p.ProviderID, (List<ProviderLookup>)ViewData["providers"], "ProviderID", "ProviderName").Title("Provider").Width(150);
        columns.Bound(p => p.Begin_dm).Title("Begin Date").Width(250).Format("{0:MM-dd-yyyy H:mm:ss}").EditorTemplateName("DateTime");
        columns.Bound(p => p.End_dm).Title("End Date").Width(250).Format("{0:MM-dd-yyyy H:mm:ss}").EditorTemplateName("DateTime");
        columns.Command(command => { command.Edit(); command.Destroy(); });
    })
    .ToolBar(toolbar => toolbar.Create())
    .Editable(editable => editable.Mode(Kendo.Mvc.UI.GridEditMode.PopUp))
    .DataSource(dataSource => dataSource
        .Ajax()
         .ServerOperation(false)
        .Events(events => events.Error("error_handler"))
            .Model(model =>
            {
                model.Id(p => p.PMID);
                model.Field(p => p.PMID).Editable(false);
                model.Field(p => p.ProviderID).DefaultValue(1);
            })
        .Create(update => update.Action("EditingSMS_Create", "PM"))
                .Read(read => read.Action("EditingSMS_Read", "PM"))
                .Update(update => update.Action("EditingSMS_Update", "PM"))
                .Destroy(update => update.Action("EditingSMS_Destroy", "PM"))
    )
)
Controller Create Method: (dates are always null here)
   [AcceptVerbs(HttpVerbs.Post)]
        public ActionResult EditingSMS_Create([DataSourceRequest] DataSourceRequest request, ProviderMaintenanceSMS pm)
        {
            ProviderMaintenanceBusinessLayer BL = new ProviderMaintenanceBusinessLayer();
            BL.CreateOrUpdatePMSMS(pm);                        
            return Json(new[] { pm }.ToDataSourceResult(request, ModelState));
        }

Thank you in advance. Looking forward to your reply.

Manish

Petur Subev
Telerik team
 answered on 01 Jan 2014
5 answers
123 views
I've a trivial problem with calendar. Once the value is set, the user can't set any other value on the same view. The problem disappear if the user go to the future/past and come back.

Here my implementation, it's quite simple

I've a div with id calendar, on document ready:
                <div id="calendar" style="display: none; width: 600px;"></div>

<script>

    $(document).ready(function () {
        var d = DateStringISO2date($("#string_value").val());
        if (d == '') d = new Date();
//d is a valid date, always

        $("#calendar").kendoCalendar({
            value: d,
            depth: "month"
        });

...

//next

        function calendarSetValue(e)
        {
            var d = DateStringISO2date($("#string_value").val());
           if (d == '') d = new Date();

            var calendar = $("#calendar").data("kendoCalendar");
            calendar.value(d);
            //calendar.navigateDown(calendar.value()); I've tried to navigate to va
        }
        
    }

Best regards,
Davide
Davide
Top achievements
Rank 2
 answered on 01 Jan 2014
1 answer
375 views
Hi
Is it possible to increase the width of a kendo grid's vertical scrollbar? I am not using the browser scrollbar to scroll the grid.

Thanks in advance
Mohammed
Dimo
Telerik team
 answered on 01 Jan 2014
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)
SPA
Filter
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
OrgChart
TextBox
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
Popover
DockManager
FloatingActionButton
TaskBoard
CircularGauge
ColorGradient
ColorPalette
DropDownButton
TimeDurationPicker
ToggleButton
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
TimePicker
DateTimePicker
RadialGauge
ArcGauge
+? more
Top users last month
Jay
Top achievements
Rank 3
Bronze
Iron
Iron
yw
Top achievements
Rank 2
Iron
Iron
Stefan
Top achievements
Rank 2
Iron
Iron
Iron
Kao Hung
Top achievements
Rank 1
Iron
Bohdan
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Jay
Top achievements
Rank 3
Bronze
Iron
Iron
yw
Top achievements
Rank 2
Iron
Iron
Stefan
Top achievements
Rank 2
Iron
Iron
Iron
Kao Hung
Top achievements
Rank 1
Iron
Bohdan
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?