Telerik Forums
UI for ASP.NET MVC Forum
1 answer
121 views
Hello,
I have a combobox that looksup on a table with a lot of data and I wish to call an action of a controller to retrieve data while typing.... how can achieve this with Kendo UI MVC with Razor's helpers?

Thanks
Vladimir Iliev
Telerik team
 answered on 23 Jun 2014
1 answer
659 views
Is there a simple way to remove or hide the down arrow on a top level menu?
Iliana Dyankova
Telerik team
 answered on 20 Jun 2014
1 answer
820 views
Hi Team,

I want to make date picker textbox readonly so that user can only select the date from picker,but can not edit,so I do not need to do the client side validation any more.

and the next thing is I want to display the date in .Format("dd MMM yyyy") format,but while passing this valuse to server,I want it to be in default dd-MM-yyyy format

Can you please help me out in doing this.

Thanks & Regards,

Preeti
Alexander Popov
Telerik team
 answered on 20 Jun 2014
1 answer
740 views
Hi to all,

Great day

Can you help me on how to add properly the confirm dialog before click the upload button on select event in kendo upload.
Below is the code where the confirm dialog is appearing but still the upload is still in-progress which is not right.
It should wait for the user to confirm the upload yes or no before progress event is activated.

Here's my code below:

$(document).ready(function () {

        var lookup = $("#ComboLookupTable").data("kendoComboBox");
        $("#files").kendoUpload({
            async: {
                saveUrl: "Lookup/UploadFile",
                autoUpload: false,
                value: 'Import'
            },
            localization: {
                select: "Select a file",
                uploadSelectedFiles: "Import",
                headerStatusUploaded: "File validation",
                headerStatusUploading: "File uploading...",
                statusFailed: "Uploading file failed",
                statusUploaded: "File validating...",
                statusUploading: "Uploading..."
            },
            multiple: false,
            select: function (e) {
                confirmUpload(e);
                              
            },
            progress: function (e) {
                debugger;
                onProgress(e);
            },
            upload: function (e) {
               // debugger;
                lookup.enable(false);
                this.element.prop("disabled", true);
                this.element.closest(".k-button").addClass("k-state-disabled");
                 e.data = { selectedTable: $("#ComboLookupTable").val() };
            },
           
            success: function (e) {
                //debugger;
                resetUpload();
                if (e.XMLHttpRequest.responseText != '' && e.response != 'gridESREF' && e.response != 'gridFuelEfficiency' && e.response != 'gridConversionFactor' &&
                    e.response != 'gridGlobalEmissionFactor' && e.response != 'gridElectricalRegionalEmissionnFactor' && e.response != 'gridGWP') {
                    showErrorMsgsJson(e.XMLHttpRequest.responseText, 'windowDialog');
                    e.preventDefault();
                    dialog.close();
                }
                else {
                    var delay = 1500;
                    setTimeout(function () {
                        //grid names;
                        //gridRefresh(e.response);
                        dialog.close();
                    }, delay);
                }
            },
            complete: function (e) {
                resetUpload();
                this.element.prop("disabled", false);
                this.element.closest(".k-button").removeClass("k-state-disabled");
                lookup.enable(true);
            },
            error: function (e) {
                resetUpload();
                if (e.XMLHttpRequest.responseText != '') {
                    showErrorMsgsJson(e.XMLHttpRequest.responseText, 'windowDialog');
                    e.preventDefault();
                    dialog.close();
                }
            }

        });
    });

 
//Here's the function of my confirm dialog called by select event.


    function confirmUpload(e) {
        window.setTimeout(function () {
            $(".k-upload-selected").click(function (e) {
                // custom logic
                var kendoWindow = $("<div />").kendoWindow({
                    title: "Replace Lookup Table Data?",
                    height: 130,
                    width: 280,
                    resizable: false,
                    modal: true,
                    animation: {
                        open: {
                            effects: "fade:in",
                            duration: 500
                        },
                        close: {
                            effects: "slide:right fadeOut",
                            duration: 500
                        }
                    },
                    visible: false
                });

                kendoWindow.data("kendoWindow")
                    .content($("#upload-confirmation").html())
                    .center().open();

                kendoWindow
                    .find(".upload-confirm,.upload-cancel")
                        .click(function () {
                            if ($(this).hasClass("upload-cancel")) {
                                // If no
                                kendoWindow.data("kendoWindow").close();
                                e.preventDefault();
                                dialog.close();
                                return false;
                            }
                            else {
                                // If yes
                                kendoWindow.data("kendoWindow").close();
                            }
                        })
                                
            });
        }, 1);
       
    }


Thank you and God bless.
T. Tsonev
Telerik team
 answered on 20 Jun 2014
1 answer
191 views
Hi guys...
I have a complex situation here.

I have a treeview loaded with remote data on server 
(exactly the same of your example) and so I have an mvc anction with a nullable id that returns the child of the selected node.
Now in the normal scenario the tree starts with all node collapsed.
The problem is that I need to provide a way to load the page, and the tree as well, with a particular node loaded.

Here my tree:
@(Html.Kendo().TreeView()
    .Name("DataSetTree")
    .TemplateId("ClassifierTreeTemplate")
    .DataSource(dataSource => dataSource
        .Read(read => read
            .Action("Index", "DataSet").Type(HttpVerbs.Post)
        )
    )
    .Events(e =>
    {
        e.Change("OnTreeChange");
        e.DataBound("OnDataBound")
    })
)

I don't provide the action cause it is a bit complex and misleading since I get the data from 3 different tables...
anyway...It works perfectly...

now, I tried to pass the parameter to the actual treeview view (mcv) (success) and then pass it the to client (js)

I guess I need to open the node client-side...and sometimes the selected node could be up to the 9 level deep...
the problem is: if I pass the id (of the node) as an argument of the DataBound event, this event fires when the treeview is not rendered yet.
(while if I attach the event handler as you see on the code I provided, it fires when the rendering is compleated) that's weird...
so..How can I achieve what I need? there's no other event that fires "on Compleate", right?
Can I pass my parameter and have the event fire In the right moment?


I hope I made myself clear.
thanks
Fabio




Vladimir Iliev
Telerik team
 answered on 20 Jun 2014
1 answer
238 views
Hello,

I am trying to set marks on a marker layer via JSON returned from my MVC controller.  I am capturing an onCriteriaChange event from a ListView.  In the event handler function I am try the following

var mapData = $('#map').data('kendoMap');
        mapData.layers[1].dataSource = new kendo.data.DataSource({
            transport: {
                read: {
                    url: ('@Url.Action("getMapData")'),
                    dataType: "json",
                    data: { customerId: customer.Id }
                }
            }
        });
        mapData.layers[1].dataSource.read();

My declaration code is 

$("#map").kendoMap({
                          center: [30.268107, -97.744821],
                          zoom: 15,
                          layers: [{
                              type: "tile",
                              urlTemplate: "http://#= subdomain #.tile2.opencyclemap.org/transport/#= zoom #/#= x #/#= y #.png",
                              subdomains: ["a", "b", "c"],
                              attribution: "© <a href='http://osm.org/copyright'>OpenStreetMap contributors</a>." +
                                           "Tiles courtesy of <a href='http://www.opencyclemap.org/'>Andy Allan</a>"
                          },
                          {
                              type: "marker",
                              locationField: "latlng",
                              titleField: "name",
                              
                          }]
                      });

so you can see the layer already exists.  I just want to set a marker for the lat, long returned by my controller.  

I can verify that my controller is producing JSON (see attached screenshot).   But the markers do not show. Am I doing this correctly? Any help would be appreciated.

T. Tsonev
Telerik team
 answered on 20 Jun 2014
8 answers
490 views
Hi,

I was using telerik for asp.net Ajax, and now I am using it's "evolution", telerik for asp.net MVC for a new website.

But I can't find how to export directly as it is displayed, with filter/group/order?

How can we do this?
Paul
Top achievements
Rank 1
 answered on 19 Jun 2014
1 answer
167 views
Hello ,
maybe you can help me with some issue.

I use kendo grid, I have grid with
aggregates data, and it looks like that:

 Grid:
(attach as grid.jpg)

Aggregates: (I don't use all the aggregates)
(attach as Aggregates.jpg)

I save the grid state (paging, grouping,
sorting, filtering and aggregates) in cookie as (Java Script):

var gridState = {           
       page: dataSource.page(),           
       pageSize: dataSource.pageSize(),           
       sort: dataSource.sort(),           
       group: dataSource.group(),
       filter: dataSource.filter(),
      aggregates: dataSource.aggregates()
        };

Cookie (JSON) (Result of saving):
{"page":1,"pageSize":11,"group":[{"field":"Modality","dir":"asc","aggregates":[{"field":"Space","aggregate":"count"},{"field":"Priority","aggregate":"min"},{"field":"Priority","aggregate":"max"},{"field":"Priority","aggregate":"count"},{"field":"Priority","aggregate":"average"}]}],"aggregates":{"Priority":{"min":1,"max":4,"count":148,"average":3.0135135135135136},"Space":{"count":148}}}

And I try to restoring the grid from
cookie that I already save, I loaded it like that:

Restoring the grid state: (paging, grouping , sorting and filtering)
if (gridState!= '' && gridState!= null) {   
      grid.dataSource.query(gridState);


But unfortunately is not work when I use
aggregate, an exception was throw:
"Uncaught ReferenceError: count is not defined"

And I don't understand it because I have count:
(attach as count.jpg)

Anyway those errors occurs just when I started use aggregates. before it, everything work just fine!

Thanks in advance.

Oren.
Alexander Popov
Telerik team
 answered on 19 Jun 2014
1 answer
96 views
Hello,

I am stuck in one date picker selection. I want to select a date picker. When selection the date , I want to select the beginning of the date at the label. Like if i select 17 June 2014 which is Tuesday, I want to populate 16 June 2014 (Monday). Similarly, If i choose 19 June 2014(Thursday), I want to populate 16 June(Monday). Whatever date I pick, I want the Monday date to populate in the date picker label.
Kiril Nikolov
Telerik team
 answered on 19 Jun 2014
2 answers
680 views
Hi!

When I try to filter a column of type DateTimeOffset, I get an error like: "System.InvalidCastException: Invalid cast &quot;System.DateTime&quot; to quot;System.DateTimeOffset&quot;."

Please tell me how to solve this problem. Thank you!
Aleksey 311
Top achievements
Rank 1
 answered on 18 Jun 2014
Narrow your results
Selected tags
Tags
Grid
General Discussions
Scheduler
DropDownList
Chart
Editor
TreeView
DatePicker
Upload
ComboBox
MultiSelect
ListView
Window
TabStrip
Menu
Installer and VS Extensions
Spreadsheet
AutoComplete
TreeList
Gantt
PanelBar
NumericTextBox
Filter
ToolTip
Map
Diagram
Button
PivotGrid
Form
ListBox
Splitter
Application
FileManager
Sortable
Calendar
View
MaskedTextBox
PDFViewer
TextBox
Toolbar
MultiColumnComboBox
Dialog
DropDownTree
Checkbox
Slider
Switch
Notification
ListView (Mobile)
Pager
Accessibility
ColorPicker
DateRangePicker
Wizard
Security
Styling
Chat
MediaPlayer
TileLayout
DateInput
Drawer
SplitView
Barcode
ButtonGroup (Mobile)
Drawer (Mobile)
ImageEditor
RadioGroup
Sparkline
Stepper
TabStrip (Mobile)
GridLayout
Template
Badge
LinearGauge
ModalView
ResponsivePanel
TextArea
Breadcrumb
ExpansionPanel
Rating
ScrollView
ButtonGroup
CheckBoxGroup
Licensing
NavBar
ProgressBar
QRCode
RadioButton
Scroller
Timeline
TreeMap
TaskBoard
OrgChart
Captcha
ActionSheet
Signature
DateTimePicker
AppBar
BottomNavigation
Card
FloatingActionButton
Localization
MultiViewCalendar
PopOver (Mobile)
Ripple
ScrollView (Mobile)
Switch (Mobile)
PivotGridV2
FlatColorPicker
ColorPalette
DropDownButton
AIPrompt
PropertyGrid
ActionSheet (Mobile)
BulletGraph
Button (Mobile)
Collapsible
Loader
CircularGauge
SkeletonContainer
Popover
HeatMap
Avatar
ColorGradient
CircularProgressBar
SplitButton
StackLayout
TimeDurationPicker
Chip
ChipList
DockManager
ToggleButton
Sankey
OTPInput
ChartWizard
SpeechToTextButton
InlineAIPrompt
TimePicker
StockChart
RadialGauge
ContextMenu
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?