Telerik Forums
UI for ASP.NET MVC Forum
2 answers
3.1K+ views

I have a view displaying a collection as follows:

 

@model Portal.Models.ApplicantEmploymentHistoryVM

for (var i = 0; i < Model.ApplicantEmploymentHistories.Count; i++)
{

@Html.Kendo().RadioButtonFor(x => x.ApplicantEmploymentHistories[i].ContactSupervisor).Value(true).Label("Yes")
@Html.Kendo().RadioButtonFor(x => x.ApplicantEmploymentHistories[i].ContactSupervisor).Value(false).Label("No")

}

But the radio buttons aren't checked for the boolean values.  Will it not work with collections?

 

Dimitar
Telerik team
 answered on 04 Jan 2018
1 answer
125 views

I have scheduler working well in my app. Everything looks good when using a desktop computer. I have set my scheduler to use .Mobile(MobileMode.Auto) .Mobile(MobileMode.Auto) in order to get around the double-click issue with iPads. However, when my appointment edit template displays the formatting is all off and the background is gray instead of white, the fields are not visible.

I am attaching 2 files, one for how it looks on desktop (which is good), one how it looks on an ipad (which is not).

I get the feeling that nobody is really using the scheduler with ipads since the forum seems to not have much information on it and the mobile features on scheduler are primitive.

Anyone using it sucessfully? Are there any tricks? I would prefer to just have the desktop mode and work around the double-click issue, has anyone figured out a way to do that?

Thanks,

Pete

 

Veselin Tsvetanov
Telerik team
 answered on 02 Jan 2018
4 answers
889 views

Hello! We have a problem with your KENDO UI Menu.

We are using the version 2017.1.223 (the last) and we tried to create a new Visual Studio 2015 MVC solution and tried to insert the menu using the examples we found in the following links.

http://demos.telerik.com/kendo-ui/menu/index

http://demos.telerik.com/aspnet-mvc/menu/index

If you paste HTML5 code everything works perfectly, but if we use ASP.NET MVC code, we get the following error

Uncaught TypeError: kendo.syncReady is not a function

Can anyone help us solve the problem? (because we want use Razor Syntax for C#) 

Thanks!

I have a problem with a Kendo menu. We are using version 2017.1.223 (last) and we tried to create a new MVC solution and tried to insert a menu using the examples we found in the following link. If you paste HTML5 code everything works perfectly, but if we use ASP.NET MVC code, we get the following error. Can anyone help us solve the problem?
I have a problem with a Kendo menu. We are using version 2017.1.223 (last) and we tried to create a new MVC solution and tried to insert a menu using the examples we found in the following link. If you paste HTML5 code everything works perfectly, but if we use ASP.NET MVC code, we get the following error. Can anyone help us solve the problem?
I have a problem with a Kendo menu. We are using version 2017.1.223 (last) and we tried to create a new MVC solution and tried to insert a menu using the examples we found in the following link. If you paste HTML5 code everything works perfectly, but if we use ASP.NET MVC code, we get the following error. Can anyone help us solve the problem?
Veselin Tsvetanov
Telerik team
 answered on 02 Jan 2018
3 answers
254 views

I am trying to migrate from HighCharts. One thing it does it auto select the proper amount of labels for the space. See attached. Is there a dynamic way to do something similar. I really like how it breaks date and then time. Where are using heavy one minute data and need to be able to dynamically create the labels.

I see the skip and I see the steps but I really need to be able to have it dynamic.

Konstantin Dikov
Telerik team
 answered on 01 Jan 2018
1 answer
172 views

Hi,

I have a property stakeHolder he is an object type of Developer.

In my grid I want to add a product but the field stakeHolder is editable(false) and i put on it the name I want hard coded.

The problem is if I use stakeHolder.Name then sorting and filtering work good but when i trying to add row then an error occurred " StakeHolder is not defined"

and when I use stakeHolder then everything is working great except for sorting and filtering (as I know filtering/sorting don't work on object)

what can I do?

namespace TaskManagementUI.Models
{
    public class Developer
    {
        public int? ID { get; set; }
        [Required(ErrorMessage = "Please enter a name")]
        [Display(Name = "Name")]
        public string Name { get; set; }
    }

@(Html.Kendo().Grid<TaskManagementUI.Models.ProductViewModel>()
          .Name("GridProducts")
          .Columns(columns =>
          {
              columns.Bound(c => c.ID).Hidden();
              columns.Bound(c => c.Name).Title("Name").Width(200);
              columns.Bound(c => c.CreateDate).Title("Creation date").Format("{0: MM/dd/yyyy}").Width(200);
              columns.Bound(c=>c.StakeHolder.Name).Title("Creator").Width(200);
              columns.Bound(c => c.Description).Title("Description").Width(250);
              columns.Command(command => command.Custom("ADDPROJECT").Text("Add Project").Click("addProject")).Title("Add Project").Width(170).HtmlAttributes(new { id = "addProjectButton" });
              columns.Command(command => { command.Edit().UpdateText("SAVE"); command.Destroy(); }).Width(250);

          })

            .Resizable(resize => resize.Columns(true))
            .Filterable()
           .ToolBar(toolbar =>
           {
               toolbar.Excel();
               toolbar.Create().Text("Add New Product");
           })
            .Editable(editable => editable.Mode(GridEditMode.InLine).TemplateName(""))
           .Excel(excel => excel
                          .AllPages(true)
                          .FileName("Products.xlsx")
                          .Filterable(true)
                          .ForceProxy(true)
                          .ProxyURL(Url.Action("FileExportSave", "Home")))
          .Pageable(pager => pager
                            .Refresh(true)
                            .PageSizes(true)
                            .PageSizes(new int[] { 6, 15, 20 })
                            .ButtonCount(5))
          .Sortable(sortable =>
          {
              sortable.SortMode(GridSortMode.MultipleColumn)
              .Enabled(true);
          })
          .Scrollable()
          .Events(e=>e.Edit("onProductEdit").Save("onProductSave").Cancel("onProductCancel").DataBound("onDataBoundSavedProducts"))
          .DataSource(dataSource => dataSource
                                   .Ajax()
                                   .PageSize(20)
                                   .Events(events => events.Error("errorHandlerProduct"))
                                  .Model(model =>
                                  {
                                      model.Id(item => item.ID);
                                      model.Field(a => a.StakeHolder.Name).DefaultValue(new Developer {ID=52,Name="Uriel Ash"}).Editable(false);
                                      model.Field(a => a.CreateDate).Editable(false);
                                  })
                                   .Read(read => read.Action("GetSavedProducts", "Product"))
                                   .Update(update => update.Action("UpdateProduct", "Product"))
                                   .Destroy(update => update.Action("DeleteProduct", "Product"))
                                   .Create(update => update.Action("CreateProduct", "Product"))))


Alex Hajigeorgieva
Telerik team
 answered on 26 Dec 2017
1 answer
160 views
How do you autosize the map so it takes up the full 100% of the div and will resize auto.
Preslav
Telerik team
 answered on 26 Dec 2017
1 answer
297 views

I am trying to use popup editing with a grid that uses <dynamic> so that I can pass in any model and re-use it.I was able to reproduce my issue by editing the "editing_popup.cshtml" file in the "Kendo.MvcExamples" solution.

 

Notice that I explicitly told the template "ProductViewModel" to be used. Initally it wasn't using that template, until I moved it into Views\Shared\EditorTemplates. But once I did I got the same error I get from my own project:

 

Inner Exception: System.InvalidOperationException: The model item passed into the dictionary is of type 'System.Object', but this dictionary requires a model item of type 'Kendo.Mvc.Examples.Models.ProductViewModel'.

 

I understand WHY, I'm getting this error; the grid basically treats dynamic as an object and that is what is being sent to the viewmodel's template ("ProductViewModel.cshtml"). My question, is is there someway I can get around it, even if I have to pass in a "Type" object.

 

@(Html.Kendo().Grid<dynamic>()
    .Name("grid")
    .Columns(columns =>
    {
        columns.Bound("ProductName");
        //columns.Bound(p => p.ProductName);
        //columns.Bound(p => p.UnitPrice).Width(120);
        //columns.Bound(p => p.UnitsInStock).Width(120);
        //columns.Bound(p => p.Discontinued).Width(120);
        columns.Command(command => { command.Edit(); command.Destroy(); }).Width(250);
    })
    .ToolBar(toolbar => toolbar.Create())
    .Editable(editable => editable.Mode(GridEditMode.PopUp).TemplateName("ProductViewModel"))
    .Pageable()
    .Sortable()
    .Scrollable()
    .HtmlAttributes(new { style = "height:550px;" })
    .DataSource(dataSource => dataSource
        .Ajax()
        .PageSize(20)
        .Events(events => events.Error("error_handler"))
        //.Model(model => model.Id(p => p.ProductID))
        .Model(model => model.Id("ProductID"))
        .Create(update => update.Action("EditingPopup_Create", "Grid"))
        .Read(read => read.Action("EditingPopup_Read", "Grid"))
        .Update(update => update.Action("EditingPopup_Update", "Grid"))
        .Destroy(update => update.Action("EditingPopup_Destroy", "Grid"))
    )
)
<script type="text/javascript">
    function error_handler(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>
Boyan Dimitrov
Telerik team
 answered on 22 Dec 2017
5 answers
325 views

Hi, I've looked through all the similar support questions and answers regarding adding custom fields to the Scheduler Editor. I've downloaded the sample MVC projects (SchedulerCustomViewDemo) and it looks straightforward. I'm missing something basic because I cannot get a custom text field or check box to populate the Model when editing a Scheduled Event or creating a new one. I've added the fields to the database, refreshed the EF6 edmx, and added them to my ViewModel. Since these fields are not populated in the model, they don't get saved to the db on create or edit. 

For example i have a textarea field called Summary that I add to the editor by modifying the CustomEditorTemplate.html (I just copied CustomEditorTemplate.html into my project, leaving all fields as they were and adding my own):

 

<div class="k-edit-label">
    @(Html.LabelFor(model => model.Summary))
</div>
<div data-container-for="summary" class="k-edit-field">
    @(Html.TextAreaFor(model => model.Summary, new { @class = "k-textbox", data_bind = "value:summary" }))
</div>

for a checkbox I do this:

<div class="k-edit-label">
    @(Html.LabelFor(model => model.IsPublished))
</div>
<div data-container-for="isPublished" class="k-edit-field">
    <input data-bind="checked: isPublished" data-val="true" id="IsPublished" name="IsPublished" type="checkbox" />
</div>

These new fields show up fine but how do i get these bound to the model so that the call to:

public virtual JsonResult EventSchedule_Create([DataSourceRequest] DataSourceRequest request, EventScheduleViewModel evt)

 

fills the EventScheduleViewModel properly?

 

Love the way theScheduler handles the recurring events but stymied on the databinding. The fields that came in the sample project (Title, Start, End, isAllDay etc. bind properly, just not my custom ones...

 

Thanks.


Dimitar
Telerik team
 answered on 22 Dec 2017
4 answers
1.3K+ views

Hi,

The items in my drop down list are quite long - is there a way of wrapping the text in the options used within the dropdown list so that all the text can be displayed?

If so, is there also a way of indenting the "wrapped" lines (all except the first line)?

I was able to do this in chosen.js, but would I am using the telerik dropdown in this instance due to it's virtualisation capabilities.

Regards,

Sean

Dimitar
Telerik team
 answered on 21 Dec 2017
1 answer
132 views
When we were using kendoui for jquery the last menuitem always got a k-last added to it .... in migrating to razor that same functionality doesn't work 
Ivan Danchev
Telerik team
 answered on 21 Dec 2017
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
Simon
Top achievements
Rank 2
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
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?