Telerik Forums
UI for ASP.NET MVC Forum
4 answers
616 views

Hi,

 

in a DDL I display entries of the following type:

public class ConfigEntryLine {
        public long ItemID { get; set; }
        public string ItemText { get; set; }
 
        [DisplayFormat(DataFormatString = "{0:c}")]
        public double ItemPrice { get; set; }

In the dropdown I want to display the"ItemPrice" on the right side formatted like given in the attribute on the model.

I use the DDL like in a editfor like this:

...
else {
    @(Html.Kendo().DropDownListFor(m => m.SelectedID)
                .DataTextField("ItemText")
                .DataValueField("ItemID")
                .AutoBind(true)
                .HtmlAttributes(new { style = "width:280px;font-size:small" })
                .ValuePrimitive(true)
                .BindTo(Model.Lines)
                 .Template("<span class=\"k-state-default\">#: data.ItemText#</span><span class=\"k-state-default pull-right\"><strong>#: data.ItemPrice#</strong>")
                );
}

I get the value - as number without decimal places and currency sign.

Is it possible to use the DisplayFormat attribute in a DDL template?

Heli
Top achievements
Rank 2
 answered on 11 Sep 2017
4 answers
426 views

When I create a new appointment on the calendar, the default end time is 30 minutes after the selected start time. Is there a way to change the default end time to be 2 hours after the selected start time.

Essentially I want to change the default appointment duration from 1/2 hour to 2 hours.

Thanks

Pete
Top achievements
Rank 1
 answered on 08 Sep 2017
1 answer
67 views

I am creating a one of my first MVC applications with Telerik. It seems on textboxes that are numbers it formats them using bootstrap formatting but if it is a numeric field that is a numeric it uses a k-textbox. So my forum looks really off. I am not sure how to make one overrule the other. I'm sure this has to be a common problem.

 

Thanks for the guidance in advanced. 

Preslav
Telerik team
 answered on 08 Sep 2017
3 answers
553 views

Hi Tlerik Team,

 

I'm trying to disable the animation for the Kendo MVC TabStrip and I did like 

 @{ Html.Kendo().TabStrip()     
        .Name("tabxyz")
         .Events(events => events.Select("onSelect"))
          .Animation(animation =>
          {
              animation.Enable(false);
          })

And its working as expected; But when I change the tab using the java script code, the animation is enabled again!!!!

Here is the code that I used.

  var tabstrip = $("#tabxyz").kendoTabStrip().data("kendoTabStrip");  
  var myTab = tabstrip.tabGroup.children("li").eq(selectedTab);
   tabstrip.select(myTab);

 

Please let me know what i'm doing wrong!! 

Thanks in advance.

Mahendra.

 

 

 

Ivan Danchev
Telerik team
 answered on 08 Sep 2017
4 answers
387 views

My 2 new edit fields to not get read or writen to the database.  They do however save to the model in memory and persist in the view.  All other fields save to the DB.

In my MVC Task scheduler I have created a 2 custom fields called (Completed and OnHold) both boolean.  I have created a CustomEditorTemplate.cshtml and reference it in index.cshtml. 

 .Editable(editable =>
    {
        editable.TemplateName("CustomEditorTemplate");
    })

 I have added to the DB then refreshed EF 6 successfully.  I have added both fields to all the same Controllers and Models. The same as the existing boolean field call "IsAllDay".  The only place where my fields don't exist and "IsAllDay" does is the kendo.all.min.js file.  The field "IsAllDay" is in kendo.all.min.js seven times.  If it was not a minified file I could read it.

Is that my problem?  The js file?

Thanks for looking :)

Rick Hubka
Top achievements
Rank 1
 answered on 07 Sep 2017
11 answers
164 views

Hi,

it is possible to obtain KendoUI version 2016 R3 (http://www.telerik.com/support/whats-new/kendo-ui/release-history/kendo-ui-r3-2016)?

Best regards,

Radoslav

Kathryn
Telerik team
 answered on 07 Sep 2017
1 answer
315 views

I was able to reproduce this problem in your online demo page:

https://demos.telerik.com/aspnet-mvc/scheduler

When clicked on "Save" button multiple times, duplicate calendar entries are created in database. How to prevent that?

Screenshot attached.

 

Neli
Telerik team
 answered on 07 Sep 2017
4 answers
317 views

Hello Support Team,

I implemented the scheduler in a mvc project with razor views.

Whats the recommended way to remove entries from the dropdown lists on the editing form? For example: I'd like to remove the option "Yearly" in the "Repeat" dropdownlist and some options in the "repeat on" dropdownlist (day, weekday, weekend day). 

Many thanks for your help.

Regards,

David

Alain
Top achievements
Rank 1
 answered on 07 Sep 2017
3 answers
2.3K+ views
I have a kendo grid that has 3 dates.  The user only cares about the actual date and not the time so I format the date as "MM/DD/YYYY" for what displays.  My issues is when the user clicks into on of the fields to edit, say "CollegeDeadline" they see "12:00 AM" in the date field as well as the time picker because the value stored in the database is obviously a DateTime field.  I want to remove the 12:00 AM and time picker as its useless to the user and confuses them.  I have been searching the past few days and cannot find a clear cut example of removing these items from a grid.  Is there anyway to accomplish this?

 
@(Html.Kendo().Grid(Model.Progress.PlansProgress) 
.Name("PlanProgressGrid")   
.Columns(columns => {       
    columns.Bound(p => p.CollegeName);
    columns.ForeignKey(p => p.ApplicationMilestoneType, Model.Progress.TypeCategories, "CategoryID", "CategoryName")
        .Title("Milestone Type");
    columns.Bound(p => p.ApplicationMilestone);
    columns.Bound(p => p.CollegeDeadline).Format("{0:MM/dd/yyyy}");
    columns.Bound(p => p.StudentDeadline).Format("{0:MM/dd/yyyy}");
    columns.ForeignKey(p => p.MilestoneStatus, Model.Progress.StatusCategories, "CategoryID", "CategoryName")
        .Title("Status");
    columns.Bound(p => p.StatusUpdated).Format("{0:MM/dd/yyyy}");
})
.ToolBar(toolbar =>
{
    toolbar.Save();
})
.Editable(editable => editable.Mode(GridEditMode.InCell))
.Groupable()
.Sortable()
.Scrollable()
.Reorderable(reorder => reorder.Columns(true))
.Resizable(resize => resize.Columns(true))
.DataSource(dataSource => dataSource       
    .Ajax()        
    .Batch(true)
    .ServerOperation(false)
    .Events(events => events.Error("error_handler"))
    .Model(model =>
    {
        model.Id(p => p.ID);
        model.Field(p => p.CollegeName).Editable(false);
        model.Field(p => p.ApplicationMilestoneType).Editable(false);
        model.Field(p => p.ApplicationMilestone).Editable(false);
    })
    .Update("Editing_Update", "Applications")
)
            )
Dina
Top achievements
Rank 1
 answered on 07 Sep 2017
2 answers
757 views

I have a kendo grid with some custom editors, one is a multiselect. I have a cshtml file for the editor that looks like so:

@model IEnumerable<ManageSitesInTemplateViewModel>
@(Html.Kendo().MultiSelectFor(m => m)
    .AutoClose(false)
    .DataTextField("SiteName")
    .DataValueField("SiteId")
    .BindTo((IEnumerable<ManageSitesInTemplateViewModel>)ViewData["sites"])
)

 

It uses the "bindto" which is data gotten from ViewData that is created when the page is requested. Everything works fine just as it should, no problems there. The problem is I have been trying to implement a "select/deselect all" button using various implementations to no avail. I have a suspicion that it's because I use "bindto". This is some of the examples I have tried:
https://stackoverflow.com/questions/28207667/how-can-we-implement-select-all-option-in-kendo-multiselectfor
http://docs.telerik.com/kendo-ui/controls/editors/multiselect/how-to/selection/select-deselect-all-items
http://www.telerik.com/forums/select-all-items-after-data-is-read
I can get the button to select everything correctly, but when everything is selected and I try to save the entry on the grid, the action is not fired. Nothing happens and the selection resets. Still works if I select manually.
What is going on? Full code for the custom editor:

    @model IEnumerable<ManageSitesInTemplateViewModel>
@(Html.Kendo().MultiSelectFor(m => m)
    .AutoClose(false)
    .DataTextField("SiteName")
    .DataValueField("SiteId")
    .BindTo((IEnumerable<ManageSitesInTemplateViewModel>)ViewData["sites"])
)
<button class="k-button" id="selectall123">Select All</button>
<script type="text/javascript">
    $(document).ready(function () {
        $("#selectall123").on('click', function (e) {
            e.preventDefault();
            var multiselect = $('#Sites').data("kendoMultiSelect");
 
            var all = $.map(multiselect.dataSource.data(), function (dataItem) {
                return dataItem.SiteId;
            });
            multiselect.value(all);
        });
    });
</script>

 

Gunnar
Top achievements
Rank 1
 answered on 07 Sep 2017
Narrow your results
Selected tags
Tags
Grid
General Discussions
Scheduler
DropDownList
Chart
Editor
TreeView
DatePicker
Upload
ComboBox
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
ListView (Mobile)
Pager
Accessibility
ColorPicker
DateRangePicker
Wizard
Security
Styling
Chat
MediaPlayer
TileLayout
DateInput
Drawer
SplitView
Barcode
ButtonGroup (Mobile)
Drawer (Mobile)
ImageEditor
RadioGroup
Sparkline
Stepper
TabStrip (Mobile)
GridLayout
Template
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
+? more
Top users last month
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Sergii
Top achievements
Rank 1
Iron
Iron
Dedalus
Top achievements
Rank 1
Iron
Iron
Lan
Top achievements
Rank 1
Iron
Doug
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Top users last month
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Sergii
Top achievements
Rank 1
Iron
Iron
Dedalus
Top achievements
Rank 1
Iron
Iron
Lan
Top achievements
Rank 1
Iron
Doug
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?