Telerik Forums
UI for ASP.NET MVC Forum
1 answer
107 views
Hello,

I am trying to use a ListView to edit a list of generic components inside a form. Currently, I am using ASP.NET MVC standard mechanism to automatically choose a template editor using the current element type. All elements extend the same abstract class (which serves as the base model of the list) but I need to display the specific information of each subclass inside the editor.

I want to use ListView to have the possibility to add and remove elements from the list but I don't know how to make the template use the ASP.NET MVC .EditorFor mechanism.

Thanks in advance
Daniel
Telerik team
 answered on 01 Apr 2013
1 answer
353 views
Hello,

when I create a new "Kendo UI for MVC Web Application" project using Telerik Kendo UI for ASP.NET MVC VSExtensions version 2013.1.318.0 and select MVC 4 the project is created without errors. However, there is no support for bundles (as for example when I create a standard MVC4 project). The App_Start folder does not exist in the solution. 

Is this normal behaviour? 

Thanks in advance,

Lefteris 
Vesko
Telerik team
 answered on 01 Apr 2013
1 answer
1.9K+ views
We have two dropdowns, second one CascadeFrom the first, using MVC wrapper.  The second dropdown actually needs to be a MultiSelect.  MultiSelect doesn't appear to have a CascadeFrom option.  Please confirm that cascading is not possible with the new MultiSelect control.  Seems like that's something MultiSelect would support.  Any known workarounds?  Thanks.     

Here's the existing code, we're trying to make the second dropdown a MultiSelect
@(Html.Kendo().DropDownListFor(m => m.InputModel.CampusCode).OptionLabel("--- select ---").BindTo(Model.Campuses))
 
@(Html.Kendo().DropDownListFor(m => m.InputModel.RepUserCode)
      .DataTextField("FullName")
      .DataValueField("ClientUserCode")
      .DataSource(source =>
          {
              source.Read(read => read.Url("/GetCampusUsers);
              source.ServerFiltering(true);
          })
      .OptionLabel("-- select --")
      .AutoBind(false)
      .CascadeFrom("InputModel_CampusCode")
      )
Georgi Krustev
Telerik team
 answered on 29 Mar 2013
1 answer
81 views
Hello,
 so I have a page with a autocomplete textbox. The user types in a value and depending on the selected value a tabstrip loads with multiple tabs with kendo ui grids on them. 4 seperate tabs. A parent child relationship exists to the tabbed data. I have this working correctly.The behavior I'd like to implement would be if no data exists for one of the tabs (child data), the grid view on that tab does not show but a label or text telling the user that no data exists for this client. Is this behavior possible ? If so how could I implement it?

Thanks
Daniel
Telerik team
 answered on 29 Mar 2013
1 answer
170 views
I have a grid that is working well, except that I am unable to create or update a row that contains a date.

On the back-end, my model class looks like this:
public class Model
{
    public Model() {
        this.CreateDate = DateTime.UtcNow;
    }
 
    // Other properties
    public DateTime CreateDate { get; private set; }
}

In my MVC cshtml file I have:

// Other setup...
.DataSource(ds =>
        ds.Ajax()
        .Model(model =>
            {
                model.Id(o => o.Id);
                model.Field(m => m.CreateDate).Editable(false);
            })
// more...

I would think that with this code that the data source would not try to pass the CreateDate field at all to the server, since it is read only. This appears not to be the case and it passes something that MVC doesn't understand such as "Wed Mar 27 2013 16:41:40 GMT-0400 (Eastern Daylight Time)." How do I prevent it from sending this value?
Daniel
Telerik team
 answered on 29 Mar 2013
1 answer
163 views
Hi,
I don't know if I'm doing something wrong but I have a page with a grid that is populated with IQueryable<Grant> data initially using BindTo and are ajax bound with aggregates.  When the page loads, the aggregate total (sum) shows 0.  As soon as I sort or page the aggregates are populated so I'm not sure what's going on. 

My grid is as follows:

@(Html.Kendo().Grid<Grant>()
           .Name("gd-gt")
           .BindTo(Model.Grants)
           .Columns(c =>
           {
               c.Bound(g => g.GrantDate).Width(90).Format("{0:MM/dd/yyyy}").HtmlAttributes(new { style = "text-align:center;" });
               c.Bound(g => g.ResultText).Title("Special Result").Sortable(false);
               c.Bound(g => g.Amount).Format("{0:C2}").Width(80).HtmlAttributes(new { style = "text-align:right;" })
                           .ClientFooterTemplate("#=kendo.toString(sum, 'C2')#").FooterHtmlAttributes(new { style = "text-align:right;" });
           })
           .Pageable()
           .Sortable(s => s.AllowUnsort(false))
           .DataSource(ds => ds
               .Ajax()
               .ServerOperation(true)
               .PageSize(5)
               .Aggregates(aggregates =>
               {
                   aggregates.Add(g => g.Amount).Sum();
               })
 
               .Model(model =>
               {
                   model.Id(m => m.GrantId);
               })
               .Read(read => read.Action("LoadGrants", "Home", new { caseId = caseId }))
               .Sort(s => { s.Add(g => g.GrantDate).Descending(); })
               ))
         )
Any suggestions?

Thank you.
David A.
Petur Subev
Telerik team
 answered on 29 Mar 2013
1 answer
140 views
Data Source has:

    serverFiltering: true,

Grid has:

           filterable: true,
 
When the Filter is selected from the columnMenu, nothing goes across the wire per Fiddler and the C# breakpoint is not hit.  (Sorting server-side on this grid works fine, HttpGet breakpoint in the Controller is hit for every change.)  

And fyi the filter doesn't seem to work at all in Chrome, it won't accept a text value to search.

For the browsers where it works, do I have to do something else to enable the grid to Filter on the server?
Vladimir Iliev
Telerik team
 answered on 29 Mar 2013
4 answers
250 views
I'm using trial version of Kendo UI Complete for ASP.NET MVC to test some features of the mobile component.
I'm trying to build a mobile app to test some features, but I'm having some problems to understand some concepts.

              1. The initialization of the app:
var app = new kendo.mobile.Application();
Should be done just once, to be able to use the navigation capabilities of the kendo framework, am I right? Using the MVC pattern of ASP.NET MVC, where is the best place to put this piece of code? There is some best practice/suggestion to place the initialization?

                  2. This question is related with the first one. In the "Create" view, I have the following code:
@model MiniSIGEMobile.Models.Student
@using (Html.BeginForm()) {
    @Html.AntiForgeryToken()
    @Html.ValidationSummary(true)
  
    <ul data-role="listview" data-inset="true">
           
         <li data-role="fieldcontain">
            @Html.LabelFor(model => model.Person.FirstName)
            @Html.EditorFor(model => model.Person.FirstName)
            @Html.ValidationMessageFor(model => model.Person.FirstName)
        </li>
        <li data-role="fieldcontain">
            @Html.LabelFor(model => model.Person.Age)
            @Html.EditorFor(model => model.Person.Age)
            @Html.ValidationMessageFor(model => model.Person.Age)
        </li>
        <li data-role="fieldcontain">
            @Html.LabelFor(model => model.Course)
            @Html.EditorFor(model => model.Course)
            @Html.ValidationMessageFor(model => model.Course)
        </li>
        <li data-role="fieldcontain">
            <input type="submit" value="Create" />
        </li>
    </ul>
}
And the "Create" action in the controller is like this:
// POST: /Student/Create
[HttpPost]
[ValidateAntiForgeryToken]
public ActionResult Create(Student student)
{
    if (ModelState.IsValid)
    {
        db.Students.Add(student);
        db.SaveChanges();
        return RedirectToAction("Index");
    }
    return View(student);
}
So when I click the "Create" button, the information is stored in the database, but the RedirectToAction("Index") is forcing the rebuild of all HTML, so the mobile app is no more initialized, without the mobile styles (because I'm initializing just once in another controller action).
How should I solve this?

           3. Finally, I would Like to know how can I change the style of the "Create" input to be like a kendoMobileButton? 

 Any kind of suggestion or guidance will be very appreciated!
Alexander Valchev
Telerik team
 answered on 29 Mar 2013
1 answer
184 views

I'm using the Kendo UI Web controls with ASP.NET MVC 3 on .NET Framework 4.0.  We've been developing a new application that uses Kendo controls extensively.    Grids with custom toolbars, command buttons, ~20 columns, and editor templates are used heavily.    

I've been running the application side by side on IE 8 and Chrome.  The performance on Chrome is significantly better (~5X better).  It's most notable with the Kendo Grids.  On IE8 there seems be a notable lag between loading the data and then displaying the data on grids.  Same for going in and out of edit mode.  It's not taking CPU processing time during this lag.  It takes a few seconds to refresh the grid once the data is loaded.  In Chrome it's pretty must instantaneous. 

Unfortunately IE 8/9 are our official browsers.  Any tips to improve performance?  Our users won't accept the performance as it currently sits.  

Dimo
Telerik team
 answered on 29 Mar 2013
1 answer
908 views
Hello,

I'm experiencing a problem where the multislect submits the value of one item only even if more than one item is selected. Shouldn't it submit all the values delimited by a comma?

Here is my code:

View:
@using (Html.BeginForm("Send", "MultiSelect", FormMethod.Post, new { enctype = "multipart/form-data" }))
{
<div class="demo-section">
    <h3 class="title">Select Continents</h3>
    @(Html.Kendo().MultiSelect()
            .Name("multiselect")
            .DataTextField("Text")
            .DataValueField("Value")
            .BindTo(continents)
            .Events(e =>
            {
                e.Change("change").Select("select").Open("open").Close("close").DataBound("dataBound");
            })
    )
</div>
    <input id="sendButton" type="submit" value="   Send   " />
}
Contoller:

public partial class MultiSelectController : Controller
    {
        public ActionResult Events()
        {
            return View();
        }
 
        public ActionResult Send(string multiselect)
        {
            //the string parameter multiselect has only one value even if more than one                      //value is selected
            return View();
        }
    }
Is there something wrong I am doing??
kabbas
Top achievements
Rank 1
 answered on 29 Mar 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
MultiColumnComboBox
Dialog
DropDownTree
Checkbox
Slider
Switch
Notification
Accessibility
ListView (Mobile)
Pager
ColorPicker
DateRangePicker
Security
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
SegmentedControl
+? more
Top users last month
Boardy
Top achievements
Rank 2
Veteran
Iron
Benjamin
Top achievements
Rank 3
Bronze
Iron
Veteran
ivory
Top achievements
Rank 1
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
ClausDC
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Boardy
Top achievements
Rank 2
Veteran
Iron
Benjamin
Top achievements
Rank 3
Bronze
Iron
Veteran
ivory
Top achievements
Rank 1
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
ClausDC
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?