Telerik Forums
UI for ASP.NET MVC Forum
4 answers
105 views

Hi,

When there is one diagram in the page like:

@(Html.Kendo().Diagram()
            .Name("diagram1")
            .Layout(l => l
                .Type(DiagramLayoutType.Tree)
                .Subtype(DiagramLayoutSubtype.Right)
                .HorizontalSeparation(30)
                .VerticalSeparation(20)
            )
            ...........
)
it renders correct (tree right).

But when there is another diagram:

@(Html.Kendo().Diagram()
            .Name("diagram2")
            )
            .Layout(l => l
                .Type(DiagramLayoutType.Tree)
                .Subtype(DiagramLayoutSubtype.Down)
                .HorizontalSeparation(30)
                .VerticalSeparation(20)
            )

first diagram renders also "tree down"...

So, what should I do?

 

Kaan
Top achievements
Rank 1
 answered on 29 Sep 2016
3 answers
362 views

Hi,

I have a view with a standalone datepicker (controller/index(DateTime? date))

@(Html.Kendo().DatePicker()
      .Name("datePicker")
      .Events(e => e.Change("change"))
      )

Now I want to have a change event to go to the same page (controller/index(date = result of the datepicker)

function change() {
//something
}

Eduardo Serra
Telerik team
 answered on 28 Sep 2016
2 answers
111 views

when i Integrate sortable with listview,I found that when editable,the textbox cannot focus with mouse,only can use tab focus

 

the listview like this:

    @(Html.Kendo().ListView<txlcinfo.Web.Areas.Institute.Models.UserModel>()
                .Name("AllUserView")
                .TagName("div")
                .ClientTemplateId("UserTemplate")
                .DataSource(dataSource =>
                {
                    dataSource.Create(create => create.Action("Users_Create", "Home"));
                    dataSource.Read(read => read.Action("Users_Read", "Home"));
                    dataSource.Destroy(destory => destory.Action("Delete_User", "Home"));
                    dataSource.Model(model => { model.Id("ID"); });
                })                
                .Editable(edt=>edt.TemplateName("UserModelTemplate"))
                )
    @(Html.Kendo().Sortable()
    .For("#AllUserView")
    )
and the template like this :

@model txlcinfo.Web.Areas.Institute.Models.UserModel
    <div class="product UserPanel list-view-container" style="width:240px;margin:5px;" data-bind="#:ID#" data-id="#:isSelected#" data-old-id="#:isSelected#">
        <div class="row" style="margin:9px;margin-top:15px;">
            <label for="Name" class="select-period">名字</label>
            @(Html.EditorFor(p => p.Name))
            <!-- ProductName validation message placeholder -->
            <span data-for="Name" class="k-invalid-msg"></span>
        </div>
        <div class="row" style="margin:9px;">
            <label for="Name" class="select-period">性别</label>
            @(Html.Kendo().TextBoxFor(p => p.Male))
            <!-- ProductName validation message placeholder -->
            <span data-for="Male" class="k-invalid-msg"></span>
        </div>
        <div class="row" style="margin:9px;">
            <label for="PhoneNum" class="select-period">电话</label>
            @(Html.EditorFor(p => p.PhoneNum))
            <!-- ProductName validation message placeholder -->
            <span data-for="Name" class="k-invalid-msg"></span>
        </div>
        <div class="edit-buttons row" style="margin:10px;float:right;">
            <a class="k-button k-button-icontext k-update-button" href="\\#"><span class="k-icon k-update"></span>保存</a>
            <a class="k-button k-button-icontext k-cancel-button" href="\\#"><span class="k-icon k-cancel"></span>取消</a>
        </div>
        <div class="row" style="margin:5px;"></div>
        </div>
the result is the textbox cannot focus with mouse ,only can focus with ‘tab' key?

Vasil
Telerik team
 answered on 28 Sep 2016
1 answer
596 views

We are implementing the Kendo Scheduler as part of a time attendance manager. While it works mostly as intended, the update code is cripplingly slow for larger data sets:

In our working example for a dataset of ~770 users, the schedule.view(schedule.view().name) call takes almost 3.5 seconds.
During this time the page is completely unresponsive and it's kinda ruining the UX.

Do you have any suggestions to refreshing the schedule, with or without calling "schedule.view(schedule.view().name)", which is more responsive?

Example code:

(function () {
        var element, scheduler;
        benchmark.measure("Trigger updateFilters", function () { element = $('#scheduler'); scheduler = element.data('kendoScheduler'); });
        benchmark.measure("Trigger updateFilters", function () { element.show(); });
        benchmark.measure("Trigger updateFilters", function () {
            scheduler.dataSource.filter({
                operator: function (user) {
                    var result = true;
                    // snip for brevity //
                    return result;
                }
            });
        }, "scheduler.dataSource.filter()");
        benchmark.measure("Trigger updateFilters", function () { scheduler.view(scheduler.view().name); });
}());
(benchmark is a helper class to test timings)

Example measurements are attached.

Ivan Danchev
Telerik team
 answered on 28 Sep 2016
1 answer
122 views

Hi,
Now I am creating a page with a few asp .net mvc components such as bar chart, pie chart etc. Now I want to filter all of the datasource's in these components after selecting a specific value from the set of values in the listview that are being displayed on the side of the page using the script given below. 

function onChange(arg) {
        var selected = $.map(this.select(), function(item) {
            $("#select").html($(item).text());
        }
}

So I essentially want to filter all the components in the page using a value from the list.

Can someone show me how this is done using an example?

 

Thanks & Regards,

Adhip

Ianko
Telerik team
 answered on 28 Sep 2016
1 answer
164 views

I made an update of the UI for ASP.NET MVC. Now, in the tree view only the root is shown and no longer any child.

The view is as follows:

                @(Html.Kendo().TreeView()
                              .Name("treeviewInner")
                              .BindTo((IEnumerable<TreeViewItemModel>)ViewBag.TreeViewContent) 
                )
Here is the code in the controller:

        private List<TreeViewItemModel> GetTreeViewData()
        {
            var items = new List<TreeViewItemModel>()
            {
                new TreeViewItemModel()
                {
                    Text = "0",
                    Items = new List<TreeViewItemModel>()
                    {
                        new TreeViewItemModel()
                        {
                            Text = "1"
                        }
                    }
                }
            };

            return items;
        }

        public ActionResult TreeViewContent(int wbsHeaderId)
        {
            ViewBag.TreeViewContent = GetTreeViewData();
            return PartialView();
        }

Gil
Top achievements
Rank 1
 answered on 28 Sep 2016
3 answers
3.2K+ views

Hi guys,

i have been trying to use kendo window to pop up when ever a user enters wrong credentials. But when the page load for the first time it pop ups.

I tryed to change the visibility to "false" and to "true". when visibility is set to false, the window does not show any more. when visibility is set to true, the dialog window shows when the page loads for the first time.

Here is the code that im using below...

<script>
    $(document).ready(function () {
        var myWindow = $("#Popdiv"),
            undo = $("#submit");
 
        undo.click(function (e) {
        //    e.preventDefault();
        });
 
        $("#okayButton").kendoButton({
            click: function (e) {
                myWindow.data("kendoWindow").close();
            }
        });
 
        //$("#submit").click(function () {
        //       ValidateUsertwo();
        //  });
 
        function onClose() {
            undo.fadeIn();
        }
 
        myWindow.kendoWindow({
            width: 600,
            title: "Error",
            modal: true,
            iframe: true,
            actions: [
                'Pin',
                'Close',
                'Refresh'
            ],
            close: onClose,
           visible: true
        }).data("kendoWindow").center();
 
      
    });
 
    function ValidateUsertwo() {
        var ID = document.getElementById('<%:Html.IdFor(t => t.UserName) %>').value;
        var pass = document.getElementById('<%:Html.IdFor(t => t.Password) %>').value;
 
        if (ID == "") {
            myWindow.data("kendoWindow").open();
            return false;
        }
 
        if (pass == "") {
             
            return false;
        }
        if ('@TempData["msg"]' != "") {
            myWindow.data("kendoWindow").open();
            }
        }
    
    //$("#button").on("click", function (e) {
    //    mywin.data("kendoWindow").close();
    //});
   
 
</script>

help will be appreciated

thanks

 

Ianko
Telerik team
 answered on 27 Sep 2016
1 answer
182 views

Version - 2016.3.914

I am experiencing a problem getting DDL with templates to render properly when used in an editor template, from a grid.

Example :

Model

public class WeightUnit
{
    public byte ID { get; set; }
    public string Code { get; set; }
    public string Description { get; set; }
}



Controller action

public ActionResult WeightUnits_Read([DataSourceRequest]DataSourceRequest request)
{
    IEnumerable<Inflight.ServiceModel.WeightUnit> results = svc.ListWeightUnits();
    return Json(results.ToDataSourceResult(request), JsonRequestBehavior.AllowGet);
}



Code section in View

<div id="weights" class="panel-group" style="padding-left:5px;">
       @Html.Label("Unit", new { style = "width:80px;" })
       @(Html.Kendo().DropDownList()
               .Name("WghtUnit_ID")
               .OptionLabel(Labels.PleaseSelect)
               .DataSource(source =>
               {
                   source.Custom()
                   .ServerFiltering(false)
                   .Type("aspnetmvc-ajax")
                   .Transport(transport =>
                   {
                       transport.Read("WeightUnits_Read", "Utility");
                   })
                   .Schema(schema =>
                   {
                       schema.Data("Data")
                   .Total("Total");
                   });
                   ;
               })
               .DataTextField("Description")
                .ValueTemplate("#: data.Code # - #: data.Description #")
               .DataValueField("ID"))
   </div>

Problem

When used in an EditorTemplate for adding/editing a record to a grid, the selected value is rendered as ' - undefined'

The exact same code  works perfectly well in a basic view.

Am I doing something wrong ?  I assumed that templates could be used in any scenario.

 

Mike

Viktor Tachev
Telerik team
 answered on 27 Sep 2016
3 answers
701 views

Product: UI for ASP.NET MVC 2016.2.714 Commercial
Title: Label text overlapping data bars and legend icons when exporting bar chart to PDF
Description: I am experiencing an issue where a chart looks great within the browser window, but once exported to PDF, some of the text overlaps the series bars and legend icons.  Please refer to attached screenshots showing the in-browser vs. exported-to-PDF renderings.  The category axis labels on the left are overlapping the series bars, and furthermore are not all right-aligned with each other.  The legend labels are also overlapping their icons.  The Razor markup is shown below:
 
@(Html.Kendo().Chart<ReportControlSummaryViewModel>()
                        .Name("controlsChart")
                        .HtmlAttributes(new { style = "height: 619px;" })
                        .Title("Control Summary")
                        .Legend(legend => legend
                            .Position(ChartLegendPosition.Bottom)
                        )
                        .ChartArea(chartArea => chartArea.Background("transparent"))
                        .SeriesDefaults(seriesDefaults => seriesDefaults.Bar().Stack(true))
                        .Series(series =>
                        {
                            series.Bar(model => model.Implemented).Name("Implemented").Color("#00ff00");
                            series.Bar(model => model.Unimplemented).Name("Unimplemented").Color("#ff0000");
                        })
                        .CategoryAxis(axis => axis
                            .Categories(model => model.Name)
                            .MajorGridLines(lines => lines.Visible(false))
                        )
                        .ValueAxis(axis => axis
                            .Numeric()
                            .Line(line => line.Visible(false))
                        )
                        .Tooltip(tooltip => tooltip.Visible(true))
                        .Pdf(pdf => pdf
                            .FileName("Control Categories Control Summary Report.pdf")
                            .ProxyURL(Url.Action("Save", "Export"))                            
                        )
                        .DataSource(dataSource => dataSource.Read(read => read.Action("ControlCategoryControlSummary", "Report").Data("app.getFilters")))                        
                    )

Bozhidar
Telerik team
 answered on 27 Sep 2016
3 answers
99 views

Hi 

I've started as a new dev in a team where all previous devs have left and as usual it's not easy to find information. 

The project is asp.net MVC 4. 

There is a reference to a dll : Kendo..Mvc.dll

The project has the following script files:

kendo.aspnetmvc.min

kendo.core.min

kendo.data.min

kendo.data.odata.min

kendo.data.xml.min

kendo.grid.min

kendo.web.min

And also includes jquery and jquery-ui (1.10). 

Question:

- How do I know if the product was purchased or the kind of licence this is ? (all dependencies have been put into source control). 

- How do I know which version of the product it is ?

- I've struggled trying to use the chart component: when trying @Html.Kendo().Chart(...) I was getting a javascript error saying jquery(...).KendoChart is not a function. Aftersome research I've added a ref to the script kendo.dataviz.min.js and the chart started working (however I'm scared of version mismatch and nasty bugs down the road as I've taken an arbitrary version of the script from a CDN link). So my question is, where/how do I download the script based on a specific version ? 

Thanks 

Dimo
Telerik team
 answered on 26 Sep 2016
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?