Telerik Forums
UI for ASP.NET MVC Forum
0 answers
92 views
I have created a chart using Telerik controls and it shows an error in IE 8 but works fine in IE 9 and other browsers. Once I click on the chart it shows an error and the chard does not work thereafter. Can anyone assist me.
Malin
Top achievements
Rank 1
 asked on 06 Sep 2012
5 answers
1.2K+ views
I'm trying to pull some simple data into a kendo grid.  I can see the json data in firebug fine but the grid on the page is empty.  I don't see any errors in firebug or elsewhere.  Please let me know what I'm doing wrong and how to better debug.

Controller:
        [HttpPost]
        public ActionResult GetMilestonesJson()
        {
            Milestone viewModel = new Milestone();
            viewModel.Milestones = new QuerySvc.QuerySvcClient().GetMilestones(this.xLMContext.Worker, null);
            
            return Json(viewModel.Milestones.Select(p => new {ID = p.ID, Name = p.Name, Sequence = p.Sequence, TemplateType = p.TemplateType}).ToArray(), JsonRequestBehavior.AllowGet);            
        }

View:
@{
    ViewBag.Title = "Column_Reordering";
    Layout = "~/Views/Shared/_Layout.cshtml";
}
<h2>
    Column_Reordering</h2>
@(Html.Kendo().Grid<QRC.Models.Milestone>()
    .Name("Grid")
    .Pageable()
    .Scrollable()
    .Columns(columns =>
    {
        columns.Bound(o => o.ID);
        columns.Bound(o => o.Name);
        columns.Bound(o => o.Sequence);
        columns.Bound(o => o.TemplateType);
    })
    .DataSource(dataSource => dataSource
        .Ajax()
        .PageSize(20)
        .Read(read => read.Action("GetMilestonesJson", "Kendo")))


    .Resizable(resize => resize.Columns(true))
    .Reorderable(reorder => reorder.Columns(true))
)

Layout:
<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8" />
    <title>@ViewBag.Title</title>
    <link href="@Url.Content("~/Content/Site.css")" rel="stylesheet" type="text/css" />
    <script src="../../QRC/Scripts/jquery-1.7.2.min.js" type="text/javascript"></script>
    <link rel="stylesheet" href="@Url.Content("~/Content/kendo.common.min.css")">
    <link rel="stylesheet" href="@Url.Content("~/Content/kendo.default.min.css")">
    <script src="@Url.Content("~/Scripts/jquery.min.js")"></script>
    <script src="@Url.Content("~/Scripts/kendo.web.min.js")"></script>
    <script src="@Url.Content("~/Scripts/kendo.aspnetmvc.min.js")"></script>
</head>
<body>
    <div class="page">
        <header>
            <div id="title">
                <h1>
                    My MVC Application</h1>
            </div>
            <div id="logindisplay">
                Welcome <strong>@User.Identity.Name</strong>!
            </div>
            <nav>
                <ul id="menu">
                    <li>@Html.ActionLink("Home", "Index", "Home")</li>
                    <li>@Html.ActionLink("About", "About", "Home")</li>
                </ul>
            </nav>
        </header>
        <section id="main">
            @RenderBody()
        </section>
        <footer>
        </footer>
    </div>
</body>
</html>

json from firebug:
[{"ID":1,"Name":"SW Pre-alpha","Sequence":100,"TemplateType":"SW Platform"},{"ID":2,"Name":"SW Alpha1","Sequence":200,"TemplateType":"SW Platform"},{"ID":3,"Name":"SW Alpha2","Sequence":300,"TemplateType":"SW Platform"},{"ID":4,"Name":"SW Alpha3","Sequence":400,"TemplateType":"SW Platform"},{"ID":5,"Name":"SW Beta1","Sequence":500,"TemplateType":"SW Platform"},{"ID":6,"Name":"SW Beta2","Sequence":600,"TemplateType":"SW Platform"},{"ID":7,"Name":"SW Beta3","Sequence":700,"TemplateType":"SW Platform"},{"ID":8,"Name":"SW PC","Sequence":800,"TemplateType":"SW Platform"},{"ID":9,"Name":"SW PV","Sequence":900,"TemplateType":"SW Platform"},{"ID":10,"Name":"SW Pre-alpha","Sequence":100,"TemplateType":"SW Ingredient"},{"ID":11,"Name":"SW Alpha1","Sequence":200,"TemplateType":"SW Ingredient"},{"ID":12,"Name":"SW Alpha2","Sequence":300,"TemplateType":"SW Ingredient"},{"ID":13,"Name":"SW Alpha3","Sequence":400,"TemplateType":"SW Ingredient"},{"ID":14,"Name":"SW Beta1","Sequence":500,"TemplateType":"SW Ingredient"},{"ID":15,"Name":"SW Beta2","Sequence":600,"TemplateType":"SW Ingredient"},{"ID":16,"Name":"SW Beta3","Sequence":700,"TemplateType":"SW Ingredient"},{"ID":17,"Name":"SW PC","Sequence":800,"TemplateType":"SW Ingredient"},{"ID":18,"Name":"SW PV","Sequence":900,"TemplateType":"SW Ingredient"},{"ID":19,"Name":"SW Pre-alpha","Sequence":100,"TemplateType":"SW Platform Configuration"},{"ID":20,"Name":"SW Alpha1","Sequence":200,"TemplateType":"SW Platform Configuration"},{"ID":21,"Name":"SW Alpha2","Sequence":300,"TemplateType":"SW Platform Configuration"},{"ID":22,"Name":"SW Alpha3","Sequence":400,"TemplateType":"SW Platform Configuration"},{"ID":23,"Name":"SW Beta1","Sequence":500,"TemplateType":"SW Platform Configuration"},{"ID":24,"Name":"SW Beta2","Sequence":600,"TemplateType":"SW Platform Configuration"},{"ID":25,"Name":"SW Beta3","Sequence":700,"TemplateType":"SW Platform Configuration"},{"ID":26,"Name":"SW PC","Sequence":800,"TemplateType":"SW Platform Configuration"},{"ID":27,"Name":"SW PV","Sequence":900,"TemplateType":"SW Platform Configuration"},{"ID":28,"Name":"SW Alpha","Sequence":150,"TemplateType":"Any"},{"ID":29,"Name":"SW Beta","Sequence":450,"TemplateType":"Any"},{"ID":30,"Name":"POPL3","Sequence":50,"TemplateType":"Any"},{"ID":33,"Name":"POPL3-3","Sequence":453,"TemplateType":"SW Ingredient"},{"ID":34,"Name":"KerryMilestone2","Sequence":107,"TemplateType":"Any"},{"ID":35,"Name":"validation tester","Sequence":96,"TemplateType":"SW Platform"},{"ID":36,"Name":"TestMilestone","Sequence":888,"TemplateType":"Any"}]

Kushal
Top achievements
Rank 1
 answered on 06 Sep 2012
0 answers
205 views
hello 
i try to create grid that do this (http://demos.telerik.com/aspnet-ajax/grid/examples/dataediting/usercontroleditform/defaultcs.aspx)
i try to use kendo UI MVC 4 razor syntax 


kfirb b
Top achievements
Rank 1
 asked on 06 Sep 2012
2 answers
213 views
Hello,

I have an MVC application that uses the Grid control.  I have configured .NET DataAnnotations, which includes error messages, and it is working.  When there is a data entry validation error, Javascript displays my error message(s).  The issue that I have is that each message that is displayed does not tell me the name of the field that has invalid data.  The following is the Javascript function that Kendo uses in its examples.  I can't find details as how to add the field name to the message that is displayed.  I hope that someone can help me.

Thanks,

Mike

function error(e) {
    if (e.errors) {
        var message = "Errors:\n";
        $.each(e.errors, function (key, value) {
            if ('errors' in value) {
                $.each(value.errors, function () {                   
                    message += this + "\n";
                });
            }
        });

        alert(message);
    }
}
</script>



Mike
Top achievements
Rank 1
 answered on 05 Sep 2012
0 answers
200 views
I am looking for a easy way to load the sitemap xml from a string vs loading it from a sitemap.xml file.  I came up with this but it is a hack at best.  Basically i already have the xml for the sitemap and wanted to just load it directly not via the filesystem.  Any Ideas?

// To Load the SiteMap into telerik framework
SiteMapManager.SiteMaps.Register<AnotherXmlSiteMap>("sample", siteMap => siteMap.LoadFrom("~/sample.sitemap"));
 
// Binding in UI
@Html.Kendo().Menu().Name("Menu").BindTo("sample")
 
// classes to support it
public class AnotherXmlSiteMap : XmlSiteMap
{
  public AnotherXmlSiteMap() : base(new PathResolver(), new AnotherVPP(), DI.Current.Resolve<ICacheProvider>())
  {
         
  }
 
  public override void LoadFrom(string relativeVirtualPath)
  {
      base.LoadFrom(relativeVirtualPath);
  }
}
 
public class AnotherVPP : IVirtualPathProvider
{
  public bool DirectoryExists(string virtualPath)
  {
      throw new NotImplementedException();
  }
 
  public bool FileExists(string virtualPath)
  {
      throw new NotImplementedException();
  }
 
  public string GetDirectory(string virtualPath)
  {
      throw new NotImplementedException();
  }
 
  public string GetFile(string virtualPath)
  {
      throw new NotImplementedException();
  }
 
  public string GetExtension(string virtualPath)
  {
      throw new NotImplementedException();
  }
 
  public string CombinePaths(string basePath, string relativePath)
  {
      throw new NotImplementedException();
  }
 
  //public string ReadAllText(string virtualPath)
  public string ReadAllText(string sessionKey)
  {
      return @"<?xml version=""1.0"" encoding=""utf-8"" ?>
<siteMap>
<siteMapNode title=""Home"" controller=""Home"" action=""Overview"">
<siteMapNode title=""Grid"">
<siteMapNode controller=""grid"" action=""index"" title=""First Look (Razor)"" area=""razor""/>
<siteMapNode controller=""grid"" action=""index"" title=""First Look (ASPX)"" area=""aspx""/>
<siteMapNode controller=""grid"" action=""editing"" title=""Batch editing (Razor)"" area=""razor""/>
<siteMapNode controller=""grid"" action=""editing"" title=""Batch editing (ASPX)"" area=""aspx""/>
<siteMapNode controller=""grid"" action=""from-table"" title=""Initialization from table (Razor)"" area=""razor""/>
<siteMapNode controller=""grid"" action=""from-table"" title=""Initialization from table (ASPX)"" area=""aspx""/>
</siteMapNode>
<siteMapNode title=""Menu"">
<siteMapNode controller=""menu"" action=""index"" title=""First Look (Razor)"" area=""razor""/>
<siteMapNode controller=""menu"" action=""index"" title=""First Look (ASPX)"" area=""aspx""/>
<siteMapNode controller=""menu"" action=""events"" title=""Events (Razor)"" area=""razor""/>
<siteMapNode controller=""menu"" action=""events"" title=""Events (ASPX)"" area=""aspx""/>
<siteMapNode controller=""menu"" action=""api"" title=""API (Razor)"" area=""razor""/>
<siteMapNode controller=""menu"" action=""api"" title=""API (ASPX)"" area=""aspx""/>
<siteMapNode controller=""menu"" action=""images"" title=""Images (Razor)"" area=""razor""/>
<siteMapNode controller=""menu"" action=""images"" title=""Images (ASPX)"" area=""aspx""/>
</siteMapNode>
</siteMapNode>
</siteMap>";
  }
 
  public string ToAbsolute(string virtualPath)
  {
      throw new NotImplementedException();
  }
 
  public string AppendTrailingSlash(string virtualPath)
  {
      throw new NotImplementedException();
  }
}
Doug
Top achievements
Rank 1
 asked on 05 Sep 2012
0 answers
272 views
Ok so a real simple DropdownFor MVC 4 Razor VS 2012.

   <div class="editor-field">
        <h3>Married</h3>
        @(Html.Kendo().DropDownListFor(model => model.MaritalStatus)
          .Name("MaritalStatus")
          .BindTo(new List<string>() {
              "Married",
              "Single",
              "Divorced",
              "Separated",
              "Committed Partnership"
          }))
    </div>

Only the word Married is displayed because it seems the inline style is defaulting to display, inline:none

See attached for the screen shots.

Any thoughts?

Pat NH USA

Anybody else notice working with JavaScript is a lot like Fortran 4 with punch cards only not as easy to debug?

Pat Tormey
Top achievements
Rank 1
 asked on 05 Sep 2012
0 answers
66 views
When using Ascending / Descending along with the Sort method I get a compile error. For example, this works fine:

    @code
        
        Html.Kendo.Chart(Model).Name("DayChart").Title("CourtPay Daily Totals").
        DataSource(Function(d) d.Read("DayTotals", "CourtPay").
        Group(Function(x) x.Add(Function(m) m.ApplicationCode)).
        Sort(Function(s) s.Add(Function(md) md.PaymentDate))).
        Series(Function(d) d.Bar("Amount")).
        CategoryAxis(Function(a) a.Categories(Function(m) m.PaymentDate)).
        HtmlAttributes(New With {.style = "height:900px; width:700px;"}).
        Theme("Black").
        Render()
    
    End Code

However, this throws an "Expression Does Not Produce a Value" error:

    @code
        
        Html.Kendo.Chart(Model).Name("DayChart").Title("CourtPay Daily Totals").
        DataSource(Function(d) d.Read("DayTotals", "CourtPay").
        Group(Function(x) x.Add(Function(m) m.ApplicationCode)).
        Sort(Function(s) s.Add(Function(md) md.PaymentDate).Descending)).
        Series(Function(d) d.Bar("Amount")).
        CategoryAxis(Function(a) a.Categories(Function(m) m.PaymentDate)).
        HtmlAttributes(New With {.style = "height:900px; width:700px;"}).
        Theme("Black").
        Render()
    
    End Code
steve
Top achievements
Rank 1
 asked on 04 Sep 2012
0 answers
96 views
Hi,

I understand that disabling an html control results in no value being posted back the server, but I would think the DropDownList control would be able to automatically be able to compensate for this instead of having to manage this on my own with hidden controls.   Is this perhaps a future enhancement? 

David A.
David A.
Top achievements
Rank 1
 asked on 04 Sep 2012
0 answers
205 views
My first attempt with the telerik MVC Razor grid, and all seems to be going well. However, I have one item that may be just a simple issue to resolve... I have a grid with 40 rows, and if I have scrolled into the records and then hit the Add New Record button, the grid does open the new record row at either the top or bottom, depending how I configured it. However, the grid does not automatically scroll to the new row for input. Is there a setting or another means to have the grid automatically show the New Record row when Add New Record is clicked?

Thx.

Michael
Michael
Top achievements
Rank 1
 asked on 04 Sep 2012
2 answers
963 views
I'm trying to implement a custom command on a grid that needs to invoke an MVC method that accepts the currently selected rows in the grid as an argument (probably as an IEnumerable<>).  The method would in turn create a view based on the selections.

I have no problem defining the toolbar button, or even setting .Action() to the MVC method I want to call. I just don't know how to tell Action to send the data I need.

I've also tried implement the onclick method on that button.  While i can ultimately invoke onclick, once there nothing i've tried results in the outcome i want.

I'm using the grid in Ajax mode.

Any suggestions?
David
Top achievements
Rank 1
 answered on 04 Sep 2012
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
+? more
Top users last month
Miljana
Top achievements
Rank 2
Iron
Iron
Joel
Top achievements
Rank 3
Bronze
Bronze
Bronze
Cynthia
Top achievements
Rank 1
John
Top achievements
Rank 1
Iron
Mozart
Top achievements
Rank 1
Iron
Veteran
Want to show your ninja superpower to fellow developers?
Top users last month
Miljana
Top achievements
Rank 2
Iron
Iron
Joel
Top achievements
Rank 3
Bronze
Bronze
Bronze
Cynthia
Top achievements
Rank 1
John
Top achievements
Rank 1
Iron
Mozart
Top achievements
Rank 1
Iron
Veteran
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?