Telerik Forums
UI for ASP.NET MVC Forum
0 answers
397 views
Hi Grurs,

I am using a trial version on Kendo UI for MVC for the purpose of development of the prototype. I have developed everything with the following development configuration
1) VS 2010
2) ASP.NET MVC3
3) Razor
4) Kendo UI
it runs proper when i run it from VS but when i install it on the server then it throws following error
"CS1593: Delegate 'System.Action' does not take 1 arguments"

For following code
Line 77:           .Scrollable(false)
Line 78:           .HtmlAttributes(new { id = "top-panes" })
Line 79:           .Content(@<div>
Line 80:                     
Line 81:                 </div>);

I am using Panel bar here.

Kindly help me to solve this issue

Thanks in Advance

Regards
Swap
Swapnil
Top achievements
Rank 1
 asked on 26 Sep 2012
6 answers
230 views
Hello team;

I'm asked to provide a good strategy for the following case. Then I'll pose a few questions to the team to see what the advice and the strategy would be:

App requirements:

  • The app. needs to be able to run on desktop, tablet & mobile (all as browser app). The desktop version will also perform the "Admin" routine that is not available on mobile. Basically, 60% of the app are the same on all three devices
  • The app. is a very LoB app, meaning lots of data will be retrieved from Database and most contents will come from database. [Makes a great MVC candidate]

Question:

  • As we have the MVC wrappers for the desktop version of KendoUI, do we also have MVC wrappers for the Mobile/Tablet version? This way, the developers can approach building the entire app (Desktop & mobile) in MVC 4 platform?
  • If not, does this mean the desktop needs to be done in MVC and the mobile backend in WebAPI with HTML5 frontend?

So, as the title of this post goes, what strategy does Kendo team suggest for building an app for three devices based MSFT stack that minimizes duplicate of code between devices?

Note: Client has indicated, they prefer to do the entire development on MVC [for desktop] rather than MVC + WebAPI [for mobile].

Your suggestions & guidelines will be much appreciated!
Thanks!
..Ben

Ben Hayat
Top achievements
Rank 2
 answered on 26 Sep 2012
2 answers
405 views
I have a custom editor for the pop-up and everything is working fine. However I would like to hide or show a a section depending on a value from the model. However, these model values are always NULL. 

for example Model.QuoteId is always null

@using (Html.BeginForm(Model))
{
    if (Model.QuoteId == null)
    {
        <fieldset id="selector">
foo
        </fieldset>
    }
}


I do get values for this.

            @Html.EditorFor(model => model.Amount)


thank you!
David A.
Top achievements
Rank 1
 answered on 25 Sep 2012
1 answer
182 views

Hi,

I think I found a little (big) bug in the grids ClientTemplate. I use JavaScript-Code in a ClientTemplate. The problem is, that the + sign doesn't work.

Here is what I tried:

.ClientTemplate("<ul>#for(var i = 0; i < myObj.length; i++){#<li>#=myObj[i].Name#</li>#}#</ul>");

I simplified the template a little bit. The fact is, that the i++ in my for-loop doesn't work. It gets to be an endless loop. If I set a debugger in there, I can only see for(var i = 0; i < myObj.length; i ) --> The + signs are missing! And it doesn't matter where I use the +. It isn't displayed when I debugg the code.

I hope you understand what I mean!

My current workaround is to use -(-1) .............. #for(var i = 0; i < myObj.length; i = i-(-1)){#

Brian Roth
Top achievements
Rank 1
 answered on 25 Sep 2012
0 answers
121 views
Hi,

I've noticed from using Kendo MVC wrappers that the initialisation scripts are injected directly into the DOM after the control being rendered.

How can these be rendered in a specific location (eg: at the end of the body)?

Also, is there any way to pre-process these at build time so that we can take advantage of minification?

Thanks,
Chris
Chris
Top achievements
Rank 1
 asked on 25 Sep 2012
0 answers
168 views
Hello I have a grid that isnt paging correctly.  When I click on page x it just sits there.

Here is my code.

layout.cshtml
----------------------
<!DOCTYPE html>
<html lang="en">
    <head>
        <meta charset="utf-8" />
        <title>@ViewBag.Title - My ASP.NET MVC Application</title>
        <link href="~/favicon.ico" rel="shortcut icon" type="image/x-icon" />
        <meta name="viewport" content="width=device-width" />
        @Styles.Render("~/Content/Site.css")




         @Styles.Render("~/Content/kendo/2012.2.710/kendo.common.min.css")
         @Styles.Render("~/Content/kendo/2012.2.710/kendo.default.min.css")


        @Scripts.Render("~/Scripts/jquery-1.7.1.min.js")
         @Scripts.Render("~/Scripts/kendo/2012.2.710/kendo.web.min.js")
            @Scripts.Render("~/Scripts/kendo/kendo.aspnetmvc.min.js")


    </head>
    <body>
          <h2>Benchmarks</h2>
        <header>
             <div id="logindisplay">
                    Hello, @User.Identity.Name!
            </div>
             <nav>
                    <ul id="menu">
                        <li>@Html.ActionLink("Home", "Index", "Home")</li>
                    </ul>
                </nav>
        </header>
        <div id="body">


            <section class="content-wrapper main-content clear-fix">
                @RenderBody()
            </section>
        </div>
            
    </body>
</html>
----------------------
index.cshtml
---------------------

@model IEnumerable<Benchmarks.Models.Benchmark>


<script src="~/Scripts/kendo/2012.2.710/kendo.pager.min.js"></script>






@(Html.Kendo().Grid(Model)            //The grid will be bound to the Model which is the Products table
      .Name("productGrid") //The name of the grid is mandatory. It specifies the "id" attribute of the widget.
      .Columns(columns =>
      {
          columns.Bound(p => p.HydrantNumber);
          columns.Bound(p => p.Street1);
          columns.Bound(p => p.Street2);
          columns.Bound(p => p.Location); 
          columns.Bound(p => p.Quadrant);
          columns.Bound(p => p.Description);
          columns.Bound(p => p.Elevation);
          columns.Bound(p => p.OrderNumber);
          columns.Bound(p => p.RevisionMonth);
          columns.Bound(p => p.RevisionYear);
          columns.Bound(p => p.Remark);
          columns.Command(command => { command.Edit(); command.Destroy(); }).Width(200);


          
          
      })
     .ToolBar(toolbar => toolbar.Create())
    .Editable(editable => editable.Mode(GridEditMode.InLine))
    .Pageable(pageable => pageable.PageSizes(true).PageSizes(new int[] {15,20,25}))
    .Sortable()
    .Scrollable()
    .DataSource(dataSource => dataSource        
        .Ajax()                 
        .Events(events => events.Error("error_handler"))
        .Model(model => model.Id(p => p.Id))
        .Create(update => update.Action("EditingInline_Create", "Grid"))
        .Read(read => read.Action("EditingInline_Read", "Grid"))
        .Update(update => update.Action("EditingInline_Update", "Grid"))
        .Destroy(update => update.Action("EditingInline_Destroy", "Grid"))
        
    )

Im using visual studio 2012,.net 4.0 and entity framework 4.3.1
Steve
Top achievements
Rank 1
 asked on 25 Sep 2012
0 answers
138 views
Hi!
I can't load information in json format in my KendoGrid... 
URL : http://dotnet.habitatpro-com.local/test.json
CODE:

<html>
<head>
    <title></title>
    <script type="text/javascript" src="Scripts/jquery-1.7.1.js"></script>
    <script type="text/javascript" src="Scripts/kendo.all.js"></script>

</head>
<body>
            <div id="example" class="k-content">
            <div id="grid"></div>

            <script type="text/javascript">
                $(document).ready(function () {
                    var crudServiceBaseUrl = "http://dotnet.habitatpro-com.local/test.json",
                        dataSource = new kendo.data.DataSource({
                            transport: {
                                read: {
                                    url: crudServiceBaseUrl,
                                    dataType: "jsonp"
                                },
                                parameterMap: function (options, operation) {
                                    if (operation !== "read" && options.models) {
                                        return { models: kendo.stringify(options.models) };
                                    }
                                }
                            },
                            batch: true,
                            pageSize: 30,
                            schema: {
                                model: {
                                    id: "ProductID",
                                    fields: {
                                        ProductID: { editable: false, nullable: true },
                                        ProductName: { validation: { required: true} },
                                        UnitPrice: { type: "number", validation: { required: true, min: 1} },
                                        Discontinued: { type: "boolean" },
                                        UnitsInStock: { type: "number", validation: { min: 0, required: true} }
                                    }
                                }
                            }
                        });

                    $("#grid").kendoGrid({
                        dataSource: dataSource,
                        pageable: true,
                        height: 400,
                        toolbar: ["create"],
                        columns: [
                            { field: "ProductName", title: "Product Name" },
                            { field: "UnitPrice", title: "Unit Price", format: "{0:c}", width: "150px" },
                            { field: "UnitsInStock", title: "Units In Stock", width: "150px" },
                            { field: "Discontinued", width: "100px" },
                            { command: ["edit", "destroy"], title: "&nbsp;", width: "210px"}],
                        editable: "popup"
                    });
                });
            </script>
        </div>


</body>
</html>





Do you have any suggestions ?

Thanks
totoro
Top achievements
Rank 1
 asked on 25 Sep 2012
2 answers
211 views

I am working with the good example of Editing custom editor under the MVC examples.
It shows how to build a dropdownlist for use when editing a cell in a grid.
I have to create a new post in the grid and I add the following to the file; Editing_Custom.cshtml:

.Create(create => create.Action("EditingCustom_Create", "Grid"))
.ToolBar(toolBar => { toolBar.Save(); toolBar.Create(); })

And I already get an error here before I come to do the coding in the .cs-file.
When debugging with firebug, I get an error from javascript that says: ReferenceError: EnrollTypes is not defined.
EnrollTypes is the class that is used for making the dropdownlist.
Could someone please give me a hint on what I have to do when creating a post in a grid with relational data?

I saw in some forum that Foregin key will sove this problem, but in my case there is no key column which can be named as foreign key. I just want to have a dropdown in grid column and it should also appear when I click on Add New Item button.  

Regards,
Nandan

Petur Subev
Telerik team
 answered on 25 Sep 2012
0 answers
137 views
I have the following:

@(Html.Kendo().ListView<CourseServiceModel.CourseSearchResult>(Model)
        .Name("CourseListView")
        .TagName("div")
        .ClientTemplateId("template")
        .DataSource(dataSource =>
        {
        dataSource.Read(read => read.Action("GetSearchedCourses", "SearchCourse").Data("getSortBy"));
        dataSource.PageSize(10);
    })
        .Pageable(x => x.PageSizes(true).Refresh(true).Info(true).PageSizes(new int[]{10,25,50}))
      )

On the first time the page loads, the datasource is read as expected. On subsequent post the datasource does not get read, no ajax calls.

Works fine in FF and Chrome only an issue in IE (8,9).

Sounds like a caching issue but not sure where to start....

The page navigation is <page to set search criteria> -> RedirectToRoute("Results") -> <Results (contains ListView)> 

This was posted in the UI forum by mistake.

<RESOLVED>

the issue was IE caching ajax responses.  I tried to add in the headers to not cache etc.that did not work, so had to use a "cache buster" time stamp in the post back data in the getSortBy json object.  Maybe this will help someone else.

function getSortBy() {
       return {
           sortByCritera: $("#SortBy").data("kendoDropDownList").dataItem(),
           timeStamp: Date()
       };
   }
Dave
Top achievements
Rank 1
 asked on 25 Sep 2012
2 answers
561 views
Telerik had an attribute for the rad_grids called AllowFilteringByColumn="true" which allowed us to filter the records by criteria entered in the textboxes or datepickers at the top of the grid.

Does Kendo do this and is there an example?

All I found in documentation is adding Filterable to the columns which takes true or false. Nothing else and it doesn't do anything.

The other was setting the grid to Filterable which takes no arguments and does nothing so I have no idea...

Thanks for your help...

Paul

PAUL
Top achievements
Rank 1
 answered on 24 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?