Telerik Forums
UI for ASP.NET MVC Forum
6 answers
373 views
I have a Kendo scheduler template and on the template I want to give the user a multiple check box selection of work group data to choose from. I want to be able to bind the choices of work group data from a property on my model (ScheduleDataSource) which is the following: List<string> AllWorkgroups {get; set;}I then want the choice from the user to be saved in List<String> UserWorkgroups {get; set;} on the same model.Can someone please help with how to do this. Please note I am doing this in MVC ASPX. My current code is below:

<%=Html.Kendo().Scheduler<ASML_Scheduler.Models.ScheduleDataSource>()
.Name("scheduler")
.Date(DateTime.Now)
.StartTime(new DateTime(DateTime.Now.Year, DateTime.Now.Month, DateTime.Now.Day, 7, 00, 00))
.Height(400)
.Editable(editable=>editable.TemplateId("editor"))

.DateHeaderTemplate("<p class='HeaderTemplate'>#=kendo.toString(date, 'ddd dd MMM')#</p>")
.MajorTimeHeaderTemplate("<p class='HeaderTemplate'>#=kendo.toString(date, 'H:mm' )#</p>")
.EventTemplateId("event-template")
.Views(views =>
{
views.DayView();
views.WeekView(weekView =>
{
weekView.Selected(true);
weekView.WorkDayCommand(false);
weekView.AllDaySlot(false);
});

views.MonthView();
})

.CurrentTimeMarker(true)
.Timezone("Etc/UTC")
.DataSource(d => d
.Model(m =>
{
m.Id(f => f.ScheduleId);
m.Field(f => f.Description).DefaultValue("No title");
m.Field(f => f.UserId).DefaultValue(1);
m.Field(f => f.End).DefaultValue(DateTime.Now);
m.Field(f => f.Workgroups);
})

.Read("Read", "Schedule")
.Create("Create", "Schedule")
.Destroy("Destroy", "Schedule")
.Update("Update", "Schedule")
.PageSize(600)

)
.GroupHeaderTemplate("<div style='color:blue'>" +
"</div>")
.Events(events =>
{
events.Edit("scheduler_edit");
})

%>

<script id="editor" type="text/x-kendo-template">

<input name="start" type="text" required data-type="date" data-role="datetimepicker" data-bind="value: start" />
<br />
<input name="end" type="text" id="datetimepickers" required data-type="date" data-role="datetimepicker" data-bind="value: end" />

</script>

I have a Kendo scheduler template and on the template I want to give the user a multiple check box selection of work group data to choose from. I want to be able to bind the choices of work group data from a property on my model (ScheduleDataSource) which is the following: List AllWorkgroups {get; set;}

I then want the choice from the user to be saved in List UserWorkgroups {get; set;} on the same model.

Can someone please help with how to do this. Please note I am doing this in MVC ASPX. My current code is below:

Vladimir Iliev
Telerik team
 answered on 12 Mar 2015
1 answer
308 views
I have a partial view in a Window. 

@model Umki2.Areas.Fbr.Models.FbrFitUp
 
 
            @(Html.Kendo().DatePicker()
              .Name("FitUpDate")
              .Value("10/10/2011")
              .HtmlAttributes(new { style = "width:150px" })
            )

From the main view, i open the window with jquery function.

function OpenFitUpForm(e) {
        e.preventDefault();
        var dataItem = this.dataItem($(e.currentTarget).closest("tr"));
        var wnd = $("#PopUpForm").data("kendoWindow");
        $("#PopUpForm").kendoWindow({
            content: {
                url: "/wlb/wlbexplorer/_FitUpForm",
                data: { id: dataItem.Id },
            },
            width: 500,
            title: "FitUp Report",
            modal: true,
            visible: false,
            draggable: true,
        });
        wnd.center().open();
    }


But the result as seen in the attachment. 
Dimo
Telerik team
 answered on 12 Mar 2015
1 answer
370 views
Hello all

I have downloaded Open Street Maps Tile.

I would like to know whether i can build  Asp.Net MVC 4 Web Application and i want to load OSM Tiles downloaded locally.

The computer will not be connected to the Internet.

Can you please let us know on how to  implement  map control and load tiles from locally downloaded folder.

I would also like to know if i can trigger markers on particular lat and Long

Thanks
Suresh


T. Tsonev
Telerik team
 answered on 12 Mar 2015
12 answers
135 views
Hello,

Is there a way to not print a label on every chart bar, and just on every second or third perhaps?

Iliana Dyankova
Telerik team
 answered on 12 Mar 2015
1 answer
189 views
I would like to allow the user to insert new rows inline (but not edit existing rows). The left most column will contain a dropdown list and based on the selection from the dropdown list I would like to then populate the other 4 cells in the new row with specific values which can't be changed by the user? Is this possible
Daniel
Telerik team
 answered on 12 Mar 2015
3 answers
185 views
Using a standard scheduler I am attempting to assign multiple resources. However, on submit I am getting a javascript alert error telling me the "someNumber" is invalid, where some number is the Datavalue for resource RegionRes. ("1" is invalid, "2" is invalid. etc)
 
The following things happen:

The record is processed and inserting into the database.
The edit form does not close.
Upon cancelling out of the edit form the event does not appear on the schedule.
Upon refreshing no events will appear on the schedule.

However, deleting the the offending record(s) from the join table and refreshing the calendar all events appear again.

Here is the scheduler:
@(Html.Kendo().Scheduler<SchedulerViewModel>()
        .Name("scheduler")
        .Views(views =>
            {
                views.DayView();
                views.WeekView();
                views.MonthView(monthView => monthView.Selected(true));
            })
        .Resources(resource =>
                    {
                        resource.Add(r => r.RegionIds)
                            .Name("RegionsResource")
                            .Title("RegionsRes")
                            .DataTextField("RegionName")
                            .DataValueField("RegionId")
                            .Multiple(true)
                            .DataSource(source =>
                            {
                                source.Read(read => { read.Action("RegionDropDownList", "DropDownList"); });
                            });
 
                        resource.Add(v => v.VenueId)
                            .Name("VenuesResource")
                            .Title("VenueRes")
                            .DataTextField("VenueName")
                            .DataValueField("VenueId")
                            .BindTo((IEnumerable<VenueViewModel_DDL>)ViewData["Venues"]);
                    }
 
        )
        .DataSource(d => d.Model(m =>
            {
                m.Id(f => f.EventId);
                m.Field(f => f.Title).DefaultValue("No title");
                m.RecurrenceId(f => f.RecurrenceID);
                m.Field(f => f.IsAllDay).DefaultValue(false);
            })
            .Read("Read", "Scheduler")
            .Create("Create", "Scheduler")
            .Destroy("Destroy", "Scheduler")
            .Update("Update", "Scheduler")
            .Events(e => e.Error("error_handler"))
        )
        .Editable(true)
    )

I have also tried a bindto using viewdata to no avail.

It is just very odd that it will display the multiselect for edit and insert the event into the database but not display the event.

As usual any help would be appreciated.

Thanks,
Chris




























































































































































Chris
Top achievements
Rank 1
 answered on 11 Mar 2015
1 answer
343 views
I am passing an IEnumerable of viewmodels to the grid at load time.  My columns are bound to properties on the viewmodels, which are themselves different viewmodels.  Since I am not reading the data via AJAX, I would like to have the data sorted on the client-side.  I have .Sortable() called on the grid and .ServerOperation(false) called on the DataSource.  When I mouse over the column header, my browser displays a URL like: http://mysite/controller/action?gridName-sort=ColumnName-asc  When I click on the column header, the sort arrow appears, changes, or disappears, but the data is not reordered.  I tried implementing IComparable and IComparable<T> on my column viewmodel on a suggestion from another user, but this does not appear to work.  Can client-side sorting work in this scenario?  If so, what do I need to do?

Thanks,
Brian
Kiril Nikolov
Telerik team
 answered on 11 Mar 2015
1 answer
92 views
Hi,

We are evaluating the scheduler control for our application.
We need to add a checkbox on top of each day caption.Please see the attached image. Is there any options to do that?

Thanks,
Jazeel 
Vladimir Iliev
Telerik team
 answered on 11 Mar 2015
1 answer
343 views
I have a custom command and when i clicked it, i want to call an ajax function and if it returns, i want it to be disable. I have more than 1000 rows , and i want to refresh only related row. 

@(Html.Kendo().Grid<Umki2.Areas.Wlb.ViewModels.VmWlbWeldLogBook>()
        .Name("grid")
        .Columns(columns =>
        {
            columns.Bound(c => c.JointNo).Width(140);
            columns.Bound(c => c.WlbJointLocation).Width(190);
            columns.Command(command => command.Custom("FitUp").Click("showDetails"));
 
        })
 
        .HtmlAttributes(new { style = "height: 380px;" })
        .Scrollable()
        .Groupable()
        .Sortable()
        .Pageable(pageable => pageable
            .Refresh(true)
            .PageSizes(true)
            .ButtonCount(5))
        .DataSource(dataSource => dataSource
            .Ajax()
                .Read(read => read.Action("Grid_Read", "WlbExplorer"))
        )
)
@(Html.Kendo().Window().Name("Details")
    .Title("Customer Details")
    .Visible(false)
    .Modal(true)
    .Draggable(true)
    .Width(300)
)
 
<script type="text/x-kendo-template" id="template">
    <div id="details-container">
        <h2>#= JointNo # #= JointNo #</h2>
        <em>#= WlbJointLocation #</em>
        <dl>
            <dt>City: #= WlbJointLocation #</dt>
            <dt>Address: #= WlbJointLocation #</dt>
        </dl>
         
    </div>
</script>
 
 
 
<script type="text/javascript">
    var detailsTemplate = kendo.template($("#template").html());
 
    function showDetails(e) {
        e.preventDefault();
 
        var dataItem = this.dataItem($(e.currentTarget).closest("tr"));
        var wnd = $("#Details").data("kendoWindow");
 
        wnd.content(detailsTemplate(dataItem));
        wnd.center().open();
    }
</script>
Alexander Popov
Telerik team
 answered on 11 Mar 2015
2 answers
1.5K+ views
I have an Ajax populated treeview....
@(Html.Kendo().TreeView()
    .Name("fao")
    .HtmlAttributes(new {@class="fixed-height" })
    .DataTextField("Text")
    .TemplateId("treeview-item-template")
    .DataSource(ds => ds
        .Read(r => r
            .Action("_ModuleData", "Home")
        )
        .Model(m => m
            .Children("Items")
            .HasChildren("HasChildren")
        )
    )
)

I have a requirement to update some data hidden against each child item - in the template - when a action (triggered outside of the control) occurs.

The template, for completeness, looks like this ...

<script id="treeview-item-template" type="text/kendo-ui-template">
    #= item.Text #<input type='hidden' class='hidden-data' data-fal='#= item.Fal#' data-uid='#=item.uid#'/>
</script>

Now, I have code for the trigger and that works just fine.

I have code to update the hidden data. Again. No worries.

What I can't figure out is how to simply get at all of the child (and granchild, etc) nodes of the node that is selected when the trigger fires.

If I were trying to get at the children when the node was initially clicked, I kind of expected to be able to say something like...

function doSomething(e)
{
    for(n=0; n<e.node.nodes.length; n++)
    {
        doSomethingElse(e.node.nodes[n]);
    }
}

But no such functionality seems to exist.

Does anyone have any suggestions how I might go about this?









Alex Gyoshev
Telerik team
 answered on 11 Mar 2015
Narrow your results
Selected tags
Tags
+? more
Top users last month
Anislav
Top achievements
Rank 6
Silver
Bronze
Bronze
Jianxian
Top achievements
Rank 1
Iron
Marco
Top achievements
Rank 3
Iron
Iron
Iron
Jim
Top achievements
Rank 2
Iron
Iron
Nurik
Top achievements
Rank 2
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Anislav
Top achievements
Rank 6
Silver
Bronze
Bronze
Jianxian
Top achievements
Rank 1
Iron
Marco
Top achievements
Rank 3
Iron
Iron
Iron
Jim
Top achievements
Rank 2
Iron
Iron
Nurik
Top achievements
Rank 2
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?