Telerik Forums
UI for ASP.NET MVC Forum
1 answer
95 views


Steps to reproduce the issue:

1. Open the Telerik asp.net mvc grid page shown in the below link.

http://demos.telerik.com/aspnet-mvc/razor/Grid/EditingAjax?theme=vista

2. Click on Add New Record button and enter a date in one of the date pickers in the grid. Click on save button.

3. Now change the TimeZone of your machine to a TimeZone which is running at least a few hours behind your current Time Zone and refresh the entire page (Ctrl+F5).

4. If there is a major time difference between the newly selected timezone and your default timezone then the previously saved date would get reduced by a day. For example: if the date you had saved was 1/1/2014 it would get changed to 12/31/2013.

5. Could you please help understand why this is happening and provide a solution that would prevent the date being reduced by a day depending on the client machine's time zone.

Thanks.
Alexander Popov
Telerik team
 answered on 15 Jan 2014
3 answers
98 views
Hi everyone, I'm using the asp.net mvc wrapper chart, but I have a problem when I set the graphic type to column, is some cases I get the text undefined, I attached an image, my code is:
01.@(Html.Kendo().Chart(Model)
02.    .Name("graphicchart")
03.    .Title(title => title.Text(ViewBag.graphictitle))
04.    .Legend(legend => legend
05.        .Position(ChartLegendPosition.Bottom)
06.    )
07.    .ChartArea(chartArea => chartArea
08.        .Background("transparent")
09.    )
10.   .SeriesDefaults(seriesDefaults =>
11.        seriesDefaults.Line()
12.    )
13.    .Series(series =>
14.    {
15.        series.Line(model => model.Parvalue).Name("Valor").Labels(true).Markers(true).Width(3).Opacity(0.8);
16.    })
17.    .CategoryAxis(axis => axis
18.        .Categories(model => model.Datetimevalue)
19.        .MajorGridLines(lines => lines.Visible(false))
20.        .Labels(labels => labels.Rotation(-90))
21.        .Date()
22.        .BaseUnitStep(10)
23.        .MinorGridLines(lines => lines.Visible(true))
24.    )
25.    .Tooltip(tooltip => tooltip
26.        .Visible(true)
27.        .Format("{0}")
28.    )
29.)
Thanks for your help!
Iliana Dyankova
Telerik team
 answered on 15 Jan 2014
4 answers
345 views
I recently downloaded the Kendo UI for ASP.Net MVC.  I ran the msi installer.  Then I started looking for the MVC control examples.   I looked in the following folder. C:\Program Files (x86)\Telerik\Kendo UI for ASP.NET MVC Q2 2013\src\Kendo.Mvc.  I opened the csproj file, "Kendo.MVC.csproj"  However, I did not find any MVC examples.  Please tell me where I can find MVC examples for using the Kendo controls.
Preeti
Top achievements
Rank 1
 answered on 15 Jan 2014
2 answers
402 views
I'm implementing single row undo functionality (rather than cancelling all changes made in the grid). I have an image that will be clicked to trigger the undo:

columns.Template(@<text></text>).ClientTemplate("<img class='undoButton' style='width:16px;' src='Content/images/undo.png' />").Width(32);

Then some JavaScript that attaches the functionality to the img:

<script type="text/javascript">
        // Undo functionality
        $('#activity-grid').on('click', '.undoButton', function (e) {
            e.preventDefault();
  
            //alert('undo');
  
            var grid = $('#activity-grid').data().kendoGrid;
            var dataItem = grid.dataItem($(this).closest('tr'));
  
            dataItem.dirty = false;
  
            grid.dataSource.cancelChanges(dataItem); // works
  
            //grid.refresh(); // only way to show the changes in the UI
        });
</script>

The bolded line clears the changes, but the grid is not updated unless I call the line that is commented out (grid.refresh()).

The problem is that calling .refresh clears the other rows' "dirty" indicator, which is problematic. Is there a way to refresh the UI for a single row? I thought by calling cancelChanges(dataItem), it would do that automatically for me.


Thank you!
Louis
Top achievements
Rank 1
 answered on 14 Jan 2014
1 answer
122 views
I am using this example http://www.kendoui.com/code-library/mvc/grid/using-multiselect-in-grid.aspx to put a multiselect in grid, which works great because the TeritoryEditor's data is set from ViewData and all works well, however I would like each multiselect's data source to be set when the parent is expanded, in other words the datasource should be loaded just like the children in the sub grid, I am not exactly sure where /how i should set the multiselect data source on based on parent
Daniel
Telerik team
 answered on 14 Jan 2014
1 answer
179 views

Using "contains" filter gives me all rows that do not have the specified value.  How can I filter grid rows that do not contain a certain value, so that I only get rows that do have the value?  I tried "doesnotcontain" which doesn't work.

if (val) {
                grid.dataSource.filter({
                    logic: "or",
                    filters: [
                    { field: "someField", operator: "contains", value: val },
                   { field: "someField2", operator: "contains", value: val },
...
Alexander Popov
Telerik team
 answered on 14 Jan 2014
1 answer
410 views
Hi,

Can we change the format in Add/Edit Scheduler?
I have a scheduler with Custom Editor Template with start and date template using DatePicker as following.
@(Html.Kendo().DatePickerFor(model => model.Start)
                    .Value(DateTime.Today)
                    .Format("dd MMM yyyy"))

@(Html.Kendo().DatePickerFor(model => model.End)
                .Value(DateTime.Today)
                .Format("dd MMM yyyy"))

But everytime I tried to save the New Scheduler, it always said "The field Start must be a date/ The field End must be a date".

Is there any way to change the format?

Thanks.
Vladimir Iliev
Telerik team
 answered on 14 Jan 2014
1 answer
255 views
Just thought I would alert the Kendo UI developers to this potential bug:

The JavaScript .map files that came with my trial copy of Kendo UI 2013.3.1119 all contain "sourceRoot":"../src/js/" at the end, which points browsers to the non-existent folder "/src/js" whereas my Kendo UI JS files are located in the "/Scripts/kendo" folder instead. 

This causes DevTools to attempt to load the JS files from the wrong location and display a 404 error in the console.

To fix this problem I had to do a global search-and-replace to remove the optional "sourceRoot" property from all 101 .map files in my project.

Mihai
Telerik team
 answered on 14 Jan 2014
2 answers
250 views
Hello,

I'm using panelbar, and in each panel i use different charts with your addon datawiz, I have the first panel expanded, and when i expend any of the other panels the width is off, it's like 1% width or something, and i have set the htmlattributes to 100% on them all. I have attached a print screen and my code below

@(Html.Kendo().PanelBar()
        .Name("panelbar")
        .HtmlAttributes(new { @style = "width:100%" })
        .ExpandMode(PanelBarExpandMode.Multiple)
        .Items(panelbar =>
        {
            panelbar.Add().Text("Summa kontant och kort")
                .Expanded(true)
                .Content(@<div style="padding: 10px;">
                    @(Html.Kendo().Chart(Model)
        .Name("graphCashOrCard")
        .Title("Köp med kort och kontant")
        .HtmlAttributes(new { @style = "width:100%" })
        .Legend(legend => legend
            .Position(ChartLegendPosition.Top)
        )
 
        .Series(series =>
        {
            series.Column(model => model.TotalCoin).Name("Summa kontantköp");
            series.Column(model => model.TotalCreditCard).Name("Summa kortköp");
        })
        .CategoryAxis(axis => axis
            .Date()
            .BaseUnit(ChartAxisBaseUnit.Fit)
            .Categories(model => model.TimeStamp)
            .Labels(labels => labels.Rotation(-90))
            .MajorGridLines(lines => lines.Visible(false))
        )
        .ValueAxis(axis => axis.Numeric()
            .Labels(labels => labels.Format("{0:N0}"))
            .MajorUnit(100000)
            .Line(line => line.Visible(false))
        )
        .Tooltip(tooltip => tooltip
            .Visible(true)
            .Format("{0:N0}")
        )
                    )
                </div>);
 
            panelbar.Add().Text("Antal fel")
                .Expanded(false)
                .Content(@<div style="padding: 10px;">
                    @(Html.Kendo().Chart(Model)
        .Name("graphFaults")
        .Title("Antal fel")
        .HtmlAttributes(new { @style = "width:100%" })
        .Legend(legend => legend
            .Position(ChartLegendPosition.Top)
        )
 
        .Series(series => series.Column(model => model.NrErrors).Name("Antal Fel"))
        .CategoryAxis(axis => axis
            .Date()
            .BaseUnit(ChartAxisBaseUnit.Fit)
            .Categories(model => model.TimeStamp)
            .Labels(labels => labels.Rotation(-90))
            .MajorGridLines(lines => lines.Visible(false))
        )
        .ValueAxis(axis => axis.Numeric()
            .Labels(labels => labels.Format("{0:N0}"))
            .MajorUnit(20)
            .Line(line => line.Visible(false))
        )
        .Tooltip(tooltip => tooltip
            .Visible(true)
            .Format("{0:N0}")
        )
                    )
                </div>);
 
            panelbar.Add().Text("Antal transaktioner")
                .Expanded(false)
                .Content(@<div style="padding: 10px;">
                    @(Html.Kendo().Chart(Model)
        .Name("graphTransactions")
        .Title("Antal transaktioner")
        .HtmlAttributes(new { @style = "width:100%" })
        .Legend(legend => legend
            .Position(ChartLegendPosition.Top)
        )
 
        .Series(series => series.Column(model => model.NrTransactions).Name("Antal transaktioner"))
        .CategoryAxis(axis => axis
            .Date()
            .BaseUnit(ChartAxisBaseUnit.Fit)
            .Categories(model => model.TimeStamp)
            .Labels(labels => labels.Rotation(-90))
            .MajorGridLines(lines => lines.Visible(false))
        )
        .ValueAxis(axis => axis.Numeric()
            .Labels(labels => labels.Format("{0:N0}"))
            .MajorUnit(10000)
            .Line(line => line.Visible(false))
        )
        .Tooltip(tooltip => tooltip
            .Visible(true)
            .Format("{0:N0}")
        )
                    )
 
                </div>);
        })
Thanks in advance
Mattias Hermansson
Top achievements
Rank 1
 answered on 14 Jan 2014
1 answer
2.2K+ views


I have kendo-grid in my application.And its have filterable "true".
When we apply the filtering then grid items are filtered.When I click on Clear Filter button then automatically grid display the items which is displayed in the page-load.
I understand I have to put $("#PatientSearchResultsGrid").data("kendoGrid").dataSource.filter([]);on click of 'Clear Filter' button but I can not get that event.
I am already using requestStart event of datasource for my 'Filter' click buttonso can not use same event for 'Clear Filter'.
Can anyone advise how to i get 'Clear Filter' event in javascript or how do I differentiate 'Filter' button click from 'Clear Filter' button click
I try to hook DOM event of on 'reset button' click by using jquery but did not have any success

Thanks

My code is as follows :



@(Html.Kendo().Grid(Model.Patients)
      .Name("PatientSearchResultsGrid")
      .Columns(columns =>
          {
              columns.Bound(c => c.LastName).Filterable(false).HeaderTemplate("<span title='Last Name of Patient'>LastName</span>");
              columns.Bound(c => c.FirstName).Filterable(false).HeaderTemplate("<span title='First Name of Patient'>FirstName</span>");
              columns.Bound(c => c.NhsNumber).HeaderTemplate("<span title='Nhs Number of Patient'>NhsNumber</span>");
              columns.Bound(c => c.DateOfBirth).Filterable(false).HeaderTemplate("<span title='Patient Date of Birth'>DateOfBirth</span>");
              columns.Bound(c => c.Gender).Filterable(false).HeaderTemplate("<span title='Gender of Patient'>Gender</span>");
              columns.Bound(c => c.Location).Filterable(false).ClientTemplate("<div title='#=PermanentAddress.FullAddress#'>#=Location#</div>").HeaderTemplate("<span title='Location of Patient Hospital'>Location</span>");
              columns.Bound(c => c.MotherFirstName).Filterable(false).HeaderTemplate("<span title='First Name of Patient Mother'>Mother First Name</span>");
              columns.Bound(c => c.MotherLastName).Filterable(false).HeaderTemplate("<span title='Surname of Patient Mother'>Mother Last Name</span>");
              columns.Bound(c => c.PatientId).Title("Address").Filterable(false).ClientTemplate("sss").HeaderTemplate("<span title='Address of Patient Mother'>Address</span>");
              columns.Bound(c => c.Status).Filterable(false).HeaderTemplate("<span title='Status of  Patient'>Status</span>");
              columns.Bound(c => c.PatientId).Title("Transfer Status").Filterable(false).ClientTemplate(
                "# if (HasNotes) { #" +
                "<a href='\\#'  title='View Patient Notes'  onclick='onNotesClick(#=PatientId#)'> <img  src='" + @Url.Content("~/Areas/Bloodspot/Images/notes.png") + "' /></a>" +
                "# }#");
              columns.Command(command => command.Custom("transferDetails").Click("onTransferClick")).Title("Transfer");    
              
              
          })
      .Pageable(pager=>pager.Input(true) )
      .Sortable()
      //.AutoBind(false)
      .Filterable(filterable => filterable.Enabled(true).Extra(false))
      .HtmlAttributes(new { style = "width:auto" })
      .EnableCustomBinding(true)
      .Events(events => events.DataBound("onRowDataBound"))
      .Filterable(f => f.Extra(false)
      .Messages(m => m.Info("Items with value equal to:")))
      .Events(e => e.FilterMenuInit("filterMenuInit"))      
      .Events(e => e.Change("changeFilterClick"))      
      .DataSource(datasource =>
          {
              datasource.Ajax().Total((int)ViewBag.Total).PageSize(15).Read(read => read.Action("_SearchResults", "Patient").Data("additionalInfo"))
                        .Events(e => e.RequestEnd("dataSource_requestStart"));
          }))

    </div>

<script type="text/javascript">
    $("#errorMsg").hide();
       
    $(document).ready(function () {
        
        debugger;
        //$("#PatientSearchResultsGrid").data("kendoGrid").dataSource.filter([]);
    });
    
    function additionalInfo() {
        if ($("#ReasonCodes").data("kendoDropDownList").select() == 0) {
            return {
                readFilter: 0
            };
        } else {
            return {
                readFilter: 1
            };
        }
    }
    
    function dataSource_requestStart(e) {
        debugger;
        var dropdownlist = $("#ReasonCodes").data("kendoDropDownList");
        
        if (dropdownlist.select() == 0) {
            $("#errorMsg").show();
            $("#errorMsg").text("Please select valid reason code");
            e.preventDefault();
        } else {
            $("#errorMsg").hide();
        }
    }

</script>
Dimiter Madjarov
Telerik team
 answered on 13 Jan 2014
Narrow your results
Selected tags
Tags
Grid
General Discussions
Scheduler
DropDownList
Chart
Editor
TreeView
DatePicker
ComboBox
Upload
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
Dialog
MultiColumnComboBox
DropDownTree
Checkbox
Slider
Switch
Notification
Accessibility
ListView (Mobile)
Pager
Security
ColorPicker
DateRangePicker
Wizard
Styling
Chat
DateInput
MediaPlayer
TileLayout
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
SmartPasteButton
PromptBox
SegmentedControl
+? more
Top users last month
Miljana
Top achievements
Rank 2
Iron
Iron
Joel
Top achievements
Rank 3
Bronze
Bronze
Bronze
Cynthia
Top achievements
Rank 1
John
Top achievements
Rank 1
Iron
Mozart
Top achievements
Rank 1
Iron
Veteran
Want to show your ninja superpower to fellow developers?
Top users last month
Miljana
Top achievements
Rank 2
Iron
Iron
Joel
Top achievements
Rank 3
Bronze
Bronze
Bronze
Cynthia
Top achievements
Rank 1
John
Top achievements
Rank 1
Iron
Mozart
Top achievements
Rank 1
Iron
Veteran
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?