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

I have been look at Kendo a few days and now trying to move into to a Production alike environment (Testing).

When i start moving into the server (using Web Deploy), and browse to the page with the Kendo control. It dont render right.ex. for a grid It only show the table and text, but all the functionality is gone. I also try with a DatePicker here it only show a whitebox with text?  Looks like im missing some scripts files???

Lennart
Dimo
Telerik team
 answered on 05 Jul 2013
1 answer
151 views
Consider the following cshtml file.  I have changed the style for the tab to hide the tabstrip item headers and added previous/next buttons to the page to simulate a wizard.  If I don't turn off animation for the tabstrip and the user double clicks on the previous or next button the contents of two tabs will be shown stacked on top of one another.  Is there anything I can do about this or is this a bug?

@{
    ViewBag.Title = "About";
}
<hgroup class="title">
    <h1>@ViewBag.Title.</h1>
    <h2>@ViewBag.Message</h2>
</hgroup>
<button id="Previous" class="toggleTab k-button" onclick="moveToTab(-1);return true;">
    Previous</button>
<button id="Next" class="toggleTab k-button" onclick="moveToTab(1);return true;">
    Next</button>
@(Html.Kendo().TabStrip()
          .Name("tabstrip")
          .Animation( false)
          .Items(tabstrip =>
          {
              tabstrip.Add().Text("Paris")
                  .Selected(true)
                  .Content(@<text>
                                Paris
                            </text>);

              tabstrip.Add().Text("New York")
                  .Content(@<text>
    New York
</text>);

              tabstrip.Add().Text("Moscow")
                  .Content(@<text>
Moscow
</text>);

              tabstrip.Add().Text("Sydney")
                  .Content(@<text>
Sydney
</text>);
    tabstrip.Add().Text("Fort Worth")
                  .Content(@<text>
Fort Worth
</text>);
          })
    )
<script>

    var currentIndex = 0;
    var maxIndex;
    var tabStrip;
    
    function moveToTab(increment) {

        if (increment > 0) {
            if (currentIndex < maxIndex) {
                currentIndex++;
                tabStrip.select(currentIndex);
            }
        } else {
            if (currentIndex > 0) {
                currentIndex--;
                tabStrip.select(currentIndex);
            }
        }

    }

    $(document).ready(function () {

        tabStrip = $("#tabstrip").data("kendoTabStrip");
        maxIndex = tabStrip.items().length - 1;
    });
</script>

<style scoped>
    #tabstrip ul.k-tabstrip-items {
    display: none;
}
</style>
Vladimir Iliev
Telerik team
 answered on 04 Jul 2013
4 answers
199 views
I have a column chart which does not show the legend even though I have set legend.Visible to true. If I uncomment the .Group line commented in the code below, then the legend starts showing, but unfortunately it displays the default colors rather than those I have customised with m => m.UiColor  
Sorry I am getting "Invalid post content." when trying to paste the code in this post so I have attached it as an image.
Iliana Dyankova
Telerik team
 answered on 04 Jul 2013
7 answers
709 views
I have tried numerous solutions I have found googling this, but was unable to find anything that worked for me.
Basically, I have a grid that uses inline editing (with a few foreign key columns), and I need to set some fields as editable based on the value in another field. I have attached a screen print of the grid..
I would like the last column to always be editable, but the other columns should only be editable when the last column is not = 'LOGGED'.

The following is the definition of my partial view that contains the grid - using jQuery dialog to display as popup  ..
01.<div id="editLocalEventModal" title="Edit Local Vessel" style="overflow: scroll; display: none;">
02.    <form method="post" id="formEditLocalVessel">
03. 
04.        <div style='text-align: center; background: gray; color: #ffffff; font-size: 15px; height: 22px; width: 100%;'>General Event Information</div>
05.        <div style='margin: 5px 5px 0px 5px'>
06.            <label for='vesselNum'>Vessel #: </label>
07.            <input id='vesselNum' style='width:60px' type='text' disabled value='@ViewBag.VesselNum' />  
08.            <label for='vesselName'>Vessel Name: </label>
09.            <input id='vesselName' style='width:350px' type='text' disabled value='@ViewBag.VesselName' />  
10.            <input type='checkbox' id='AgentCalled' @ViewBag.AgentCalled/><label for='AgentCalled'>Agent Called</label>  
11.            <input type='checkbox' id='Quarantine' @ViewBag.Quarantine/><label for='Quarantine'>Quarantine</label>  
12.            <input type='checkbox' id='COTP' @ViewBag.COTP/><label for='COTP'>COTP</label>  
13.            <input type='checkbox' id='Announce' @ViewBag.Announce/><label for='Announce'>Announce</label>
14.        </div>
15.        <br />
16.        <div style='text-align: center; background: gray; color: #ffffff; font-size: 15px; height: 22px; width: 100%;'>Activity Details</div>
17.        <div>
18.            @(Html.Kendo().Grid((IEnumerable<Maris.Domain.VEGetAttrDetailForVEidLocal_Result>)ViewBag.Fields)
19.                                                        .Name("editLocalEventDetail")
20.                                                        .HtmlAttributes(new { style = "width:1100px; margin:0;" })
21.                                                        .DataSource(dataSource => dataSource
22.                                                                        .Ajax()
23.                                                                        .Batch(true)
24.                                                                        .ServerOperation(false)
25.                                                                        .PageSize(200)
26.                                                                        .Model(model => { model.Id(d => d.VEDDId);
27.                                                                                         //model.Field(d => d.VEDADesc);
28.                                                                                         model.Field(p => p.VEDDId).Editable(false);
29.                                                                                         model.Field(p => p.PortID);
30.                                                                                         model.Field(p => p.VEDDDate);
31.                                                                                         model.Field(p => p.VEDDTime);
32.                                                                                         model.Field(p => p.VEDDComment);
33.                                                                                         model.Field(p => p.VEDStatusID);
34.                                                                        })
35.                                                                        //.Read(read => read.Action("EditingCustom_Read","EventSummary"))
36.                                                                   )
37.                                                        .ToolBar(toolBar =>
38.                                                            {
39.                                                                //toolBar.Save();
40.                                                                toolBar.Create();
41.                                                            })
42.                                                        .Columns(columns =>
43.                                                        {
44.                                                            columns.ForeignKey(d => d.VEDAId, (System.Collections.IEnumerable)ViewData["AttrDropDown"], "VEDAId", "VEDADesc")
45.                                                                   .Title("Attribute").Width(200);
46.                                                            columns.ForeignKey(d => d.PortID, (System.Collections.IEnumerable)ViewData["PortsListsDropDown"], "PortId", "PortShortName").Title("Port").Width(80);
47.                                                            columns.Bound(d => d.VEDDDate).Format("{0:MM/dd/yyyy}").Title("Date").Width(100).EditorTemplateName("Date");
48.                                                            columns.Bound(d => d.VEDDTime).Format("{0:HH:mm}").Title("Time").Width(100).EditorTemplateName("Time");
49.                                                            columns.Bound(d => d.VEDDComment).Title("Comments").Width(300);
50.                                                            columns.ForeignKey(d => d.VEDStatusID, (System.Collections.IEnumerable)ViewData["StatusDropDown"], "VEDStatusID", "VEDStatusAbbr").Title("Status").Width(80);
51.                                                        })
52.                                                        .Scrollable(scr => scr.Height(400))//will be overriden in splitter layoutchange event.
53.                                                        .Resizable(resize => resize.Columns(true))
54.                                                        .Events(events => events.Edit("onEdit"))  // .Change("onChange")
55.                                                        .Editable(editable => editable.Mode(GridEditMode.InCell).CreateAt(GridInsertRowPosition.Bottom))
56.                                    )
57.        </div>
58.        <br />
59.        <div style='text-align: center; background: gray; color: #ffffff; font-size: 15px; height: 22px; width: 100%;'>Comments</div>
60.        <div>
61.            <textarea id='txtComment' rows='3' style='width: 99.5%; border: 0'>@ViewBag.Comment</textarea>
62.        </div>
63.        <div style="text-align: center;">
64.            <input type="button" id="btnUpdate" value="Save" />  <input type="button" id="btnClose" value="Close" />
65.        </div>
66.    </form>
67.</div>
68. 
69.<script>
70. 
71.    function onEdit(arg) {
72.        alert("hello");
73.        // suggestions..
74.    }
75. 
76. 
77.</script>
Daniel
Telerik team
 answered on 03 Jul 2013
1 answer
347 views
Hi,

I have a simple page with a droplist and a chart.  When selecting an item of the droplist, I update the chart with new values.  The new chart can have different number of categories.  On initial load the chart displays correctly with all the categories legend.  When selecting a different element from the droplist, the chart updates correctly but the categories legend does not.

For example, if the original chart had 5 categories and the selected item has 4, the chart still shows 5 categories where the 5th category is empty (no graph) but the 5th category legend still shows.  Whereas if the selected category has more series then the original, the chart displays correctly the additional categories but the the category legend is blank.  Somehow the category legend does not change. 

Using kendo version 2013.1.514.
Manufacturers @(Html.Kendo().DropDownListFor(m => m.MfgList)
                    .Name("mfgList")
                    .DataTextField("Text")
                    .DataValueField("Value")
                    .BindTo(Model.MfgList)
                    .HtmlAttributes(new { style = "width:200px;margin-right:10px;" })
                    .Value(Model.selectedMfgId)
                    .Enable(true)
                    .Events(e => e.Change("ReloadGraph"))
                )
<div class="chart-wrapper">
    @(Html.Kendo().Chart(Model.graphData)
        .Name("chart")
        .Title(Model.Title)
        .Legend(legend => legend
            .Position(ChartLegendPosition.Bottom)           
        )
        .SeriesDefaults(seriesDefaults =>
            seriesDefaults.Column().Stack(true)         
        )
        .Series(series =>
            {
                series.Column(m => m.Series1).Name(Model.Series1Label).Color("#f3ac32");
                series.Column(m => m.Series2).Name(Model.Series2Label).Color("#eda6a6");
            }
        )
        .CategoryAxis(axis => axis
            .Visible(true)
            .Categories(m => m.Categories)
            .MajorGridLines(lines => lines.Visible(false))
            .Labels(labels=>labels.Rotation(-90))
        )
        .ValueAxis(axis => axis           
            .Numeric()
            .Labels(labels => labels.Format("{0}%"))
            .Max(100)
            .Line(line => line.Visible(false))
            .MajorGridLines(lines => lines.Visible(true))
        )
        .Tooltip(tooltip => tooltip
            .Visible(true)
            .Template("#= dataItem.Tooltip #")
        )   
        .HtmlAttributes(new { @style = "Width:400px%;" })
    )
</div>
<script type="text/javascript">   
    function ReloadGraph() {
        var mfgId      = $('#mfgList').val();
        var schoolYear = $('#schoolYearList').val();
        $.ajax({
            type: "POST",
            async: true,
            data: "{'mfgId':'" + mfgId + "','schoolYear':'" + schoolYear + "'}",
            url: '@Url.Action("LoadGraphData", "Commodity")',
            contentType: "application/json; charset=utf-8",
            dataType: "json",
            success: ReloadGraph_ajaxCallSucceed,
            failure: ajaxCallFailed
        });
    }
    function ReloadGraph_ajaxCallSucceed(response) {
        $('#chart').data("kendoChart").dataSource.data(response.graphData);
    }
    function ajaxCallFailed(response) {
        alert("Ajax call Failed ");
    }
</script>
Thanks,
Iliana Dyankova
Telerik team
 answered on 03 Jul 2013
1 answer
655 views
Hi all

When I load the page with the following grid, the browser show me this message "Error! The requested URL returned 500 - Internal Server Error"
Could anybody help me please?

That's my code:

(IndexRechte.cshtml)
@(Html.Telerik().Grid<GruppeFunktion>()
   .Name("Grid")
   .DataKeys(keys =>
       {
           keys.Add(o => o.GruppeFunktionID);
       })
   .ToolBar(commands => { commands.SubmitChanges(); })
   .DataBinding(dataBinding =>
           dataBinding.Ajax()
               .Select("_IndexRechte", "Rechte")
               .Update("_SaveBatchEditing", "Rechte")
   )
   .Columns(columns =>
   {
       columns.Bound(o => o.GruppeFunktionID);
       columns.Bound(o => o.visible)
           .ClientTemplate("<#=visible? 'ja' : 'nein' #>")
           .Title("K")
           .Width(12);
   })
 
   .ClientEvents(events => events
       .OnDataBinding("Grid_onDataBinding")
       .OnError("Grid_onError"))
       .Editable(editing => editing.Mode(GridEditMode.InCell))
       .Scrollable(scrolling => scrolling.Enabled(false).Height("auto")) // ohne Scrolling zerfällt die Tabelle, wenn sie zu breit ist
       .TableHtmlAttributes(new { style = "table-layout = fixed" })
       .Resizable(resizing => resizing.Columns(true))
       .Sortable()
       .Filterable()
       .Groupable()
       .Pageable(paging =>
           paging
               .PageSize(ViewBag.PageSize)
               .Style(ViewBag.PageStyle)
               .Position(GridPagerPosition.Bottom)
        )
   )

And that's the Controller:

[GridAction] 
       public ActionResult _IndexRechte()
       {
           List<GruppeFunktion> gruppeFunktion;
 
           gruppeFunktion = (List<GruppeFunktion>)Session["gruppeFunktion"];
 
           // vorbereitete Geschäftsliste anzeigen
           return View(new GridModel<GruppeFunktion> { Data = gruppeFunktion });
       }
 
       public ViewResult IndexRechte(Guid gruppeID)
       {
           // PageSize
           ViewBag.PageSize = PageSizeFunktionliste;
 
           List<GruppeFunktion> gruppeFunktion = (from ObjGF in this.db.GruppeFunktion
                                                  where ObjGF.GruppeID == gruppeID
                                                  select ObjGF).ToList();
           Session["gruppeFunktion"] = gruppeFunktion;
 
           if (gruppeFunktion.ToList().Count > PageSizeFunktionliste)
           {
               ViewBag.PageStyle = GridPagerStyles.NextPreviousAndNumeric;
           }
           else
           {
               ViewBag.PageStyle = GridPagerStyles.Status;
           }
 
           return View();
       }

Thank's a lot!

Marco
Bill
Top achievements
Rank 1
 answered on 02 Jul 2013
2 answers
231 views
I created a custom popup editor for my grid.  I have two string fields, both defined with [StringLength(20)] in the model.  In the custom popup editor template I use EditorFor to display an editor for both fields.  One gets a standard text input as expected.  One gets the WYSIWYG editor.  (Screenshot attached) Color me confused.  Any ideas?

The two fields I'm referring to in the template below are PowerNumber and CaseNumber.  

The model definitions are:
        [Required]
        [StringLength(20)]
        [Display(Name="Power")]
        public string PowerNumber { get; set; }

        [StringLength(20)]
        [Display(Name="Case #")]
        public string CaseNumber {get; set;}

The editor template:

@model KendoMVC4.Models.Power
@Html.HiddenFor(model => model.ID)
<div class="editor-label">
    @Html.LabelFor(model => model.PowerNumber)
</div>
<div class="editor-field">
    @Html.EditorFor(model => model.PowerNumber)
    @Html.ValidationMessageFor(model => model.PowerNumber)
</div>
<br />
<div class="editor-label">
    @Html.LabelFor(model => model.Posted)
</div>
<div class="editor-field">
    @Html.Kendo().DatePickerFor(model => model.Posted)
    @Html.ValidationMessageFor(model => model.Posted)
</div>
<br />
<div class="editor-label">
    @Html.LabelFor(model => model.Forfeited)
</div>
<div class="editor-field">
    @Html.Kendo().DatePickerFor(model => model.Forfeited)
    @Html.ValidationMessageFor(model => model.Forfeited)
</div>
<br />
<div class="editor-label">
    @Html.LabelFor(model => model.Discharged)
</div>
<div class="editor-field">
    @Html.Kendo().DatePickerFor(model => model.Discharged)
    @Html.ValidationMessageFor(model => model.Discharged)
</div>
<br />
<div class="editor-label">
    @Html.LabelFor(model => model.CaseNumber)
</div>
<div class="editor-field">
    @Html.Kendo().EditorFor(model => model.CaseNumber)
    @Html.ValidationMessageFor(model => model.CaseNumber)
</div>
<br />
<div class="editor-label">
    @Html.LabelFor(model => model.State)
</div>
<div class="editor-field">
    @(Html.Kendo().DropDownListFor(model => model.State)
            .Name("State")
            .OptionLabel("Select State")
            .DataTextField("Text")
            .DataValueField("Value")
            .Items(items =>
                {
                    items.Add().Text("Alaska").Value("AK");
                    items.Add().Text("Hawaii").Value("HI");
                    items.Add().Text("New York").Value("NY");
                    items.Add().Text("Texas").Value("TX");
                })
                )
</div>
<br />
Frederick
Top achievements
Rank 1
 answered on 02 Jul 2013
1 answer
163 views
I followed the instructions here and successfully created a custom command column which displays some text in a popup window.  The next step in what I'd like to do is to have the user able to edit something  on the window shown by that custom command and update the datasource.  How can this be accomplished?

In other words, how can I add, for example, a DatePickerFor a particular field in the model and have a button click send that data back for update?  The model being used is a list of items so it would have to be a DatePicker for the current item in the list.
Daniel
Telerik team
 answered on 02 Jul 2013
1 answer
366 views
Hi, 

I have a column chart which does not show the legend even though I have set legend.Visible to true. If I uncomment the .Group line commented in the code below, then the legend starts showing, but unfortunately it displays the default colors rather than those I have customised with m => m.UiColor
                        
@(Html.Kendo().Chart<WorkItemStatusSummary>()
                      .Name("Chart")
                      .Legend(legend => legend
                          .Visible(true)
                          .Position(ChartLegendPosition.Bottom))
                      .DataSource(ds => ds
                        .Read(read => read
                            .Action("DummyAction", "DummyController")
                            .Data("ChartAdditionalFilterData"))
                        //.Group(g => g.Add(m => m.Status))
                      )
                      .Series(series => series.Column(m => m.Count, m => m.UiColor).Name(""))
                      .CategoryAxis(axis => axis
                                                .Categories(m => m.Status)
                      )
   )
Iliana Dyankova
Telerik team
 answered on 02 Jul 2013
0 answers
188 views
I recently updated several nuget packages in my MVC4 solution. After the update none of the kendo styles or js files were being found. I narrowed it down to the bundling, and identified it was an update to "Microsoft ASP.NET Web Optimization Framework" 1.1.0

The release notes (http://aspnetoptimization.codeplex.com/releases/view/101096) has a section at the bottom that explains why.

I thought of 3 potential solutions:
  1. Change the IgnoreList to be applied to the new directory filters instead (I didn't try this one)
  2. Include the kendo css and js files without using wildcards (tried this one and it works)
  3. Include the non-minified versions of the files, taken from the 'src' folder, in my solution (tried this one and it works)

I've ended up using option 3 as it seems to work best with the intention of how the MV4C bundling should work (non-minified used in debug so can debug into kendo code, and then minified version used in release).

I'm mainly posting to help anyone else who hits this problem, but if anyone has any suggestion why option 3 is not a good option I'd like to hear.

Also Kendo should probably update the documentation as the current IgnoreList approach no longer works.

Alex
Top achievements
Rank 1
 asked on 02 Jul 2013
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
LLM Kit
+? more
Top users last month
Simon
Top achievements
Rank 2
Iron
Iron
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Marco
Top achievements
Rank 4
Iron
Iron
Iron
Grant
Top achievements
Rank 3
Iron
Iron
Iron
Kao Hung
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Simon
Top achievements
Rank 2
Iron
Iron
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Marco
Top achievements
Rank 4
Iron
Iron
Iron
Grant
Top achievements
Rank 3
Iron
Iron
Iron
Kao Hung
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?