Telerik Forums
UI for ASP.NET MVC Forum
1 answer
117 views
I have grid with a column bound like this...

cols.Bound(m => m.Location).Filterable(fl => fl.Cell(c => c.Template("locationFilter").Operator("equals").ShowOperators(false)));

and some javascript..

var locationList = [
                        {text: "Atlanta", value: "ATL"},
                        {text: "Houston", value: "HOU"},
        ];
function locationFilter(container) {
            container.element.kendoDropDownList({
                dataTextField: "text",
                dataValueField: "value",
                optionLabel: { text: "-ALL-", value: "" },
                dataSource: { data: locationList, },
            });
        }

This seems to initialize correctly showing '-ALL-' with no filter applied.  But as soon as I select something in the dropdownlist it immediately changes the selection back to "-ALL-" and filters out all the items.

However, if I change it to this and use strings for the data instead of objects, it lets me select items and applies the filters ok but the display isn't optimal...

function locationFilter(container) {
            container.element.kendoDropDownList({
                optionLabel: "-ALL-",
                dataSource: {data: ["ATL", "HOU"],},
            });
        }

Am I doing something wrong when trying to use objects in the datasource for the custom filter, or is there a bug?
Alexander Popov
Telerik team
 answered on 12 Mar 2015
6 answers
385 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
324 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
377 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
141 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
196 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
191 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
351 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
97 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
356 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
Narrow your results
Selected tags
Tags
+? more
Top users last month
Will
Top achievements
Rank 2
Iron
Motti
Top achievements
Rank 1
Iron
Hester
Top achievements
Rank 1
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Thomas
Top achievements
Rank 2
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Will
Top achievements
Rank 2
Iron
Motti
Top achievements
Rank 1
Iron
Hester
Top achievements
Rank 1
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Thomas
Top achievements
Rank 2
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?