Telerik Forums
UI for ASP.NET MVC Forum
4 answers
489 views
Hi,

I wanted to achieve required filed validation on Drop Down list.Currently I am getting a pop up saying as required but unfortunately I couldn't get any red border around it, For rest of the controls on the page i get the red border. I tried below code but still i dont get any red border around drop down.

  $(document).ready(function () {
        /* Bind Mutation Events */
        var elements = $("#AddUserForm").find("[data-role=combobox],[data-role=dropdownlist],[data-role=numerictextbox],[data-role^=date]");

        //correct mutation event detection
        var hasMutationEvents = ("MutationEvent" in window),
            MutationObserver = window.WebKitMutationObserver || window.MutationObserver;

        if (MutationObserver) {
            var observer = new MutationObserver(function (mutations) {
                var idx = 0,
                    mutation,
                    length = mutations.length;

                for (; idx < length; idx++) {
                    mutation = mutations[idx];
                    if (mutation.attributeName === "class") {
                        updateCssOnPropertyChange(mutation);
                    }
                }
            }),
            config = { attributes: true, childList: false, characterData: false };

            elements.each(function () {
                observer.observe(this, config);
            });
        } else if (hasMutationEvents) {
            elements.bind("DOMAttrModified", updateCssOnPropertyChange);
        } else {
            elements.each(function () {
                this.attachEvent("onpropertychange", updateCssOnPropertyChange);
            });
        }
});

  function updateCssOnPropertyChange(e) {
        var element = $(e.target);

        element.siblings("span.k-dropdown-wrap")
               .add(element.parent("span.k-numeric-wrap"))
               .add(element.parent("span.k-picker-wrap"))
               .toggleClass("k-invalid", element.hasClass("input-validation-error"));
    }

<style>
  .k-widget > span.k-invalid,
    input.k-invalid {
        border-color: red;
    }

    #innerList li {
        margin: 10px 10px;
    }
</style>

Can you please let me know how can I get a red border around required drop down list when form is submiited.
Marvin
Top achievements
Rank 1
 answered on 08 Jan 2018
1 answer
148 views

When needing to add a "Form Number" to my grids to satisfy ISO requirements for forms, I didn't want to sacrifice any vertical screen space.  I added the text to the existing paging footer at the bottom left corner, where it normally appears on our paper forms.  

I added the following line to my  $(document).ready(function () ...

$("#grid").getKendoGrid().pager.element.prepend("<div class='docver'>EFORM: PTZ-0021 Rev: A</div>");

and then the css to keep that div in line with the paging buttons...

    .docver {
        float: left;
        display: inline-block;
        font-weight: normal ;
        font-size: 12px;
    }

 

Darron

Stefan
Telerik team
 answered on 08 Jan 2018
3 answers
866 views

After updating my project I get several errors about kendo-ui.d.ts

Typescript version 2.5

 

e.g.

SeverityCodeDescriptionProjectFileLineSuppression State
ErrorTS2430(TS) Interface 'DataSourceTransportWithFunctionOperations' incorrectly extends interface 'DataSourceTransport'.
  Types of property 'create' are incompatible.
    Type '(options: DataSourceTransportOptions) => void' has no properties in common with type 'DataSourceTransportCreate'.ExternC:\Users\Maurice.Lucas\Source\Repos\Juice\JuiceSolution\Extern\Scripts\typings\kendo-ui\kendo-ui.d.ts1196Active

SeverityCodeDescriptionProjectFileLineSuppression State
ErrorTS2559(TS) Type 'AgendaView' has no properties in common with type 'SchedulerView'.ExternC:\Users\Maurice.Lucas\Source\Repos\Juice\JuiceSolution\Extern\Scripts\typings\kendo-ui\kendo-ui.d.ts1542Active

SeverityCodeDescriptionProjectFileLineSuppression State
ErrorTS2415(TS) Class 'Alert' incorrectly extends base class 'Dialog'.
  Types of property 'options' are incompatible.
    Type 'AlertOptions' is not assignable to type 'DialogOptions'.
      Types of property 'messages' are incompatible.
        Type 'AlertMessages' has no properties in common with type 'DialogMessages'.ExternC:\Users\Maurice.Lucas\Source\Repos\Juice\JuiceSolution\Extern\Scripts\typings\kendo-ui\kendo-ui.d.ts1551Active

 

Ianko
Telerik team
 answered on 08 Jan 2018
1 answer
325 views

i'm facing an issue related to TIME in gantt chart. 

the problem is if i'm having time at server side    Start -> 1:00:00 and End -> 3:00:00 then in the browser in date field the time is showing like 1:00:00 is being shown as 6:00 and 3:00:00 is being shown as  8:00 . But when i save this task then at server side same time 1:00 and 3:00 is posted which is being done by onUpdateCreate() event method. i want to show same time which is at the server at the client side. how can i do that ?

 

 

Veselin Tsvetanov
Telerik team
 answered on 05 Jan 2018
5 answers
444 views

Hello,

I would like to see the full example of Kendo Diagram for Asp.Net MVC. Especially I would like to know what is hidden behind the code in the default example You offer on website (http://demos.telerik.com/aspnet-mvc/diagram/index):

public ActionResult _OrgChart()

{

return Json(DiagramDataRepository.OrgChart(), JsonRequestBehavior.AllowGet);

}

Can You show me, what's in DiagramDataRepository.OrgChart() method, please? Or tell me, where I can find it?

Thank You!

Stefan
Telerik team
 answered on 05 Jan 2018
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
131 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
909 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
267 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
181 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
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
DropDownButton
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
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
Tien
Top achievements
Rank 1
Iron
Krasimir
Top achievements
Rank 3
Bronze
Iron
Iron
Cedar
Top achievements
Rank 1
Iron
Emil
Top achievements
Rank 1
Iron
Kyle Watson
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Tien
Top achievements
Rank 1
Iron
Krasimir
Top achievements
Rank 3
Bronze
Iron
Iron
Cedar
Top achievements
Rank 1
Iron
Emil
Top achievements
Rank 1
Iron
Kyle Watson
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?