Telerik Forums
UI for ASP.NET MVC Forum
1 answer
378 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
227 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
222 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.1K+ 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
1 answer
231 views
Hi,


I have a kendo menu with two menu items in partial view. Inside a single menu, I have multiple controller/view navigation. But the issue here is only for the single controller action (default controller mentioned in menu), the menu remains selected(selected style applied). If I am navigating to different Controller/View within the menu, it doesn’t remain selected (default style).

Any solution for this or how to achieve it?

Code will be as below:

@(Html.Kendo().Menu()
.Name("MenuHeader").HtmlAttributes(new { @class = "headermenu"
})
.Orientation(MenuOrientation.Horizontal)
.Items(items =>
{
items.Add().Text("Product").Action("Product ", "Home");
items.Add().Text("Category").Action("Category", "Category");
}).Events(e=>e.Select("onSelect"))
)

And,
Within product I am having another partial view,
@(Html.Kendo().Menu()
.Name("Menu")
.Orientation(MenuOrientation.Vertical)
.Items(items =>
{
items.Add().Text("ListBox").Action("ListBox ","ListBox ");
items.Add().Text("DropDown").Action("DropDown ","DropDown ");
items.Add().Text("TextBox").Action("TextBox ","TextBox ");
})
)

Georgi Krustev
Telerik team
 answered on 13 Jan 2014
4 answers
141 views
I'm using a custom editor to select a value in a grid column and that's working fine. I've tried both a ComboBox and an Autocomplete and with both I'm able to get my list of values from the server and can select one in the custom editor. But when I tab to another grid cell the value disappears. If I click back to that cell the editor takes over again and the selected value reappears. But how can I make the value visible when the cell doesn't have focus?

Custom Editor:
@Html.Kendo().AutoComplete().Name("SOCAutocomplete").Events(events => events.Select("onOpCodeSelect")).DataTextField("opCode").DataSource(d => d.Read(r => r.Action("GetServiceOpCodes", "Onboarding")))

(I've tried a few things in JS in the onOpCodeSelect handler but nothing that I've tried succeeds in retaining the selected value after leaving the cell.)

Grid:
 @(Html.Kendo().Grid<Service>()
                    .Name("ServicesGrid")
                    .Columns(columns =>
                    {
                        columns.Bound(o => o.Description).Title(@Resource.ServiceData_ServiceDescription).Width(150).HtmlAttributes(new { tabindex = 999999 });
                        columns.Bound(o => o.OpCode).Title(@Resource.ServiceData_OpCode).Width(120); // because of UIHint on Service.OpCode it automatically uses OpCodeEditor.cshtml...

 


Vladimir Iliev
Telerik team
 answered on 13 Jan 2014
1 answer
114 views
The menu SecurityTrimming feature isn't hiding actions that are marked as async.

For example I have the following Action:

[Authorize]
public async Task<ActionResult> Profile()
{
     return View();
}

If I include this Action in the Menu, it displays even if the user is not logged in.
Ben
Georgi Krustev
Telerik team
 answered on 10 Jan 2014
1 answer
132 views
                <div id="tabstrip">
                    <ul>
                        <li>
                            Report #1 <span><a class="k-button" href="#"><span class="k-icon k-i-close"></span></a></span>
                        </li>
                        <li>
                            Report #2 <span><a class="k-button" href="#"><span class="k-icon k-i-close"></span></a></span>
                        </li>
                    </ul>
                    <div>Content of Report #1</div>
                    <div>Content of Report #2</div>
                </div>

I've gotten most of it, but I cannot get the k-I-close icon & the k-button in the tab.

                      @(Html.Kendo().TabStrip()
                      .Name("tabstrip")     
                      .Items(items =>
                          {
                              items.Add().Text("Report #1")
                                   .Content("Content of Report #1");
                              items.Add().Text("Report #2")
                                   .Content("Content of Report #2");
                          })
                      )

Any help would be appreciated.
Dimo
Telerik team
 answered on 10 Jan 2014
5 answers
749 views
I've made a Grid that formerly got his data from the Model.
I also had a custom collumn here that i created using columns.template which worked properly.

For sorting and search reasons a changed the datasource to a json from a viewmodel.
When i used this method my data also loaded but the template only displayed an empty column.

This is my code of the Grid:

                        @(Html.Kendo().Grid<KdG.ProjectPortofolio.IntranetApp.ViewModels.Projects.ListProjectViewModel>() 
                              .Name("Grid")
                                        .DataSource(ds => ds.Ajax()
                                                          .Read(r => r.Action("Read", "Project"))
                                        )
                              .EnableCustomBinding(false)
                              .ToolBar(toolBar => toolBar.Custom()
                                    .Text("Exporteer naar Excel")
                                    .HtmlAttributes(new { @class = "export",@id="test" })
                                    .Url(Url.Action("ExportToExcel", "Project",new { page = 1, pageSize = "~", filter = "~", sort = "~" }))
                                    

                              )
                              .Columns(columns =>
                              {
                                  columns.Bound(p => p.Name).Filterable(filterable => filterable.UI("nameFilter")).Title("Naam");
                                  columns.Bound(p => p.Status).Filterable(filterable => filterable.UI("statusFilter")).Title("Status");
                                  columns.Bound(p => p.Category).Title("Categorie");
                                  columns.Bound(p => p.StartDate).Title("Start");
                                  columns.Bound(p => p.EndDate).Title("Einde");
                                  columns.Bound(p => p.AreaOfStudy).Title("Studiegebied");
                                  columns.Bound(p => p.ProjectLeader).Title("Projectleider");
                                  columns.Template(

                                      @<text>
                                        @Html.IconActionLink("glyphicon glyphicon-info-sign", null, "Details", "Project", new { id = item.Id }, new { @class = "btn btn-default btn-xs float FloatLeft" })
                                      </text>);
                              })
                              .Filterable(f => f.Extra(false).Operators(o => o.ForString(s => s
                                  .Clear()
                                  .Contains("Bevat")
                                  .DoesNotContain("Bevat Niet")
                                  .EndsWith("Eindigd met")
                                  )))
                             
                             .Pageable()
                             .Groupable()
                             .Sortable()//Enable paging
)

Thanks in advance
Dimiter Madjarov
Telerik team
 answered on 10 Jan 2014
3 answers
72 views
At Runtime:
Kendo.Mvc.UI.Fluent.EditorToolFactory&#39; does not contain a definition for &#39;ViewHtml&#39; and no extension method &#39;ViewHtml&#39; accepting a first argument of type &#39;Kendo.Mvc.UI.Fluent.EditorToolFactory&#39; could be found (are you missing a using directive or an assembly reference?)

Kendo.Mvc.dll
Version 2013.2.918.340

What gives?
Daniel
Telerik team
 answered on 10 Jan 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
NavBar
ProgressBar
QRCode
RadioButton
Scroller
Timeline
TreeMap
TaskBoard
OrgChart
Captcha
ActionSheet
Signature
DateTimePicker
AppBar
BottomNavigation
Card
FloatingActionButton
Licensing
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?