Telerik Forums
UI for ASP.NET MVC Forum
2 answers
254 views
As per the title, is it possible to have the title field populated via a DropDown in the popup editor rather than a text field?

I'm using razor to generate the scheduler.

Thanks.
Sean
Top achievements
Rank 1
 answered on 23 Sep 2013
1 answer
104 views
I had a project with a cultures folder in the javascript directory, did the latest upgrade (918?) and the cultures folder disappeared.

I need the cultures folder for the Australia based date stuff.

I noticed this with other release, just couldn't be bothered to make a post about it.

Thanks
Missing User
 answered on 20 Sep 2013
1 answer
210 views
Hello,

Is it possible to have the panelbar nesting be recursive?   Let's say we are binding to a list of objects inside the model like this:
public class Activity
   {
       public string ActivityId { get; set; }
       public string Description { get; set; }
       public List<Activity> Activities { get; set; }       
   }
Daniel
Telerik team
 answered on 20 Sep 2013
2 answers
386 views
I have a grid to display audits with a datetime field.

I want to have a separate datetimepicker to the grid that i can use to filter the grid results.

I am struggling to get the value of the datetimepicker in the correct format for C# when the request gets posted back.

I receive 'String was not recognized as a valid DateTime'.

The format of the date is en-gb so DD/MM/YYYY HH:mm

If I manually make the format US ie MM/DD/YYYY etc then this works, but we are english and want the format of the datetimepicker to be in en-gb.

How can i get this to work. I really need the time as well as the date.

Here is my grid

@(Html.Kendo().Grid(Model)

    .Name("Grid")
    .Columns(columns =>
        {
            columns.Bound(p => p.AuditCode);
            columns.Bound(p => p.AuditId).Width(60);
            columns.Bound(p => p.AuditText1).Width(200);
            columns.Bound(p => p.AuditText2);
            columns.Bound(p => p.AuditText3);
            columns.Bound(p => p.AuditValue1);
            columns.Bound(p => p.AuditValue2);
            columns.Bound(p => p.DateTime);
        })

     .Pageable(p => p.PageSizes(true))
     .Sortable()
          .Scrollable()
     .HtmlAttributes(new { style = "height:355px;" })
     .Resizable(resize => resize.Columns(true))
     .DataSource(dataSource => dataSource
         .Ajax()
         .PageSize(20)
         .Read(read => read.Action("Audit_Read", "Support"))

     )
)

Here is my date picker

<td>@(Html.Kendo().DateTimePicker().Name("datetimepicker"))</td>

This is the script for searching the grid

<script>
    $(document).ready(function () {
        $("#GO").click(function () {
            $filter = new Array();

            $fromDateTime = $("#datetimepicker").val();

            $toDateTime = $("#datetimepicker2").val();

            dateFromFilter = $fromDateTime; 
            dateToFilter = $toDateTime; 

            if (dateFromFilter) { $filter.push({ field: "DateTime", operator: "isgreaterthanorequalto", value: dateFromFilter }); }
            if (dateToFilter) { $filter.push({ field: "DateTime", operator: "islessthanorequalto", value: dateToFilter }); }

            var grid = $("#Grid").data("kendoGrid");

            grid.dataSource.filter($filter);
        });
    });

</script>
Zac Everett
Top achievements
Rank 1
 answered on 20 Sep 2013
1 answer
591 views
Hi,

I use Kendo UI ASP.NET MVC with VB.NET. My question is:
How I can define the width for the @Html.EditorFor() width css?


SampleView.vbhtml
        <td class="editor-field">
            @Html.EditorFor(Function(model) model.Tel1)        
            @Html.ValidationMessageFor(Function(model) model.Tel1)
        </td>

I tried to define a css style like this:


Site.css

#small-editfor
{
width:30px;
border-bottom-left-radius:0px;
border-bottom-right-radius:0px;
border-top-left-radius:0px;
border-top-right-radius:0px;
}

SampleView.vbhtml
        <td class="editor-field">
            @Html.EditorFor(Function(model) model.Tel1,Nothing, "small-editfor",Nothing)
            @Html.ValidationMessageFor(Function(model) model.Tel1)
        </td>

With this solution I see the width
30px, but the value of the property Tel1 would’t be available on the server.

I tried this also without success:

SampleView.vbhtml
        <td class="editor-field">
            @Html.EditorFor(Function(model) model.Tel1 New With { .class=”small-editfor”})
            @Html.ValidationMessageFor(Function(model) model.Tel1)
        </td>

        <td class="editor-field">
            @Html.EditorFor(Function(model) model.Tel1 New With { .style=”width:30px”})  
            @Html.ValidationMessageFor(Function(model) model.Tel1)
        </td>

Does anyone have an idea?
Dimo
Telerik team
 answered on 20 Sep 2013
1 answer
281 views
Hello,

I am trying to implement a TreeView using remote binding.  My datasource Id property is actually a string not an integer - I am having trouble getting this working - can you advise where I am going wrong?    My code is below.

Thanks,
Carrie

View
@(Html.Kendo().TreeView()
     .Name("treeviewTierQueue")
     .DataTextField("Text")
     .DataSource(dataSource => dataSource
              .Read(read => read.Action("GetTierQueueList", "Enum"))
  ))
Controller
public JsonResult GetTierQueueList(string level)
{
    var items = new List<NestedSelectListItem>()
        {
            new NestedSelectListItem {Id = "0", Text = "All Analysts"},
            new NestedSelectListItem {Id = "1", Text = "All Groups"},
            new NestedSelectListItem {
                Id = "2",
                Text = "Service Desk",
                hasChildren=true,
                Items = new List<NestedSelectListItem> ()
                {
                    new NestedSelectListItem {Id = "2a", Text = "2nd Level"},
                    new NestedSelectListItem {Id = "2b", Text = "2nd Level B"},
                    new NestedSelectListItem {
                        Id = "2c",
                        Text = "2nd Level C",
                        hasChildren= true,
                        Items = new List<NestedSelectListItem> ()
                        {
                            new NestedSelectListItem {Id = "3a", Text = "3rd Level"},
                            new NestedSelectListItem {Id = "3b", Text = "3rd Level B"}
                        }
                  } } }
        };
 
    if (!String.IsNullOrEmpty(level))
    {
        var filtered = items.First(i => i.Id == level).Items;
        items = filtered;
    }
 
    return Json(items.AsEnumerable(), JsonRequestBehavior.AllowGet);
}

Carrie
Top achievements
Rank 1
 answered on 19 Sep 2013
1 answer
124 views
in IE 8,9,10 (haven't tested anything lower) the read function only gets called once even if navigate back and then reopen the page. 

My data is partners are made up of properties. so in the property edit page i have a combobox that is filled with active partners(its a bit field) i have the read saying only grab active partners to fill the combobox. the first time you enter the property edit page for property 1 it calls the read and populates the combobox with partners 1, 2, 3. Now if you navigate away from that page and mark partner 1 as not active then go back to any property edit page property 1,2,3,4,5 the combobox still shows the now inactive partner 1. in chrome this works fine and it calls read again on page load and the dropdown only has 2,3 but in ie it never calls it again unless you hit refresh on the page. and even calling datasource.read in script doesnt call the read function again.

This is an issue with ie caching things and not pulling from the server (if you open f12 developer tools in ie and select 'Cache' and then 'Always refresh from server' it works just like chrome does)  but even when i turn on server filtering it never tries to repull. i have no idea how to fix this issue. I cant tell people visiting my site that they have to go into ie options and turn off caching.
Daniel
Telerik team
 answered on 19 Sep 2013
1 answer
269 views
Hello, I am having an issue where I have not been able to associate a selected item from a DropDownList to the submitted values of an editor template from my ListView.

Partial view that renders the ListView:
@(Html.Kendo().ListView<CorrectiveActionItemModel>()
    .Name("corrective-action-items-listview")
    .TagName("div")
    .ClientTemplateId("corrective-action-item-view-template")
    .DataSource(dataSource => dataSource
        .Model(model =>
            {
                model.Id("CorrectiveActionItemID");
                model.Field(f => f.CorrectiveActionPlanID).DefaultValue(this.Model.CorrectiveActionPlanID);
                model.Field(f => f.CorrectiveActionItemType);
            })
        .PageSize(1)
        .Create(create => create.Action("Item_Create", "CorrectiveActionItem", new { this.Model.CorrectiveActionPlanID }))
        .Read(read => read.Action("Items_Read", "CorrectiveActionItem", new { this.Model.CorrectiveActionPlanID }))
        .Update(update => update.Action("Item_Update", "CorrectiveActionItem"))
        .Destroy(destroy => destroy.Action("Item_Destroy", "CorrectiveActionItem"))
    )
    .Pageable()
    .Editable())
Editor Template for CorrectiveActionItemModel:
@using Steton.Web.MVC.Model
 
@model CorrectiveActionItemModel
 
<div class="corrective-action-item-display">
    <div class="edit-buttons">
        <a class="k-button k-button-icontext k-update-button" href="\\#"><span class="k-icon k-update"></span></a>
        <a class="k-button k-button-icontext k-cancel-button" href="\\#"><span class="k-icon k-cancel"></span></a>
    </div>
     
    @Html.HiddenFor(m => m.CorrectiveActionItemID)
    @Html.HiddenFor(m => m.CorrectiveActionPlanID)
 
    <div class="action-section">
        @Html.LabelFor(m => m.DirectiveText)
        @Html.TextAreaFor(m => m.DirectiveText)
    </div>
    <div class="action-section">
        @Html.LabelFor(m => m.ActionTakenText)
        @Html.TextAreaFor(m  => m.ActionTakenText)
    </div>
    <div class="action-section">
        <div style="clear:both">
            <div class="action-sub-edit-section">
                <div>
                    @Html.LabelFor(m => m.DueDate)
                    @(Html.Kendo().DatePicker()
                          .Name("DueDate")
                          .Value("12/31/2013"))   
                </div>
                <div>
                    @Html.LabelFor(m => m.IsCompleted)
                    @Html.CheckBoxFor(m => m.IsCompleted)
                </div>
            </div>
            <div class="action-sub-edit-section">
                <div>
                    @Html.LabelFor(m => m.CorrectiveActionItemType)
                    @Html.EditorFor(m => m.CorrectiveActionItemType)
                </div>
            </div>
        </div>
    </div>
</div>
Editor template for CorrectiveActionItemType:
@using System.Collections
 
@(Html.Kendo().DropDownList()
    .Name("CorrectiveActionItemType")
    .DataTextField("TypeName")
    .DataValueField("CorrectiveActionItemTypeID")
    .DataSource(read => read.Read("Types","CorrectiveActionItem", new { correctiveActionPlanID = "#=CorrectiveActionPlanID#" })))
Now, when the CorrectiveActionItemModel is submitted I do not get any item in the POST for CorrectiveActionItemType. I suspect that there is some binding or setup that needs to occur in order to get the DropDownList's value to be associated to the model of CorrectiveActionItemModel.

I have tried following the pattern at Editor template documentation, but I could not get the .BindTo((IEnumerable)ViewData["CorrectiveActionType"])) even though I added it the controller that renders the ListView.

Any thoughts or ideas would be appreciated, thanks.

 
Daniel
Telerik team
 answered on 19 Sep 2013
1 answer
104 views
Hi

Using ajax my data source is configured as follow:

.Read(read => read.Action("Containers_Read", "ContainerAdmin"))
        .Create(update => update.Action("Containers_Create", "ContainerAdmin"))
        .Update(update => update.Action("Containers_Update", "ContainerAdmin"))
        .Destroy(update => update.Action("Containers_Delete", "ContainerAdmin"))
When my grid first loads all the related entities with data comes through from the repository just fine:

public ActionResult Containers_Read([DataSourceRequest] DataSourceRequest request)
        {  
            return Json(_repository.GetAllAssetTakeOnContainers().ToDataSourceResult(request));
        }
public List<AssetTakeOnContainer> GetAllAssetTakeOnContainers()
        {
            using (var context = new AssetTakeOnContext())
            {
                context.Configuration.LazyLoadingEnabled = false;
 
                return context.AssetTakeOnContainers.Include("TakeOns").Include("LocationLevel1").Include("LocationLevel2").Include("LocationLevel3").Include("CostCntrLevel1").Include("CostCntrLevel2").Include("CostCntrLevel3").Include("Contact").Include("RoomType").Where(c => c.IsDeleted == false).ToList();
            }
        }
But as soon as I do an update my related entities seems to be populated but all properties set to null:

[AcceptVerbs(HttpVerbs.Post)]
        public ActionResult Containers_Update([DataSourceRequest] DataSourceRequest request, AssetTakeOnContainer container)
        {
            _repository.UpdateAssetTakeOnContainer(container);
 
            return Json(ModelState.ToDataSourceResult());
        }
Please see attached file for a screenshot from VS.

Can someone please tell me why this is and what I'm doing wrong here?

Thanks
Vladimir Iliev
Telerik team
 answered on 19 Sep 2013
1 answer
139 views
Hi,

I try to download the following file "kendoui.aspnetmvc.2013.2.918.commercial.zip", the website said it is 16mb but after downloaded it only has 10mb, open the zip displayed error message. Thanks.
Sebastian
Telerik team
 answered on 19 Sep 2013
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
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
+? more
Top users last month
Top achievements
Rank 1
Iron
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
ivory
Top achievements
Rank 1
Iron
Nurik
Top achievements
Rank 2
Iron
Iron
YF
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Top achievements
Rank 1
Iron
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
ivory
Top achievements
Rank 1
Iron
Nurik
Top achievements
Rank 2
Iron
Iron
YF
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?