Telerik Forums
Kendo UI for jQuery Forum
3 answers
314 views
I'm very new to the Kendo framework and I'm having an issue that I cannot pin down. 

The code that I pasted below works without issue when I run it in my development environment. 
public ActionResult ClientSearch_Read([DataSourceRequest] DataSourceRequest oRequest, string sSearchValue)
{
if (sSearchValue != null)
{
var data = p_oDb.GetClientSearch(sSearchValue).ToDataSourceResult(oRequest);
return Json(data);
} return null;

However, when I deploy it to my production environment I do not get any results when there should be some.  I was able to use the Developer Tools in IE to finally track down why nothing was coming back.  It turned out to be due to a circular reference.  I cannot figure this out...I do not know what is causing this, how to fix it, or why it occurs in one environment but not the other.  Any help with this would be greatly appreciated.

Below is more details on the error I came across in the Developer Tools:
A circular reference was detected while serializing an object of type 'System.Data.Entity.DynamicProxies.Client_01B64F1E7422FE56835B4D229E8C469B1D4FDE4FCDE484EC36E547106D4A9766'.

[InvalidOperationException: A circular reference was detected while serializing an object of type 'System.Data.Entity.DynamicProxies.Client_01B64F1E7422FE56835B4D229E8C469B1D4FDE4FCDE484EC36E547106D4A9766'.]
System.Web.Script.Serialization.JavaScriptSerializer.SerializeValueInternal(Object o, StringBuilder sb, Int32 depth, Hashtable objectsInUse, SerializationFormat serializationFormat) +1549
System.Web.Script.Serialization.JavaScriptSerializer.SerializeValue(Object o, StringBuilder sb, Int32 depth, Hashtable objectsInUse, SerializationFormat serializationFormat) +194
System.Web.Script.Serialization.JavaScriptSerializer.SerializeCustomObject(Object o, StringBuilder sb, Int32 depth, Hashtable objectsInUse, SerializationFormat serializationFormat) +502
System.Web.Script.Serialization.JavaScriptSerializer.SerializeValueInternal(Object o, StringBuilder sb, Int32 depth, Hashtable objectsInUse, SerializationFormat serializationFormat) +1424
System.Web.Script.Serialization.JavaScriptSerializer.SerializeValue(Object o, StringBuilder sb, Int32 depth, Hashtable objectsInUse, SerializationFormat serializationFormat) +194
System.Web.Script.Serialization.JavaScriptSerializer.SerializeCustomObject(Object o, StringBuilder sb, Int32 depth, Hashtable objectsInUse, SerializationFormat serializationFormat) +282
System.Web.Script.Serialization.JavaScriptSerializer.SerializeValueInternal(Object o, StringBuilder sb, Int32 depth, Hashtable objectsInUse, SerializationFormat serializationFormat) +1424
System.Web.Script.Serialization.JavaScriptSerializer.SerializeValue(Object o, StringBuilder sb, Int32 depth, Hashtable objectsInUse, SerializationFormat serializationFormat) +194
System.Web.Script.Serialization.JavaScriptSerializer.SerializeEnumerable(IEnumerable enumerable, StringBuilder sb, Int32 depth, Hashtable objectsInUse, SerializationFormat serializationFormat) +126
System.Web.Script.Serialization.JavaScriptSerializer.SerializeValueInternal(Object o, StringBuilder sb, Int32 depth, Hashtable objectsInUse, SerializationFormat serializationFormat) +1380
System.Web.Script.Serialization.JavaScriptSerializer.SerializeValue(Object o, StringBuilder sb, Int32 depth, Hashtable objectsInUse, SerializationFormat serializationFormat) +194
System.Web.Script.Serialization.JavaScriptSerializer.SerializeCustomObject(Object o, StringBuilder sb, Int32 depth, Hashtable objectsInUse, SerializationFormat serializationFormat) +502
System.Web.Script.Serialization.JavaScriptSerializer.SerializeValueInternal(Object o, StringBuilder sb, Int32 depth, Hashtable objectsInUse, SerializationFormat serializationFormat) +1424
System.Web.Script.Serialization.JavaScriptSerializer.SerializeValue(Object o, StringBuilder sb, Int32 depth, Hashtable objectsInUse, SerializationFormat serializationFormat) +194
System.Web.Script.Serialization.JavaScriptSerializer.Serialize(Object obj, StringBuilder output, SerializationFormat serializationFormat) +26
System.Web.Script.Serialization.JavaScriptSerializer.Serialize(Object obj, SerializationFormat serializationFormat) +74
System.Web.Mvc.JsonResult.ExecuteResult(ControllerContext context) +342
System.Web.Mvc.ControllerActionInvoker.InvokeActionResult(ControllerContext controllerContext, ActionResult actionResult) +13
System.Web.Mvc.<>c__DisplayClass1a.<InvokeActionResultWithFilters>b__17() +23
System.Web.Mvc.ControllerActionInvoker.InvokeActionResultFilter(IResultFilter filter, ResultExecutingContext preContext, Func`1 continuation) +264
System.Web.Mvc.<>c__DisplayClass1c.<InvokeActionResultWithFilters>b__19() +20
System.Web.Mvc.ControllerActionInvoker.InvokeActionResultWithFilters(ControllerContext controllerContext, IList`1 filters, ActionResult actionResult) +176
System.Web.Mvc.Async.<>c__DisplayClass2a.<BeginInvokeAction>b__20() +71
System.Web.Mvc.Async.<>c__DisplayClass25.<BeginInvokeAction>b__22(IAsyncResult asyncResult) +128
System.Web.Mvc.Async.WrappedAsyncResult`1.End() +50
System.Web.Mvc.Async.AsyncControllerActionInvoker.EndInvokeAction(IAsyncResult asyncResult) +26
System.Web.Mvc.<>c__DisplayClass1d.<BeginExecuteCore>b__18(IAsyncResult asyncResult) +14
System.Web.Mvc.Async.<>c__DisplayClass4.<MakeVoidDelegate>b__3(IAsyncResult ar) +25
System.Web.Mvc.Async.WrappedAsyncResult`1.End() +55
System.Web.Mvc.Controller.EndExecuteCore(IAsyncResult asyncResult) +41
System.Web.Mvc.Async.<>c__DisplayClass4.<MakeVoidDelegate>b__3(IAsyncResult ar) +25
System.Web.Mvc.Async.WrappedAsyncResult`1.End() +55
System.Web.Mvc.Controller.EndExecute(IAsyncResult asyncResult) +28
System.Web.Mvc.Controller.System.Web.Mvc.Async.IAsyncController.EndExecute(IAsyncResult asyncResult) +10
System.Web.Mvc.<>c__DisplayClass8.<BeginProcessRequest>b__3(IAsyncResult asyncResult) +28
System.Web.Mvc.Async.<>c__DisplayClass4.<MakeVoidDelegate>b__3(IAsyncResult ar) +25
System.Web.Mvc.Async.WrappedAsyncResult`1.End() +55
System.Web.Mvc.MvcHandler.EndProcessRequest(IAsyncResult asyncResult) +30
System.Web.Mvc.MvcHandler.System.Web.IHttpAsyncHandler.EndProcessRequest(IAsyncResult result) +9
System.Web.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +8981789
System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +184


Atanas Korchev
Telerik team
 answered on 17 Oct 2013
3 answers
2.0K+ views
I have a Kendo Grid where I filter based on an Enum. 
Let's say the Enum was:
public enum MyEnum
    {
        [Description("Null")] Null = -1,
 
        [Description("Yes")] Yes = 1,
 
        [Description("No")] No = 0,
    }

Kendo Grid:
.Filterable(filter => filter.Enabled(true)
                         .Operators(o => o.ForEnums(e => e.Clear()
                            .IsEqualTo("Equals")
                        .IsNotEqualTo("Not equal to")))
   )

and
.Filter(filter => filter.Add(p => p.myColumn).IsEqualTo(MyEnum.Yes))




I would like for the Filter to show only Yes or No options. Is there a way to do this?
Alexander Popov
Telerik team
 answered on 17 Oct 2013
1 answer
88 views
Hi there,

Inspired by the example on the demos site, I attempted to populate a calendar to show days when our system receives FTP uploads. Here is what I've got so far:
01.<script type="text/javascript">
02.    var today = new Date();
03.    var events = [];
04.    $.getJSON(url, function(json){
05.        for (var i = 0; i < json.length; i++){
06.            events.push(new Date(json[i].Year, json[i].Month -1, json[i].Day));
07.        }
08.        $('#connectionCalendar').kendoCalendar({
09.            value: today,
10.            depth: "month",
11.            start: "month",
12.            dates: events,
13.            month: {
14.                content: '# if ($.inArray(+data.date, data.dates) != -1) { #' +
15.                            '<div class="date-received">' +
16.                                '#= data.value #' +
17.                            '</div>' +
18.                         '# } else { #' +
19.                            '<div class="date-empty">' +
20.                                '#= data.value #' +
21.                            '</div>' +
22.                         '# } #'
23.            },
24.            footer: false
25.        });
26.    });
27.</script>
The code appears to be parsing okay, as I'm getting the date-empty class applied to each of my calendar elements. The JSON is arriving okay, and events is being populated, which leaves me with two scenarios that I can think of:

  1. The async fetching of data is out of step with the calendar being built.
  2. The $.inArray function is not behaving as intended with my new dataset.
Any help you guys can offer would be greatly appreciated. Thanks!


Daniel
Telerik team
 answered on 17 Oct 2013
1 answer
705 views
I am trying to use Kendo Upload UI with Web API. I have the below signature in my web api controller, but somehow the POST is not working. It works fine with
MVC controller, but I need it to work with Web API. I also include the call made from the UI.

 public void AddFile(IEnumerable<HttpPostedFileBase> files, string id)
{
}  
            $("#files").kendoUpload({
                async: {
                    saveUrl: '/api/my/addfile',
                    autoUpload: true
                },
                upload: function (e) {
                    e.data = { id: $('#test').val() };
                }
            });
T. Tsonev
Telerik team
 answered on 17 Oct 2013
3 answers
42 views
Which actions cause a redraw on a chart? 

chart.dataSource.read()
chart.refresh() 
chart.redraw()

I looked at the documentation and the API section provides no information on this, but it would be nice to know without having to resort to looking at the source code or having to post about it. 
Is there anywhere else where this would be documented? 

Thanks,
Jacques
Hristo Germanov
Telerik team
 answered on 17 Oct 2013
2 answers
88 views
I have a series of master details rows in a grid. In the detail of the master grid is a tab group. The detail grids are inside the individual tabs.

I am trying to format the display of an integer (4 digit year) inside the filter column. Removing the comma.

Here is the detail grid .csthml snippet.
        columns.Bound(s => s.SurveyYear).Filterable(f => f.UI("yearFilterFormatSurvey")).Width(85);
 
<script id="yearFilterFormatSurvey" type="text/javascript">
 
    function yearFilterFormatSurvey(element) {
 
        element.kendoNumericTextBox({
            format: 'n0',
            decimals: 0,
        });
 
    }
 
</script>
The problem is that after the first detail row the formatting is no longer applied.

Also I am unable to move the format code to a .js file? I can't move it to any other .cshtml file either. Many of the detail grids have this column and having to put this filter format code into each of their .cshtml files is pretty "code smelly".

I am running the latest released build. 2013.2.918

Thanks,

Trav
Rosen
Telerik team
 answered on 17 Oct 2013
4 answers
76 views
Att: Kiril Nikolov,

Dunno where else to post this... so here goes:
The (multiple) posts from me about "setting the height of an editor" display erroneously using Safari, Chrome and Firefox on OSX.
Trying to access the thread does not result in the normal forum thread view, but rather an editable field containing some/all of the forum thread-html. 
It seems Kiril Nikolov was able to answer one of the posts that I am unable to get a proper view of - maybe Telerik staff acess forums through another interface?
Kiril Nikolov
Telerik team
 answered on 17 Oct 2013
1 answer
40 views
We are converting an app from Telerik MVC to Kendo UI.  We have jQuery code on our grids to capture the current orderBy and filterBy parameters so we can pass them back to our controller.  The controller then creates an Excel download using those parameters.
However the orderBy and filterBy are now undefined in Kendo.  How do I retrieve those values?
    function onDataBound() {
        $('a.lnkDeal').each(function () {
            this.href = this.href.replace(/&/g, "%26");
        });
        var grid = $("#Deals").data('kendoGrid');
        // Get the export link as jQuery object       
        var $exportLink = $('#ExportToExcel');               
        // Get its 'href' attribute - the URL where it would navigate to       
        var href = $exportLink.attr('href');               
        // Update the 'orderBy' parameter with the grids' current sort state
        href = href.replace(/orderBy=([^&]*)/, 'orderBy=' + (grid.orderBy || '~'));
        // Update the 'filter' parameter with the grids' current filtering state       
        //href = href.replace(/filter=(.*)/, 'filter=' + (grid.filterBy || '~'));               
        // Update the 'href' attribute. Replace all ' with | to avoid security issue
        href = href.replace(/'/g, "|");
        $exportLink.attr('href', href);
    }
Atanas Korchev
Telerik team
 answered on 17 Oct 2013
1 answer
90 views
None of my views ever have scroll bars on them. Also, if I set overflow: auto on a div, it also will not have a scroll bar.

How do I allow scroll bars?
Kiril Nikolov
Telerik team
 answered on 17 Oct 2013
2 answers
83 views
I've got a grid:
$('#myGrid').kendoGrid({
    ...
    scrollable: false,
    ...
});
and I've tried all of these things to change the scrollable property:
$('#myGrid').data("kendoGrid").options.scrollable = true;
$('#myGrid').data("kendoGrid").refresh();
 
$('#myGrid').data("kendoGrid").scrollable = true;
$('#myGrid').data("kendoGrid").refresh();
 
var MyGrid = $('#myGrid').data("kendoGrid");
MyGrid.options.scrollable = true;
MyGrid.refresh();
 
var MyGrid = $('#myGrid').data("kendoGrid");
MyGrid.scrollable = true;
MyGrid.refresh();
Nothing works. How does one change whether a grid is scrollable on the fly?
Vladimir Iliev
Telerik team
 answered on 17 Oct 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
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?