Telerik Forums
UI for ASP.NET MVC Forum
1 answer
96 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
145 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
372 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
215 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
217 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
221 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
139 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
110 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
130 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
Narrow your results
Selected tags
Tags
+? more
Top users last month
Jay
Top achievements
Rank 3
Bronze
Iron
Iron
yw
Top achievements
Rank 2
Iron
Iron
Stefan
Top achievements
Rank 2
Iron
Iron
Iron
Kao Hung
Top achievements
Rank 1
Iron
Bohdan
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Jay
Top achievements
Rank 3
Bronze
Iron
Iron
yw
Top achievements
Rank 2
Iron
Iron
Stefan
Top achievements
Rank 2
Iron
Iron
Iron
Kao Hung
Top achievements
Rank 1
Iron
Bohdan
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?