Telerik Forums
UI for ASP.NET MVC Forum
1 answer
2.5K+ views
I am stuck with two problems related to the DateTimePicker and the DatePicker.

We have a checkbox in the view where the user can enable/disable the time selector (date only or date/time), and another checkbox for 24 hour range for which I want to disable the To Date DatePicker (have both a FromDate and ToDate pickers).

What I would like to know is..
1. How to disable/enable a DatePicker.
2. How to switch it from date to date/time and back to date again - dependent on the checkbox selection above.

Controls and script in my view. Pretty simple stuff, but my toDatePicker var does not allow me to enable/disable the control. It just does nothing.
I have not done any code yet for changing the date picker between date only and date/time. I cannot even disable the control, so not looked at this yet. Would appreciate a heads up on how to do this please.

Also open to a better way to what I have indicated below.
@Html.EditorFor(x => x.SelectByDateAndTime)
@Html.CheckBoxFor(x => x.TwentyFourHourShift)
@Html.LabelFor(x => x.DateFrom, new { id = "FromDateLabel"})
@Html.EditorFor(x => x.DateFrom)
@Html.EditorFor(m => m.DateTo)
 
$(document).ready(function () {       
        var fromDateLabel = $("#FromDateLabel");       
        var toDatePicker = $("#DateTo").data("kendoDateTimePicker");
        var twentyFourHourShiftCheckBox = $("#TwentyFourHourShift");
        var selectByDateTimeCheckBox = $("#SelectByDateAndTime");
         
        twentyFourHourShiftCheckBox.click(function () {
            if (twentyFourHourShiftCheckBox.attr('checked')) {
                selectByDateTimeCheckBox.attr("disabled", true);
                fromDateLabel.text("For Date");               
            }
            else {
                selectByDateTimeCheckBox.removeAttr("disabled");
                fromDateLabel.text("From Date");               
            }
             
            toDatePicker.enable();
        });
         
        selectByDateTimeCheckBox.click(function () {
            if (selectByDateTimeCheckBox.attr('checked'))
                twentyFourHourShiftCheckBox.attr("disabled", true);
            else
                twentyFourHourShiftCheckBox.removeAttr("disabled");
 
            toDatePicker.enable();
        });
    });
Petur Subev
Telerik team
 answered on 24 Oct 2013
22 answers
5.3K+ views
Hello I have been evaluating Kendo UI for ASP.NET MVC  version 2012.2.710 for a while now and it looks as if I will be recommending we buy a license.
.
I have searched your documentation for a long time trying to find how to implement a custom grid filter rather than use the built in filters.
I am thinking along the lines of having some text and combo boxes above the grid, together with a "Filter" Button.
Eg. First Name: TEXTBOX  Last Name: TEXTBOX  Country: COMBOBOX             FILTERBUTTON
When the user clicks the FILTERBUTTON, the grid will display records according to the contents of the the above.

I am sure the answer must be somewhere in the documentation as I imagine this is a common requirement,  however I just can't find it.

It would be great if you could give me an example or, failing that, point me in the in the right direction.

Many thanks.
Deej
Top achievements
Rank 1
 answered on 23 Oct 2013
1 answer
143 views
I have couple of issues after implementing the keyboard navigation in the Kendo grid.

Issue 1: I need the entire row to be selected when the user tries to edit the column by using keyboard navigation. But currently the row selection happens if
we use mouse or by pressing the “Space Bar” key while navigating through the keyboard.

I need to avoid the row selection, which happens after pressing space bar key and need to implement it when the user tries to edit the cell.

Reason: I need to update the values of other columns when the user edits one column. I have implemented it using the grid selection row.Please refer the
below code for it.

//To validate the user inputs
    function onSave(e) {
        var grid = $a('#GrdPlanOrderToMachine').data("kendoGrid");
        var select;
        var data;
        if (e.values["PlanningInd"] != undefined) {
            if (e.values["PlanningInd"] == "N") {
                $("#confirmationDialog").dialog({
                    resizable: false,
                    height: 150,
                    modal: true,
                    buttons: {
                        "Yes": function () {
                            // Access the row that is selected
                            select =grid.select();
                            // select the data
                            data =grid.dataItem(select);
                            // update the column `Machine` and set its value to `0`
                            data.set("MachineId", 0);
                            // update the column `Status` and set its value to `REC`
                            data.set("Status", "REC");
                            data.set("OrderStatus",0);
                            // update the column `PlanningSeq` and set its value to 9999`
                            data.set("PlanningSeq",9999);
                            $(this).dialog("close");
                        },
                        "No": function () {
                            $(this).dialog("close");
                            select =grid.select();
                            //select the data
                            data =grid.dataItem(select);
                            // update the column `PlanningInd` and set its value to`Y`
                            data.set("PlanningInd", "Y");
                            e.preventDefault();
                        }
                    }
                });
            }
        }
    };

Issue 2:  I have a combo box for a column, which contains value as "Y" or "N". I am able to expand the Combo Box in single click before implementing the keyboard Navigation, but after implementing the key board navigation, I am able to expand the combo box after clicking thrice or more time. I have written the below code in the Edit event. 

 //To protect the cell/entire row from editing based on different condition
    function onEdit(e) {
        //For Planning Ind - We are not able set this based on column name hence referring the index
        if (e.container[0].cellIndex == 14) {
            if (e.model.BundleInd != null) {
                if (e.model.BundleInd.toUpperCase() == 'Y') {
                    this.closeCell();
                }
            }
        }
    }

Thanks in Advance,
Regards,
Sreejesh
Nikolay Rusev
Telerik team
 answered on 23 Oct 2013
1 answer
260 views
I have been trying to incorporate the html5 report viewer in mvc 4 app by following this tutorial :  HTML5 Report Viewer Tutorial

My reports are rendering in the report viewer fine , except the report viewer seems to override the menu/login/etc content of my layout page.

When i view source of the rendered page, these elements are defined, but not visible because of the report viewer.

Here are my controller definitions: 

using Telerik.Reporting.Cache.Interfaces;
using Telerik.Reporting.Services.Engine;
using Telerik.Reporting.Services.WebApi;
 
 
namespace CNX.WebUI.Controllers
{
    public class MenuReportController : Controller
    {
       
        public ViewResult ReportMenuAction(string FileName)
        {
            TempData["fileName"] = FileName;          
            return View();          
        }      
    }
}
and 

using Telerik.Reporting;
using Telerik.Reporting.Cache.Interfaces;
using Telerik.Reporting.Services.Engine;
using Telerik.Reporting.Services.WebApi;
using System.Web;
 
namespace CNX.WebUI.Controllers
{
    public class ReportsController : ReportsControllerBase
    {     
 
        protected override IReportResolver CreateReportResolver()
        {
            var reportsPath = HttpContext.Current.Server.MapPath("~/Reports");
            return new ReportFileResolver(reportsPath).AddFallbackResolver(new ReportTypeResolver());
        }
 
        protected override ICache CreateCache()
        {
            return CacheFactory.CreateFileCache();
        }      
 
    }
}
I have attached my layout view , the view where my report viewer is defined , and the view source text file.

This may be obvious to someone else, but i have been struggling to get the report to render properly for days now.

Should i be defining a custom report viewer template for use with a layout page? Are there settings in the report viewer definition i have incorrect for 
use with a layout view?

Any help would be most appreciated.


Stef
Telerik team
 answered on 23 Oct 2013
6 answers
459 views
I have the following code and when I click the Options label nothing happens. I would have expected the same effect as for clicking within the multi-select control itself (standard behaviour which your other widgets such as DropDownList observe). Is this a bug?  Thanks.
<label for="Options">Options</label>
 @(Html.Kendo().MultiSelect()
                  .Name("Options")
                  .Placeholder("Please select")
                  .HtmlAttributes(new { style = "width: 100%;" })
                  .BindTo(new List<string>() {
                      "Option 1",
                      "Option 2"
                  })
            )
Ian
Top achievements
Rank 1
 answered on 23 Oct 2013
1 answer
70 views
Hi there,

I have run into a bit of a problem with the kendoChart (bullet in this particular case, but probably concerns the others too) with regard to responsive design. The scenario I have is three columns, with two containing textual data and the third one contains some charts. The layout is constructed with Twitter Bootstrap. I will set up the layout below

<div class="row-fluid">
    <div class="span5">First text data</<div>
    <div class="span5">Second text data</div>
    <div class="span2"><div class="rq-kendoChart" data-chartvalue1="2", data-chartvalue2="90"></div></div>
</div>

So, simple enough setup. My problem is that it appears to only be possible to tell the chart to be a static pixel size (only accepts a number, which is then written out in the end result (svg) as "<number>px;". Giving it a static size doesn't mesh very well with the fluid grid, so I was wondering if there is some option I have missed where you can set a % width, or perhaps some other elegant solutions to this problem?

I do have one way around it (event on window.resize, obtain the chart object, hide it, set new size, show it, call chart.redraw) but it seems very hacky and also not very efficient.
Miika
Top achievements
Rank 1
 answered on 23 Oct 2013
1 answer
123 views
i downloaded the kindo UI for ASP.net MVC Q2 2013 sp1 trial version and installed it. when i open the Visual studio express edition in my system the kindo is not available there.
the setup name is like "kendoui.trial.2012.3.1315" pls guide me in right path,
to install and do a POC in kindo MVC wrappers.
Atanas Korchev
Telerik team
 answered on 23 Oct 2013
9 answers
1.7K+ views
I am still finding my feet with the Kendo UI controls so please bare with me if this is a simple fix.

I am using the MVC grid helper to display my grid with a pop up editor. The grid is showing a subset of fields but the editor shows all the fields which forces the popup editor to be scrollable.

Is there a way to keep the update/cancel button always visible on the screen.

Please see the attached images for an explanation of what I am trying to achieve.

Thanks in advance for any help.



Vladimir Iliev
Telerik team
 answered on 23 Oct 2013
1 answer
289 views
Hi,

I have a column as “Mach Id” in the grid. This column needs to be a dropdown list. The values that need to be bound to this dropdown are not constant. It is dynamic for each row based on the “Workcenter” and the “OrderId” column. I am able to get the combo box by using the client template but the values are not bounded. Please provide a solution for this issue.

Regards,
Tamil
Daniel
Telerik team
 answered on 23 Oct 2013
0 answers
85 views
i downloaded the kindo UI for ASP.net MVC Q2 2013 sp1 trial version and installed it. when i open the Visual studio express edition in my system the kindo is not available there.
the setup name is like "kendoui.trial.2012.3.1315" pls guide me in right path,
to install and do a POC in kindo MVC wrappers.
Ganesan
Top achievements
Rank 1
 asked on 23 Oct 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?