Telerik Forums
UI for ASP.NET MVC Forum
1 answer
222 views
I'm trying to filter a Kendo Grid for sales between a start date and end date but have been unable to do so with filter.push gt and lt.  Any help would be appreciated.

            var dFrom, dTo;
            var dateCriteria = $("#searchCustomerOrder").val();
            var dateFrom = new Date(0);
            var dateTo = new Date(0);
            var pos = dateCriteria.indexOf("-");
            if (pos > -1)
            {
                dFrom = searchCustomerOrder.substring(0, pos);
                dTo = searchCustomerOrder.substring(pos + 1);
                if (dFrom && dTo)
                {
                    dateFrom = new Date(dFrom);
                    var secs = dateFrom.getSeconds();
                    if (secs == 0) {
                        var milli = dateFrom.getMilliseconds();
                        milli = milli - 1;
                        dateFrom.setMilliseconds(milli);
                    }

                    dateTo = new Date(dTo);
                    secs = dateTo.getSeconds();
                    if (secs == 0) {
                        milli = dateTo.getMilliseconds();
                        milli = milli + 86399999;
                        dateTo.setMilliseconds(milli);
                    }                  
                    if (!isNaN( dateFrom.getTime()) && !isNaN( dateTo.getTime()))
                    {
                        $datefrom = dateFrom;
                        $dateTo = dateTo;
                        $filter.push(
                            { field: "OrderDate", operator: "gt", value: $datefrom });
                        $filter.push(
                            { field: "OrderDate", operator: "lt", value: $dateTo });
                    }
                }
            }
Mark
Top achievements
Rank 1
 answered on 21 Nov 2013
14 answers
1.0K+ views
Folks,

If I start new development by MVC 5  with VS 2013 Preview that has production licence.
Will I have major problems to integrate Kendo UI  for MVC 5 project when using latest internal build  Kendoui.aspnetmvc.2013.2.823.commercial.zip or should I wait for the Q3?, which will support VS 2013 MVC 5?

Alexander
Alexander K
Top achievements
Rank 1
 answered on 21 Nov 2013
1 answer
102 views
I am using the grid to edit dates, I am in Australia, and when editing 2013-11-9 it becomes 2013-9-11 I have read many posts about this but cant seem to fix it. 
I am using the MVC wrappers. 
I have tried using dateformat on the grid field, i have set globalization in webconfig, I have added kendo.culture.en-AU.min.js script (not sure if that is necessary in mvc wrappers) but cant get it to work.
Thanks

I should add, my date type is nullable of date
Thanks
Petur Subev
Telerik team
 answered on 20 Nov 2013
3 answers
242 views
I’m trying out the grid control and have a problem.  When I create a new project in VS 2012 using the Kendo wizard and simply replace the sample controls with a simple grid (source code attached), my grid headers don’t look right – there is a white space at the top of the header cells.  This space doesn’t appear in the “Getting Started with MVC” samples that I downloaded.  I can’t figure out how to correct this.  Screenshot of my grid is also attached.
akj
Top achievements
Rank 1
 answered on 19 Nov 2013
1 answer
134 views
I have a MultiSelect control set up like this:
01.@(Html.Kendo().MultiSelect()
02.     .Name("myCombo")
03.     .DataTextField("Text")
04.     .DataValueField("Value")
05.     .AutoBind(false)
06.     .DataSource(source =>
07.     {
08.          source.Read(read =>
09.          {
10.               read.Action("_SearchAction", "Controller");
11.          })
12.          .ServerFiltering(true);
13.     })
14.)
And I noticed that if I type in a value that doesn't match any records in the database, it keeps on sending ajax requests. Typing something that matches my criteria stops any further requests. Is there a reason why it would behave like that?
Ryan
Top achievements
Rank 1
 answered on 19 Nov 2013
1 answer
324 views
I am new to Kendo for MVC Asp.net.  Can you point me to a simple example for using the kendo datagrid?  Maybe a simple tutorial or just a simple code example. Thanks
Dimiter Madjarov
Telerik team
 answered on 19 Nov 2013
5 answers
258 views
All skins, seems to happen when number pickers are embedded in TabStrips and ComboBoxs when in KendoWindows.

See attachment.

(Chrome)
Dimo
Telerik team
 answered on 19 Nov 2013
5 answers
165 views


Question 1
Is serverPaging, serverSorting and serverFiltering officially supported with javascript notation?
 

Question 2

To enable serverPaging, serverSorting and serverFiltering through javascript the dataSource schema must be changed to:

  schema: {                   
data: "data",                   
total: "total"               
}

Here
is our previous schema which enabled us to define default values and specify types, how do we combine the two:
               
schema: {                   
model: {                       
id: "TransactionID",                       
fields: {                           
TransactionID: { editable: false, nullable: true, defaultValue : "00000000-0000-0000-0000-000000000000"
},                           
TicketNumber: {type: "string" },                           
//TransactionTypeDesc: { type: "string",editable: false,
defaultValue: "Fuel" },                           
StatusName: {type: "string" },                           
Departure_Date: { type: "date"},                           
Arrival_Date: {type: "date"},                           
FlightNumber: { type: "string" },                           
AircraftName: {type: "string" },                           
TerminalAndGate: { type: "string" },                           
AirlineName: {type: "string", defaultValue: { AirlineID: 1,
AirlineName: "135 Airways"} },                            
DestinationAirportCode: { type: "string", defaultValue: { LocationID:1, AirportCode: "ATL"} },                          
ArrivalAirportCode: { type: "string", defaultValue: { LocationID: 1, AirportCode: "ATL"} },                            
ShipNumber: { type: "string" },                           
TailNumber: { type: "string" },                           
Product: { type: "string" },                           
FuelQuantity: { type: "string" },
Temperature: { type: "string" },
Density: { type: "string" },                           
StartTotalizer: { type: "string" },
StopTotalizer: { type: "string" },
TotalGallons: { type: "string" },
FuelEquipment: { type: "string" },
Fueler: { type: "string" },
InOpGuage: { type: "string" },
Supplier: { type: "string" },
StartTime: { type: "string" },
EndTime: { type: "string" },
FuelCaps: { type: "string" },
Notes: { type: "string" }
}                
}           
}

Vladimir Iliev
Telerik team
 answered on 19 Nov 2013
2 answers
399 views
I'm trying to implement in-cell editing on a kendo ajax bound grid. All of my columns have a editor template. I have a client side javascript function that is called in the grid's save event.

Here is the grid definition 

@( Html.Kendo().Grid<CNX.Domain.Entities.CnxTrain>()
       .Sortable(sorting => sorting.SortMode(GridSortMode.SingleColumn))
       .Filterable()
       .Pageable()
       .Name("IncompleteTrains")
       .Editable(editable => editable.Mode(GridEditMode.InCell))       
       .Columns(columns =>
                {
                    columns.Bound(x => x.Id).Visible(false);
                    columns.Bound(x => x.STANDARD_CARRIER_ALPHA_CODE).Width(75).EditorTemplateName("_textEditor");
                    columns.Bound(x => x.UNIT_TRAIN).Width(75).EditorTemplateName("_textEditor");
                    columns.Bound(x => x.CNX_AUT).Width(75).EditorTemplateName("_textEditor");
                    columns.Bound(x => x.ARRIVAL_DATE_TIME).Width(100).Format("{0:MM/dd/yyyy hh:mm:ss}").EditorTemplateName("_dateTimeEditor");
                    columns.Bound(x => x.PERMIT_NUMBER).Width(100).EditorTemplateName("_textEditor");
                    columns.Bound(x => x.SHIPPER_NAME).Width(100).EditorTemplateName("_textEditor");
                  //  columns.Bound(x => x.CNX_RELEASE_DATE_TIME).Width(100).Format("{0:MM/dd/yyyy hh:mm:ss}").EditorTemplateName("_dateTimeEditor");                  
                })
        .ClientDetailTemplateId("incompleteTrainTemplate")     
        .Events(ev => ev.Save("incompleteTrains_Save"))
        .DataSource(dataSource => dataSource.Ajax().PageSize(5).Read(read => read.Action("IncompleteTrains", "MenuTrain").Type(HttpVerbs.Post))
                                                               .Update(update => update.Action("IncompleteTrainsUpdate", "MenuTrain", Model).Type(HttpVerbs.Post))
                                                               .Model(model => model.Id(x => x.Id)))
)
@model string
 
@Html.TextBoxFor(m => m , new {@class = "k-input k-textbox"})
@(Html.Kendo().DateTimePickerFor(m => m).Format("MM/dd/yyyy hh:mm:ss").Name("DateTimeEditor"))
Here is the client side javascript function 
function incompleteTrains_Save(e) {
        var dateValue;
        var timeValue;
        if (e.values.DateTimeEditor != null) {
            dateValue = e.values.DateTimeEditor.toDateString();
            timeValue = e.values.DateTimeEditor.toTimeString();
            e.model.set("ARRIVAL_DATE_TIME", new Date(e.values.DateTimeEditor.toDateString() + ' ' + e.values.DateTimeEditor.toTimeString()));
        }
        else {
            var objGet = e.values.get();
            var objSet = valueOf(e.values);
            e.model.set(e.values.get(), valueOf(e.values));
        }
        e.sender.dataSource.sync();
    }
i need to figure out a way to set the model fields based on e.values in a generic way rather than having to specify the model field specifically like shown for the datetime editor.

something like e.model.set(e.values.???? , val(e.values.???))

Thanks in advance

Matt Miller
Top achievements
Rank 1
 answered on 18 Nov 2013
3 answers
124 views
Hi 

I have two different grid on the same tabstrip. (Not a hierarchical grid)

I want to load second grid based on the first grid records in a second grid dropdown.

Is there any other good way to populate second grid dropdown when the first grid has new record added or edited?

At the moment, I am refresing the dropdown value on the drop down event. But it takes some time and it doesnt look good to wait untill open event is completed.

Victor
Petur Subev
Telerik team
 answered on 18 Nov 2013
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
Template
Barcode
ButtonGroup (Mobile)
Drawer (Mobile)
ImageEditor
RadioGroup
Sparkline
Stepper
TabStrip (Mobile)
GridLayout
Badge
LinearGauge
ModalView
ResponsivePanel
TextArea
Breadcrumb
ExpansionPanel
Licensing
Rating
ScrollView
ButtonGroup
CheckBoxGroup
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
Top achievements
Rank 1
Iron
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
ivory
Top achievements
Rank 1
Iron
Nurik
Top achievements
Rank 2
Iron
Iron
YF
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Top achievements
Rank 1
Iron
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
ivory
Top achievements
Rank 1
Iron
Nurik
Top achievements
Rank 2
Iron
Iron
YF
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?