Telerik Forums
Kendo UI for jQuery Forum
2 answers
272 views
I'm trying to do localization for the upload widget using the bindings of the mvvm approach.

<input type="text" id="upload_field" data-role='upload' data-localization='{"select": local_select}' />

with local_select being a parameter from my observable object.

var uploadModel =  new kendo.data.ObservableObject({
local_select:"Izberi..."
});

which is turn bound - var kendoView = kendo.bind($("#portal_content"), uploadModel);

The expected result is to the input itself showing the content from the object model but it throws an error (undefined) and crashes everything after it.
If I try using the #= # approach it crashes yet again with saying it's an illegal token. Finally I wrote a string  data-localization='{"select": "Izberi..."}' and it works. It also works if I use any directly accessible js variable. Since I haven't had any significant problems binding any other values to other widgets so far (ok, there have been problems but mostly typos on my side :) ).

Is there something I'm doing wrong or does kendo have problems binding these values? I did at first thought that you don't have mvvm bindings so I created an extended widget out of upload.

kendo.data.binders.widget.localization.select = kendo.data.Binder.extend({
                    init: function (widget, bindings, options) {
                        //call the base constructor
                        kendo.data.Binder.fn.init.call(this, widget.element[0], bindings, options);
                    },
                    refresh: function () {
                        var that = this,
                        value = that.bindings["localization-select"].get(); //get the value from the View-Model
                        $(that.element).data("kendoRcgUpload").localization.select(value); //update the widget
                    }
});

But that hasn't worked out either. So I'm currently at a loss what else I could do - And I need to bind the value from the model since I need my code clean as a whistle :)




T. Tsonev
Telerik team
 answered on 06 Jun 2014
4 answers
119 views
Hello!

Please forgive my newbie question!  There's so much information out there, I just don't know how to formulate my question exactly to find the right example.

I'd like to build a grid with a hierarchy, where the detail data would have the same columns as the master.  What I'd like to avoid is having a separate grid show up in place of detail.  I'd like the parent grid to add rows when detail is unfolded, or something similar to that, but still appear as one grid.  Is it possible?  Could you point me towards an example?

Thank you in advance!

Sergey
Sergey
Top achievements
Rank 1
 answered on 05 Jun 2014
2 answers
575 views
I have very basic grid using remote date from a MS CRM2013 REST endpoint. I currently try to use inline editing. So I have to click on edit to change row data. When I then change data and hit "Update" I expected that the "update" method is fired but instead "create" and I receive the error "Uncaught TypeError: Cannot read property 'call' of undefined" because I don't have "create" yet. So how can I prevent "Update" fire a "create"?
Alexander Popov
Telerik team
 answered on 05 Jun 2014
1 answer
360 views
I have a MaskedTextBox with a prefix. I want the caret to be placed on the part after the prefix. 

E.g. OH00________
                 ^
                 \ -- Caret Here

But the caret actually appears here:

E.g. OH00________
          ^
           \ -- Caret Here

How can I make the MaskedTextBox behave this way?

<li><label>State ID: <input class="k-textbox"  name="state-id" maxlength="50" type="text" data-bind="value: stateId" pattern="OH00[0-9]{8}" validationMessage="Please enter a state ID in the form of OH0012345678"/></label>  <span class="k-invalid-msg" data-for="state-id"></span></li>
$("input[name='state-id']").kendoMaskedTextBox({
              mask: "OH0099999999"
          });


Petur Subev
Telerik team
 answered on 05 Jun 2014
3 answers
357 views
Hello,

I use the recurrence rule from the ASP.NET AJAX Scheduler as shown in this jsFiddle http://jsbin.com/eqisip/23/edit

Why is the second appointment not shown?

Thanks,
Koen
Vladimir Iliev
Telerik team
 answered on 05 Jun 2014
4 answers
200 views
I am trying to bind a kendoChart to a datasource and get the following error: "Uncaught TypeError: Cannot call method 'slice' of undefined".
I used the bar chart example from the Telerik demo's and changed the json to add some metadata for the chart.

My json looks like this:

[
    {
        "chartitems": [
            {
                "high": 50,
                "index": 0,
                "low": 180,
                "medium": -34,
                "name": "Building 0"
            },
            {
                "high": 45,
                "index": 1,
                "low": 145,
                "medium": 22,
                "name": "Building 1"
            },
        "Title": "test",
        "LegendPosition": "top"
    }
]



My datasource looks like this:

var dataSource = new kendo.data.DataSource({
    transport: {
        read: {
            url: "data/chart.json",
            dataType: "json"
        }
    },
    schema: {
        data: "chartitems"
    }
});

and I'm creating the chart like this:
            var bar = $("#chart").kendoChart({
                dataSource: dataSource,
                categoryAxis: {
                    field: "name"
                },
                series: [{
                    name: "Medium",
                    field: "medium"
                },
                {
                    name: "Low",
                    field: "low"
                }]
});
...

I got this to work using the Kendo example with the "flat" json file but I'm trying to add some metadata to the json so the bar chart can be formatted with title, legend position, etc.

Hristo Germanov
Telerik team
 answered on 05 Jun 2014
1 answer
775 views
I'd like my "data" to be sending some of my MVVM model properties in the callback...

Example:
transport: {
            read: {
                url: "/RestApi/directory?format=json",
                dataType: "json",
                data: {
                    search: $model.get("searchterm")
                }
            }
        },

So I have a searchbox which is bound to $dataSource.read(); ...but regardless of the method I'm using (sync, fetch, read) that "data" never seems to be re-called.  Well...I mean I can't say that it's not working, maybe it is, and it's returning "", although I've valdiated my model has data in "searchterm"

Thoughts?
Alexander Popov
Telerik team
 answered on 05 Jun 2014
2 answers
305 views
I have the following code:

            var dataSource = new kendo.data.SchedulerDataSource({
                data: response.Data,
                schema: {
                    model: {
                        id: "Id",
                        fields: {
                            Id: { type: "number" },
                            title: { field: "Title", defaultValue: "No title", validation: { required: true } },
                            start: { type: "date", field: "Start" },
                            end: { type: "date", field: "End" },
                            description: { field: "Description" },
                            recurrenceId: { from: "RecurrenceId" },
                            recurrenceRule: { from: "RecurrenceRule" },
                            recurrenceException: { from: "RecurrenceException" },
                            ownerId: { field: "OwnerID", defaultValue: 1 },
                            isAllDay: { type: "boolean", field: "IsAllDay" }
                        }
                    }
                }
            });

            scheduler.setDataSource(dataSource);

with the following Json:

{"Success":true,"Data":[{"Id":69422,"EventType":"Event","Title":"Event 69422","Start":"\/Date(1401717600000)\/","StartTimezone":null,"End":"\/Date(1401730200000)\/","EndTimezone":null,"Description":null,"IsAllDay":false,"RecurrenceId":null,"RecurrenceRule":"FREQ=YEARLY;COUNT=3;BYMONTH=6;BYMONTHDAY=1","RecurrenceException":null,"EventTitle":"Baseboard \u0026 Paint","AssociatedWithType":"Job","AssociatedWithId":22438,"AssociatedWithName":"A New Hope","JobId":22438,"DisplayJobId":"YNC482","Color":"#5ceed4","Pending":false,"Completed":false,"BackgroundColor":"#c1e4ef","FontColor":"#000000","ResourceDisplay":"Blaire Whiche","Resources":[{"Id":293,"Name":"Blaire Whiche","Available":false,"IsDefaultChecked":false,"Type":null,"Color":null}],"EventDuration":210,"EventDurationWorkDayPixels":47,"MinutesBeforeWorkDayStart":0,"MinutesBeforeWorkDayStartPixels":0,"SummaryHtml":"\u003cdiv class=\"schedulerEvent\" data-eventid=\"69422\" data-eventtype=\"Event\" style=\"display: none;\"\u003e\u003cdiv class=\"schedulerEventName\"\u003eA New Hope (Job)\u003c/div\u003e\u003cdiv class=\"schedulerJobId\"\u003e22438\u003c/div\u003e\u003cdiv class=\"schedulerEventTitle\"\u003eBaseboard \u0026amp; Paint\u003c/div\u003e\u003cdiv class=\"schedulerEventResources\"\u003eBlaire Whiche\u003c/div\u003e\u003cdiv class=\"schedulerToFrom\"\u003e8:00 AM - 11:30 AM\u003c/div\u003e\u003c/div\u003e"}]}

The problem here is that the event is scheduled for 6/2/2014, then recurring every year on the 1st of June for 3 recurrences. 

This should show the initial event on 6/2/2014, then on 6/1/2015, 2016 and 2017.  However, it is not showing the 6/2/2014 event.  If I move the start date to 6/1/2014, it shows up fine. 

Am I doing something wrong here?
Vladimir Iliev
Telerik team
 answered on 05 Jun 2014
1 answer
123 views
hello,

I'm trying to get some odata information into Kendo Grid.
I'm  not able to bring the CoverageName  information from the expanded client industry data.
The following code was used.

<div id="grid" style="width:100%"></div>
<script>
$(document).ready(function () {
$("#grid").kendoGrid({
dataSource: {
type: "odata",
transport: {
read: {
url: "http://localhost/_vti_bin/ListData.svc/Conflicts?$select=ClientName,ClientIndustry&$expand=ClientIndustry",
contentType: "application/json; charset=utf-8",
type: "GET",
dataType: "json",
}
},

schema: {
model: {
fields: {
ClientName: { type: "string" },
ClientIndustry: { type: "string" },
}
},
},


},

height: 600,
scrollable: false,
pageable: {
pageSize: 10,
pageSizes: true,
},

columns: [
{
title: "Client Name",
field: "ClientName"
}, {
title: "Client Industry",
field: "ClientIndustry.CoverageName"

}
]
})

});
</script>

</div>

Here is the feed that is used.

<feed xml:base="http://localhost/_vti_bin/ListData.svc/">
<title type="text">Conflicts</title>
<id>
http://localhost/_vti_bin/ListData.svc/Conflicts
</id>
<updated>2014-06-03T20:38:33Z</updated>
<link rel="self" title="Conflicts" href= "Conflicts" />
<entry m:etag="W/"2"">
<id>
http://localhost/_vti_bin/ListData.svc/Conflicts(1)
</id>
<title type="text"/>
<updated>2014-05-27T14:53:44-04:00</updated>
<author>
<name/>
</author>
<link rel="edit" title="ConflictsItem" href= "Conflicts(1)" />
<link rel="http://schemas.microsoft.com/ado/2007/08/dataservices/related/ClientIndustry" type="application/atom+xml;type=feed" title="ClientIndustry" href= "Conflicts(1)/ClientIndustry" >
<m:inline>
<feed>
<title type="text">ClientIndustry</title>
<id>
http://localhost/_vti_bin/ListData.svc/Conflicts(1)/ClientIndustry
</id>
<updated>2014-06-03T20:38:33Z</updated>
<link rel="self" title="ClientIndustry" href= "Conflicts(1)/ClientIndustry" />
<entry m:etag="W/"1"">
<id>
http://localhost/_vti_bin/ListData.svc/Coverage(2)
</id>
<title type="text"/>
<updated>2014-05-08T10:12:10-04:00</updated>
<author>
<name/>
</author>
<link rel="edit" title="CoverageItem" href= "Coverage(2)" />
<link rel="http://schemas.microsoft.com/ado/2007/08/dataservices/related/CreatedBy" type="application/atom+xml;type=entry" title="CreatedBy" href= "Coverage(2)/CreatedBy" />
<link rel="http://schemas.microsoft.com/ado/2007/08/dataservices/related/ModifiedBy" type="application/atom+xml;type=entry" title="ModifiedBy" href= "Coverage(2)/ModifiedBy" />
<link rel="http://schemas.microsoft.com/ado/2007/08/dataservices/related/Attachments" type="application/atom+xml;type=feed" title="Attachments" href= "Coverage(2)/Attachments" />
<category term="Microsoft.SharePoint.DataService.CoverageItem" scheme="http://schemas.microsoft.com/ado/2007/08/dataservices/scheme"/>
<content type="application/xml">
<m:properties>
<d:Id m:type="Edm.Int32">2</d:Id>
<d:ContentTypeID>
0x01003E9402529E024F93800379376BCEED6C0036470C1A4E7E52468FE68C989A4CDAA2
</d:ContentTypeID>
<d:ContentType>ListFieldsContentType</d:ContentType>
<d:Modified m:type="Edm.DateTime">2014-05-08T10:12:10</d:Modified>
<d:Created m:type="Edm.DateTime">2014-05-08T10:12:10</d:Created>
<d:CreatedById m:type="Edm.Int32">2</d:CreatedById>
<d:ModifiedById m:type="Edm.Int32">2</d:ModifiedById>
<d:Owshiddenversion m:type="Edm.Int32">1</d:Owshiddenversion>
<d:Version>1.0</d:Version>
<d:Path>/localhost/Lists/Coverage</d:Path>
<d:CoverageName>Alternative Capital Finance</d:CoverageName>
<d:IsActive m:type="Edm.Boolean">true</d:IsActive>
</m:properties>
</content>
</entry>
</feed>
</m:inline>
</link>
<category term="Microsoft.SharePoint.DataService.ConflictsItem" scheme="http://schemas.microsoft.com/ado/2007/08/dataservices/scheme"/>
<content type="application/xml">
<m:properties>
<d:ClientName>Abc Corp</d:ClientName>
</m:properties>
</content>
</entry>
<entry m:etag="W/"6"">
<id>
http://localhost/_vti_bin/ListData.svc/Conflicts(2)
</id>
<title type="text"/>
<updated>2014-05-27T12:54:00-04:00</updated>
<author>
<name/>
</author>
<link rel="edit" title="ConflictsItem" href= "Conflicts(2)" />
<link rel="http://schemas.microsoft.com/ado/2007/08/dataservices/related/ClientIndustry" type="application/atom+xml;type=feed" title="ClientIndustry" href= "Conflicts(2)/ClientIndustry" >
<m:inline>
<feed>
<title type="text">ClientIndustry</title>
<id>
http://localhost/_vti_bin/ListData.svc/Conflicts(2)/ClientIndustry
</id>
<updated>2014-06-03T20:38:33Z</updated>
<link rel="self" title="ClientIndustry" href= "Conflicts(2)/ClientIndustry" />
<entry m:etag="W/"1"">
<id>
http://localhost/_vti_bin/ListData.svc/Coverage(3)
</id>
<title type="text"/>
<updated>2014-05-08T10:12:10-04:00</updated>
<author>
<name/>
</author>
<link rel="edit" title="CoverageItem" href= "Coverage(3)" />
<link rel="http://schemas.microsoft.com/ado/2007/08/dataservices/related/CreatedBy" type="application/atom+xml;type=entry" title="CreatedBy" href= "Coverage(3)/CreatedBy" />
<link rel="http://schemas.microsoft.com/ado/2007/08/dataservices/related/ModifiedBy" type="application/atom+xml;type=entry" title="ModifiedBy" href= "Coverage(3)/ModifiedBy" />
<link rel="http://schemas.microsoft.com/ado/2007/08/dataservices/related/Attachments" type="application/atom+xml;type=feed" title="Attachments" href= "Coverage(3)/Attachments" />
<category term="Microsoft.SharePoint.DataService.CoverageItem" scheme="http://schemas.microsoft.com/ado/2007/08/dataservices/scheme"/>
<content type="application/xml">
<m:properties>
<d:Id m:type="Edm.Int32">3</d:Id>
<d:ContentTypeID>
0x01003E9402529E024F93800379376BCEED6C0036470C1A4E7E52468FE68C989A4CDAA2
</d:ContentTypeID>
<d:ContentType>ListFieldsContentType</d:ContentType>
<d:Modified m:type="Edm.DateTime">2014-05-08T10:12:10</d:Modified>
<d:Created m:type="Edm.DateTime">2014-05-08T10:12:10</d:Created>
<d:CreatedById m:type="Edm.Int32">2</d:CreatedById>
<d:ModifiedById m:type="Edm.Int32">2</d:ModifiedById>
<d:Owshiddenversion m:type="Edm.Int32">1</d:Owshiddenversion>
<d:Version>1.0</d:Version>
<d:Path>/localhost/Lists/Coverage</d:Path>
<d:CoverageName>Consumer & Retail</d:CoverageName>
<d:IsActive m:type="Edm.Boolean">true</d:IsActive>
</m:properties>
</content>
</entry>
<entry m:etag="W/"1"">
<id>
http://localhost/_vti_bin/ListData.svc/Coverage(8)
</id>
<title type="text"/>
<updated>2014-05-08T10:12:10-04:00</updated>
<author>
<name/>
</author>
<link rel="edit" title="CoverageItem" href= "Coverage(8)" />
<link rel="http://schemas.microsoft.com/ado/2007/08/dataservices/related/CreatedBy" type="application/atom+xml;type=entry" title="CreatedBy" href= "Coverage(8)/CreatedBy" />
<link rel="http://schemas.microsoft.com/ado/2007/08/dataservices/related/ModifiedBy" type="application/atom+xml;type=entry" title="ModifiedBy" href= "Coverage(8)/ModifiedBy" />
<link rel="http://schemas.microsoft.com/ado/2007/08/dataservices/related/Attachments" type="application/atom+xml;type=feed" title="Attachments" href= "Coverage(8)/Attachments" />
<category term="Microsoft.SharePoint.DataService.CoverageItem" scheme="http://schemas.microsoft.com/ado/2007/08/dataservices/scheme"/>
<content type="application/xml">
<m:properties>
<d:Id m:type="Edm.Int32">8</d:Id>
<d:ContentTypeID>
0x01003E9402529E024F93800379376BCEED6C0036470C1A4E7E52468FE68C989A4CDAA2
</d:ContentTypeID>
<d:ContentType>ListFieldsContentType</d:ContentType>
<d:Modified m:type="Edm.DateTime">2014-05-08T10:12:10</d:Modified>
<d:Created m:type="Edm.DateTime">2014-05-08T10:12:10</d:Created>
<d:CreatedById m:type="Edm.Int32">2</d:CreatedById>
<d:ModifiedById m:type="Edm.Int32">2</d:ModifiedById>
<d:Owshiddenversion m:type="Edm.Int32">1</d:Owshiddenversion>
<d:Version>1.0</d:Version>
<d:Path>/localhost/Lists/Coverage</d:Path>
<d:CoverageName>Governments</d:CoverageName>
<d:IsActive m:type="Edm.Boolean">true</d:IsActive>
</m:properties>
</content>
</entry>
</feed>
</m:inline>
</link>
<category term="Microsoft.SharePoint.DataService.ConflictsItem" scheme="http://schemas.microsoft.com/ado/2007/08/dataservices/scheme"/>
<content type="application/xml">
<m:properties>
<d:ClientName>Test IBM</d:ClientName>
</m:properties>
</content>
</entry>
<entry m:etag="W/"3"">
<id>
http://localhost/_vti_bin/ListData.svc/Conflicts(3)
</id>
<title type="text"/>
<updated>2014-05-29T12:39:00-04:00</updated>
<author>
<name/>
</author>
<link rel="edit" title="ConflictsItem" href= "Conflicts(3)" />
<link rel="http://schemas.microsoft.com/ado/2007/08/dataservices/related/ClientIndustry" type="application/atom+xml;type=feed" title="ClientIndustry" href= "Conflicts(3)/ClientIndustry" >
<m:inline>
<feed>
<title type="text">ClientIndustry</title>
<id>
http://localhost/_vti_bin/ListData.svc/Conflicts(3)/ClientIndustry
</id>
<updated>2014-06-03T20:38:33Z</updated>
<link rel="self" title="ClientIndustry" href= "Conflicts(3)/ClientIndustry" />
<entry m:etag="W/"1"">
<id>
http://localhost/_vti_bin/ListData.svc/Coverage(4)
</id>
<title type="text"/>
<updated>2014-05-08T10:12:10-04:00</updated>
<author>
<name/>
</author>
<link rel="edit" title="CoverageItem" href= "Coverage(4)" />
<link rel="http://schemas.microsoft.com/ado/2007/08/dataservices/related/CreatedBy" type="application/atom+xml;type=entry" title="CreatedBy" href= "Coverage(4)/CreatedBy" />
<link rel="http://schemas.microsoft.com/ado/2007/08/dataservices/related/ModifiedBy" type="application/atom+xml;type=entry" title="ModifiedBy" href= "Coverage(4)/ModifiedBy" />
<link rel="http://schemas.microsoft.com/ado/2007/08/dataservices/related/Attachments" type="application/atom+xml;type=feed" title="Attachments" href= "Coverage(4)/Attachments" />
<category term="Microsoft.SharePoint.DataService.CoverageItem" scheme="http://schemas.microsoft.com/ado/2007/08/dataservices/scheme"/>
<content type="application/xml">
<m:properties>
<d:Id m:type="Edm.Int32">4</d:Id>
<d:ContentTypeID>
0x01003E9402529E024F93800379376BCEED6C0036470C1A4E7E52468FE68C989A4CDAA2
</d:ContentTypeID>
<d:ContentType>ListFieldsContentType</d:ContentType>
<d:Modified m:type="Edm.DateTime">2014-05-08T10:12:10</d:Modified>
<d:Created m:type="Edm.DateTime">2014-05-08T10:12:10</d:Created>
<d:CreatedById m:type="Edm.Int32">2</d:CreatedById>
<d:ModifiedById m:type="Edm.Int32">2</d:ModifiedById>
<d:Owshiddenversion m:type="Edm.Int32">1</d:Owshiddenversion>
<d:Version>1.0</d:Version>
<d:Path>/localhost/Lists/Coverage</d:Path>
<d:CoverageName>Corporate Finance</d:CoverageName>
<d:IsActive m:type="Edm.Boolean">true</d:IsActive>
</m:properties>
</content>
</entry>
<entry m:etag="W/"1"">
<id>
http://localhost/_vti_bin/ListData.svc/Coverage(11)
</id>
<title type="text"/>
<updated>2014-05-08T10:12:10-04:00</updated>
<author>
<name/>
</author>
<link rel="edit" title="CoverageItem" href= "Coverage(11)" />
<link rel="http://schemas.microsoft.com/ado/2007/08/dataservices/related/CreatedBy" type="application/atom+xml;type=entry" title="CreatedBy" href= "Coverage(11)/CreatedBy" />
<link rel="http://schemas.microsoft.com/ado/2007/08/dataservices/related/ModifiedBy" type="application/atom+xml;type=entry" title="ModifiedBy" href= "Coverage(11)/ModifiedBy" />
<link rel="http://schemas.microsoft.com/ado/2007/08/dataservices/related/Attachments" type="application/atom+xml;type=feed" title="Attachments" href= "Coverage(11)/Attachments" />
<category term="Microsoft.SharePoint.DataService.CoverageItem" scheme="http://schemas.microsoft.com/ado/2007/08/dataservices/scheme"/>
<content type="application/xml">
<m:properties>
<d:Id m:type="Edm.Int32">11</d:Id>
<d:ContentTypeID>
0x01003E9402529E024F93800379376BCEED6C0036470C1A4E7E52468FE68C989A4CDAA2
</d:ContentTypeID>
<d:ContentType>ListFieldsContentType</d:ContentType>
<d:Modified m:type="Edm.DateTime">2014-05-08T10:12:10</d:Modified>
<d:Created m:type="Edm.DateTime">2014-05-08T10:12:10</d:Created>
<d:CreatedById m:type="Edm.Int32">2</d:CreatedById>
<d:ModifiedById m:type="Edm.Int32">2</d:ModifiedById>
<d:Owshiddenversion m:type="Edm.Int32">1</d:Owshiddenversion>
<d:Version>1.0</d:Version>
<d:Path>/localhost/Lists/Coverage</d:Path>
<d:CoverageName>Industrials - Airlines</d:CoverageName>
<d:IsActive m:type="Edm.Boolean">true</d:IsActive>
</m:properties>
</content>
</entry>
</feed>
</m:inline>
</link>
<category term="Microsoft.SharePoint.DataService.ConflictsItem" scheme="http://schemas.microsoft.com/ado/2007/08/dataservices/scheme"/>
<content type="application/xml">
<m:properties>
<d:ClientName>Test ABC inc</d:ClientName>
</m:properties>
</content>
</entry>
</feed>
Daniel
Telerik team
 answered on 05 Jun 2014
1 answer
439 views
Here's my Combobox in Razor format:

@(Html.Kendo().ComboBox()
    .Name("cmbQuarter") 
    .DataTextField("QTR") 
    .DataValueField("QTR") 
 .DataSource(source =>
    {
           source.Read(read =>
           {
               read.Action("GetBuyQuarter", "BuyBuilder"); //Set the Action and Controller name
           })     
           .ServerFiltering(true); //If true the DataSource will not filter the data on the client.
    })
   .SelectedIndex(0) //Select first item.
)

My Controller GetBuyQuarter Function:

    public ActionResult GetBuyQuarter([DataSourceRequest]DataSourceRequest request)
        {
            DataTable dt = new DataTable();
            List<Dictionary<string, object>> rows = new List<Dictionary<string, object>>();
            Dictionary<string, object> row = default(Dictionary<string, object>);

            string conn = ConfigurationManager.ConnectionStrings["DevConnString"].ConnectionString;
            using (SqlConnection con = new SqlConnection(conn))
            {
                using (SqlCommand cmd = new SqlCommand("select * from QTRLIst  where(startdate > DateAdd(yy, -2, getdate()) And startdate < DateAdd(yy, 1, getdate())) order by StartDate desc ", con))
                {
                    con.Open();
                    SqlDataAdapter da = new SqlDataAdapter(cmd);
                    da.Fill(dt);
                    con.Close();

                    foreach (DataRow dr in dt.Rows)
                    {
                        row = new Dictionary<string, object>();
                        foreach (DataColumn col in dt.Columns)
                        {
                            row.Add(col.ColumnName, dr);
                        }
                        rows.Add(row);
                    }
                }
            }
            return Json(rows, JsonRequestBehavior.AllowGet);}

I do not see any data in the combobox.  If i changed the return to Json(dt.ToDataSourceResult(request), JsonRequestBehavior.AllowGet);

i get this error. Unhandled exception at line 11, column 15864 in http://localhost:52493/Scripts/kendo/2014.1.415/kendo.all.min.js

0x800a01b6 - JavaScript runtime error: Object doesn't support property or method 'slice'
















Daniel
Telerik team
 answered on 05 Jun 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
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
ColorPicker
Pager
Styling
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
Simon
Top achievements
Rank 2
Iron
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Marco
Top achievements
Rank 4
Iron
Iron
Iron
Grant
Top achievements
Rank 3
Iron
Iron
Iron
Kao Hung
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Simon
Top achievements
Rank 2
Iron
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Marco
Top achievements
Rank 4
Iron
Iron
Iron
Grant
Top achievements
Rank 3
Iron
Iron
Iron
Kao Hung
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?