Telerik Forums
Kendo UI for jQuery Forum
2 answers
642 views
We are creating a grid based on the following Demo
The model for the demo has the unit price set up as follows:
[Required]
        [DisplayName("Unit price")]
        [DataType(DataType.Currency)]
        [Range(0, int.MaxValue)]
        public decimal UnitPrice
        {
            get;
            set;
        }

We are attempting to do the same thing in our application, but when we do so, we receive the following error:

The model item passed into the dictionary is of type 'System.Decimal', but this dictionary requires a model item of type 'System.String'

Am I missing something?
I don't see the model for the demo converting the unit price into a string, but the demo doesn't throw an error.
Atlas
Top achievements
Rank 1
 answered on 26 Mar 2013
4 answers
477 views
Hey,

i get a problem with my cascading comboboxes. I can't get the value from the first combobox to put it in the data for the second datasource. So the datasource from combobox2 depends on the value from combobox1. I dont have a clue how to get the value out of combobox1.

I tried several things, but nothing worked for me.

The situation is mentioned below:

$("#categories").kendoComboBox({
                        placeholder: "Select category...",
                        dataTextField: "Category",
                        dataValueField: "Category",                    
                        dataSource: {
                            type: "json",
                            transport: {
                                    read: {
                                        url:"http://xxx/api/item/PostAllCategories",
                                        type:"POST",
                                    }
                            }
                        }      
                    }).data("kendoComboBox");
                     
                    var products = $("#products").kendoComboBox({
                        autoBind: false,
                        cascadeFrom: "categories",
                        placeholder: "Select product...",
                        dataTextField: "Product",
                        dataValueField: "Product",
                        dataSource: {
                            type: "json",
                            transport: {
                                    read: {
                                        url:"http://xxx/api/item/PostAllProducts",
                                        type:"POST",
                                        data:{
/*Here is the Problem, i need the value from categories here in the data field
  If i do it this way my cascading fails and the values aren't displayed in the combobox, so something is wrong here. value = valuefromcategories*/
                                            value: function() {
                                                        return $("#categories").data("kendoComboBox").value();
                                                    }  
                                        }
                                    }
                                }
                        }
                    })

Does anyone has an idea?
John
Top achievements
Rank 1
 answered on 26 Mar 2013
3 answers
117 views
    Do you have the sample file to demo how to insert, update and delete data for WCF RIA JSON endpoint ?
Alexander Valchev
Telerik team
 answered on 26 Mar 2013
1 answer
154 views
Hello all,

Having a strange issue and I can post some sample code if needed.   I have setup the KendoUI grid with .Create, .Update, .Destroy.   Each individually works fine and gets into the method calls and performs the task.  However, once the page loads if I do a create, the insert happens fine, the grid shows my new record at the top of the grid.  This only happens if the chain of events I take is Add New Record calls the create, then if I click the delete button postback does not occur into the delete method.   If I click Edit the Create method gets called again.    If I complete an edit then delete it works fine both methods are called.  The create has the following for example:

[AcceptVerbs(HttpVerbs.Post)]
public ActionResult Role_Create([DataSourceRequest] DataSourceRequest request, RoleModel role)
{
if (role != null && ModelState.IsValid)
{
DataProvider.Use(s => s.InsertRoles(role.RoleCode, role.RoleDescription));
}

return Json(new[] { role }.ToDataSourceResult(request, ModelState));
}

Now once that occurs the Ajax adds that record it seems.   Then if I click the Delete button on a row, the alert comes up do you want to delete I hit okay.  The row deletes in the grid visually but the call never gets called as I have a break point in my code and the DB is not showing it deleted.   If I click create and create a new record then I click edit, the create method gets called instead of the update so it calls the previous ajax call it seems.   Again this only happens after the first click of the Add New Item that calls the create method.   If I do a create then I manually refresh the page it then works as expected.   It seems also that on the subsequent requests it gets into the previous calls sometimes as well.   Any idea why this would be happening?   Attaching my sample CSHTML and some of the classes to see what I am doing.
Sean Bornstein
Top achievements
Rank 1
 answered on 26 Mar 2013
1 answer
332 views
Hi,

The Kendo DateTimePicker that we are using behaving strangely. On first time load the control behaves as it should and opens the calendar and time selector on their respective select clicks. However, once the user control is reopened, the datetimepicker starts behaving strangely.

The KendoDateTime Picker is bound to one input textbox. On the runtime, the html (working case) looks like this.

<SPAN class="k-picker-wrap k-state-default" jQuery171010970156005264647="31"><br><INPUT style="WIDTH: 100%" id=datetextbox class=k-input value="08/29/2012 04:47 PM" size=22 data-role="datetimepicker" jQuery171010970156005264647="27"><br><SPAN class=k-select unselectable="on"><br><SPAN class="k-icon k-i-calendar" unselectable="on" jQuery171010970156005264647="32">select</SPAN><br><SPAN class="k-icon k-i-clock" unselectable="on" jQuery171010970156005264647="33">select</SPAN></SPAN></SPAN>

However, when I close the user control and reopen it..The calendar starts behaving in an unwanted manner and the time selector when clicked opens the calendar instead. Below is the run time html.

<br><span class="k-picker-wrap k-state-default" jQuery171010970156005264647="62"><br><INPUT style="WIDTH: 100%" id=datetextbox  class=k-input value="08/29/2012 04:52 PM" size=22 data-role="datetimepicker" jQuery171010970156005264647="27"><SPAN class=k-select unselectable="on" jQuery171010970156005264647="63"><SPAN class="k-icon k-i-calendar" unselectable="on" jQuery171010970156005264647="32">select</SPAN><SPAN class="k-icon k-i-clock" unselectable="on" jQuery171010970156005264647="33">select</SPAN></SPAN>

The strange thing here is some jquery functions are being injected and might cause this issue. Has anyone witnessed this behavior and any possible solution for that.

P.S:- The noticeable change is 

Not Working : - 
<SPAN class=k-select unselectable="on" jQuery171010970156005264647="63"> 
Vs Working : - 
<SPAN class=k-select unselectable="on"> 

Yann Struillou
Top achievements
Rank 1
 answered on 26 Mar 2013
2 answers
164 views
I have the following grid set up on my view

@(Html.Kendo().Grid(Model)    
    .Name("Grid")
    .Columns(columns =>
    {
        columns.Bound(p => p.FirstName).Groupable(false);
        columns.Bound(p => p.City);
        columns.Bound(p => p.EprescribePatientMRN);
        columns.Bound(p => p.DateOfBirth);
    })
      .ToolBar(toolbar =>
    {
        toolbar.Template(@<text>
           <div class="toolbar">
                    <label class="category-label" for="category">Show products by category:</label>
                        @(Html.Kendo().DropDownList()
                            .Name("categories")
                            .OptionLabel("All")
                            .DataTextField("CategoryName")
                            .DataValueField("CategoryID")
                            .AutoBind(false)
                            .Events(e => e.Change("categoriesChange"))
                            .DataSource(ds =>
                            {
                                ds.Read("ToolbarTemplate_Categories", "Grid");
                            })
                        ) 
                        </div>
        </text>);
    })
    .ClientDetailTemplateId("tmplPatientDrugs")
    .Groupable()
    .Pageable()
    .Sortable()
    .Scrollable()
    .Filterable()
    .DataSource(dataSource => dataSource
        .Ajax()
        .Read(read => read.Action("Patients", ""))
        .PageSize(30)
    )
      )


and when I hit the page number, I end up getting paging information in the page url, is there a way to work around this. As I would really like a clean url, rather than filling it with querystring params and so on.

Vladimir Iliev
Telerik team
 answered on 26 Mar 2013
3 answers
1.0K+ views
Hi support,

I'm using the Kendo Framework Validator together with Siteifnity.
I'm getting this error when running my page:

Timestamp: 21-3-2013 14:18:05
Error: TypeError: $(...).kendoValidator is not a function
Line: 909
This is the code I use in my page:
$(document).ready(function () {
 
       $('#addReview').hide();
 
       var validator = $("#addReview").kendoValidator().data("kendoValidator");
       //status = $(".status");
 
       $("<%=submit.ClientID %>").click(function () {
           if (validator.validate()) {
               status.text("Hooray! Your tickets has been booked!")
                   .removeClass("invalid")
                   .addClass("valid");
           } else {
               status.text("Oops! There is invalid data in the form.")
                   .removeClass("valid")
                   .addClass("invalid");
           }
       });
 
   });
Any thoughts?

Kind regards,
Daniel
Alexander Valchev
Telerik team
 answered on 26 Mar 2013
7 answers
2.3K+ views
Hello Kendo team:
If you have a kendoWindow inside an iframe, it doesn´t center the window vertically as far as appending the window to document.body exceeds 100% of the height of the viewport.
I've checked this issue in version 2012.3.1406 with IE10.
I'm attaching an example to reproduce this. You can paste these two HTML files to your window's examples and open api1.html from IE10.

toFront() function in line 41200 of kendo.web.js makes a winElement.focus() that changes the $(window).scrollTop()
kendoWindow uses $(window).scrollTop() to determine the center of the viewport.

This worked fine with version 2012.2.710.

Hope it helps you to find a faster solution.

Kind regards.
Dimo
Telerik team
 answered on 26 Mar 2013
8 answers
216 views
Hi,
I am using Kendo UI Web for upload files.
Here is an issue when uploading large on IE9, the file is 49.6M. It is always in uploading file and no error message is shown. The upload is in a iframe.
On firefox, the file is uploaded successfully.

Is there any adive on this issue?

Thanks,
Peter
Vladimir Iliev
Telerik team
 answered on 26 Mar 2013
1 answer
136 views
I'm new to Kendo UI and Kendo Data Viz so bear with me :D

I have a datasource in my javascript file:

    var _detailDataSource = new kendo.data.DataSource({
        transport: {
            read: {
                type: "POST",
                url: "/Admin/GetDetailUsage",
                dataType: "json",
                data: {
                    beginDate: function () {
                        return $('#beginDate').val();
                    },
                    endDate: function () {
                        return $('#endDate').val();
                    }
                }
            }
        },
        schema: {
            model: {
                fields: {
                    RequestId: { type: "number" },
                    RequestDate: { type: "date" },
                    Interface: { type: "string" },
                    ProviderName: { type: "string" },
                    EmployeeId: { type: "string" },
                    EmployeeName: { type: "string" },
                    EmployeeType: { type: "string" },
                    Department: { type: "string" }
                }
            }
        },
        pageSize: 20
    });

I am currently using that datasource for a grid but I also wanted to use it for an area chart on the same page (different tab in the tab control)

So I have setup the chart like this:

function dashboardChart() {
    $("#chart").kendoChart({
        dataSource: _detailDataSource,
        title: {
            text: "Units sold"
        },
        series: [{
            type: "area",
            field: "RequestId",
            aggregate: "count"
        }],
        categoryAxis: {
            baseUnit: "weeks",
            field: "RequestDate"
        }
    });
}

and then I call the chart like so: dashboardChart();

So, can someone tell me what I'm doing wrong? I want to aggregate the data from the datasource by week and display the number of Requests in an area chart.

Thanks,

Chad.

Iliana Dyankova
Telerik team
 answered on 26 Mar 2013
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
Drag and Drop
Application
Map
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
DropDownTree
ListBox
PDFViewer
Sparkline
ActionSheet
TileLayout
PopOver (Mobile)
TreeMap
ButtonGroup
Styling
ColorPicker
Pager
Chat
MultiColumnComboBox
Dialog
DateRangePicker
Checkbox
Timeline
Drawer
DateInput
ProgressBar
MediaPlayer
ImageEditor
TextBox
OrgChart
Accessibility
Effects
Licensing
PivotGridV2
ScrollView
Switch
TextArea
BulletChart
QRCode
ResponsivePanel
Wizard
CheckBoxGroup
Localization
Barcode
Breadcrumb
Collapsible
MultiViewCalendar
Touch
RadioButton
Stepper
Card
ExpansionPanel
Rating
RadioGroup
Badge
Captcha
Heatmap
AppBar
Loader
Security
TaskBoard
Popover
DockManager
TimePicker
FloatingActionButton
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
DateTimePicker
RadialGauge
ArcGauge
AICodingAssistant
SmartPasteButton
PromptBox
SegmentedControl
LLM Kit
+? more
Top users last month
Shiori
Top achievements
Rank 2
Iron
Tien
Top achievements
Rank 1
Iron
Robert
Top achievements
Rank 1
Rob
Top achievements
Rank 4
Bronze
Bronze
Iron
Geoff
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Top users last month
Shiori
Top achievements
Rank 2
Iron
Tien
Top achievements
Rank 1
Iron
Robert
Top achievements
Rank 1
Rob
Top achievements
Rank 4
Bronze
Bronze
Iron
Geoff
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?