Telerik Forums
UI for ASP.NET MVC Forum
1 answer
153 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.1K+ 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
154 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
683 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
91 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
1 answer
204 views

Updated on Sept 26, 2016: The issue has been resolved in the today's release 2016.3.926.0 of the Telerik ASP.NET MVC VSExtension.

There is an issue with the latest version 2016.3.909.0 of the Telerik MVC VS Extensions, which causes error message to be shown twice during an upgrade.



The problem occurs only if the solution item is selected in the Visual Studio Solution Explorer before running the Upgrade wizard.



If the problem happens, you could simply close and ignore the error messages and the upgrade process will complete normally.

These errors will not show at all if you select a project item instead and then run the Upgrade wizard.

We are working on the fix which will be released soon to the Visual Studio Gallery.

Rumen
Telerik team
 answered on 26 Sep 2016
1 answer
370 views

Say I have a master grid with a nested grid defined via a detail template, and that detail grid has popup editing enabled.
Now, if the master grid has a column with e.g. 'MaxDetailRows' to determine the maximum number of records that can be added in the detail grid - how can I check that the number or rows in the detail grid during editing does not exceed the value held in MaxDetailRows.

Here is the edit event code I have as a start :

function onEditDetailGrid(e) {
 
    //get editor window object
    var kendoWindow = e.container.data("kendoWindow");
 
    if (e.model.isNew()) {
 
        // ==> Here I would like to read the master grid's row, and read a column/cellvalue (e.g. 'MaxDetailRows')
                      if (number of rows in the detail grid == MaxDetailRows)

                      {

                                   return false;

                      }

        kendoWindow.setOptions({
            title: "New Detail Record"
        });
    }
     
}



Thanks in advance,

Mike

Eyup
Telerik team
 answered on 26 Sep 2016
1 answer
558 views

Hi, 

I'm tring to change the border color of my inputs when some filed is required, I did accomplish using a sugestion a found on other thread adding those lines on the css

.k-widget > span.k-invalid,
input.k-invalid
{
  border: 1px solid #A90329 !important;
}

 .k-tooltip-validation {
    visibility: hidden
   
  }

 

But this seems not to be working for controls like multiselect, combobox or autocomplete controls, do you have any suggestion?

 

Thnaks

Konstantin Dikov
Telerik team
 answered on 26 Sep 2016
7 answers
597 views

So, I'm trying to see if OData will make the performance a little quicker. At first I had Odata v5 but, as far as I know, the Grid only works with v4 so I downgraded. Working with v4 reduced the number of javascript errors coming back.

However, now I'm stuck. Basically, I get "The query parameter '$count' is not supported.". I know the API works if I take out count and run the URL through POSTMAN.

Can someone help me out?

Here's my grid:

@(Html.Kendo().Grid<vNPISearch>()
            .Name("npi-grid")
            .Columns(columns =>
            {
                columns.Template(x => { }).ClientTemplate("#=GetPecosStatus(PecosNPI) #").Width(50);
                columns.Bound(x => x.ProviderFirstName).Title("First Name");
                columns.Bound(x => x.ProviderLastName).Title("Last Name");
                columns.Bound(x => x.ProviderBusinessLocationAddressCity).Title("City");
                columns.Bound(x => x.ProviderBusinessLocationAddressState).Title("State");
                columns.Bound(x => x.NPI).Title("NPI");
            })
            .DataSource(dataSource => dataSource
        .Custom()
        .Schema(sch =>
        {
            sch.Model(m =>
            {
                m.Id("NPI");
                m.Field(f => f.NPI).Editable(false);
                m.Field(f => f.ProviderFirstName).Editable(false);
                m.Field(f => f.ProviderLastName).Editable(false);
                m.Field(f => f.ProviderBusinessLocationAddressCity).Editable(false);
                m.Field(f => f.ProviderBusinessLocationAddressState).Editable(false);
            });
        })
        .Type("odata-v4")
        .Transport(transport =>
        {
            transport.Read(read => read.Url("http://localhost:58242/api/PecosSearch/Search?id=" + Model.SearchTerm));
        })
        .PageSize(20)
        .ServerPaging(true)
        .ServerSorting(true)
        .ServerFiltering(true)
    )
            .Scrollable(scr => scr.Height("auto"))
            .Sortable()
            .Pageable(pageable => pageable
                .Refresh(true)
                .PageSizes(true)
                .ButtonCount(5))
)

Maria Ilieva
Telerik team
 answered on 26 Sep 2016
4 answers
151 views
Is there a way to limit the scheduler datasource to only query the server based on the current view and then re-query when the view changes?  For example, if the calendar is currently on month view for October, then I'd like to only have the October events.  When the users changes to a different month, then the datasource should query the server for the events in that month.   The reason I'd like this is because as you get more and more events on the calendar, it starts to take awhile to load. 


Thanks
Rosen
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
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?