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

Hello,

I created a custom editor for my Scheduler, and I now need to add some custom validation.
My goal is to ensure that:

1) The start and end date must be in the same day (cannot spawn multiple days)
2) The smaller possible unit is 15 min. So the valid hours are xx:00, xx:15, xx:30 and xx:45.

A valid Input would for example be:
from 01.01.2000 11:15
to 01.01.2000 22:45

Invalid examples would be:
from 01.01.2000 11:15
to 02.01.2000 08:45 (not the same day)

from 01.01.2000 11:23 (not multiple of 15min)
to 01.01.2000 14:30

How can I achieve this behavior?
Cheers

AKROS
Top achievements
Rank 1
 answered on 20 Jul 2016
1 answer
95 views

Hi there,

Were using a custom filter for statuses.

Its working fine when were only using this in the grid properties:

 

1.//Column code in grid
2. 
3.columns.Bound(la => la.StatusName)
4..Filterable(s => s.Multi(true).DataSource(ds => ds.Read(r => r.Action("GetStatuses", "Status").Data("{ field: 'StatusName' }"))))
5. 
6.//Grid propert
7..Filterable(ftb => ftb.Mode(GridFilterMode.Menu))

 

but when i add the .ColumnMenu() property to the grid the filtering on the status column doesnt show at all. I need the show/hide column functions in the columnmenu but cant sacrifice the custom status filter.

 

The serverside code for the datasource looks like this:

 

01.public ActionResult GetStatuses(string field)
02.{
03.    var statuses = Context.GetAll<Status>(false);
04. 
05.    var viewModels = (from s in statuses
06.                      select new StatusVm() { StatusName = s.Key })
07.        .ToList();
08. 
09.    return Json(viewModels, JsonRequestBehavior.AllowGet);
10.}

 

Am i missing something obvious here?

 

Thankful for any input.

 

 

Konstantin Dikov
Telerik team
 answered on 20 Jul 2016
1 answer
2.8K+ views

Help here, the checked value of Kendo Checkbox does not change and is always assigned as 'true'. Below is the sample code:

@(Html.Kendo().CheckBox().Name("autoValidate")
    .Checked(false)
    .Label("Auto-Validate")
    .HtmlAttributes(new { onchange = "updateMsg();" })
)
 
<blockquote>
    autoValidate checked value: <span id="autoValidate-value"></span>
</blockquote>
 
<script type="text/javascript">
    function updateMsg() {
        $('#autoValidate-value').text($('input[name=autoValidate]').val());
    }
 
    updateMsg();
</script>

Vessy
Telerik team
 answered on 18 Jul 2016
5 answers
81 views

Hello,

We are currently trying to implement a form containing a datagrid using this tutorial : http://www.kendoui.com/code-library/mvc/grid/submit-form-containing-grid-along-with-other-input-elements.aspx.

So far, we managed to configure the grid but we are facing a major drawback using IE8 which is the browser we are targeting. Actually, insertion and deletion of lines work flawlessly but we can edit the data only once right after creation. However, this doesn’t happen using Google Chrome, so we wanted to know if it was a known bug and if there is a workaround to make it work under IE8.

Thanks in advance,

Yours sincerely,

Kostadin
Telerik team
 answered on 18 Jul 2016
2 answers
684 views

I have a number of options on the page for users to choose which resources they want to load on the scheduler. On scheduler load I make a call to load the resources that they have previously save but I'm not able to manipulate or change them once the page loads. Here is my configuration. 

@(Html.Kendo().Scheduler<Avianis.Models.Scheduler.AppointmentViewModel>()
        .Name("scheduler")
        .Date(new DateTime(DateTime.Now.Year, DateTime.Now.Month, DateTime.Now.Day))
        .AutoBind(false)
        .Snap(true)
        .Timezone("UTC")
        .Events(e =>
        {
            e.Navigate("scheduler_navigate");
        })
        .Views(views =>
        {   
            views.TimelineView(timeline => timeline
                .Title("Day")
                .MajorTick(60)
                .MinorTickCount(1)
                .EventHeight(77)
                .ColumnWidth(150)
                .EventTemplateId("more-template")
            );
            views.CustomView("TimelineViewFiveDays");
            views.CustomView("TimelineViewSevenDays");
            views.CustomView("TimelineViewThirtyDays");
            views.MonthView(timeline => timeline
                .EventHeight(40)
            );
        })
        .EventTemplateId("event-template")
        .Group(group => group.Resources("Aircraft").Orientation(SchedulerGroupOrientation.Vertical))
        .Resources(resource => resource.Add(m => m.ResourceID)
            .Name("Aircraft")
            .Title("Aircraft")            
            .DataValueField("id")
            .DataTextField("text")
            .DataSource(source => source.Read("GetResources", "Calendar"))
        )
        .Editable(editable => editable
            .Update(false)
            .Create(false)
            .Destroy(false)
            .Move(false)
            .Resize(false)
        )
        .DataSource(dataSource => dataSource            
            .SignalR()
            .Transport(tr => tr                
                .Promise("hubStart")
                .Hub("calendarHub")
                .Server(s => s
                    .Read("LoadAircraft"))
            )
            .Schema(schema => schema
                .Model(model =>
                {
                    model.Id(m => m.ID);
                    model.Field(m => m.ID).Editable(false);
                    model.Field("start", typeof(DateTime)).From("Start");
                    model.Field("end", typeof(DateTime)).From("End");
                    model.Field("title", typeof(string)).From("Subject");
                    model.Field("description", typeof(string)).From("Description");
                    model.Field("isAllDay", typeof(bool)).From("IsAllDay");
                    model.Field("ownerId", typeof(string)).From("OwnerId");
                })
            )
        )
    )

 

I've trying to change resources by saving the selected resources to the database then calling the line below. 

$('#scheduler').data().kendoScheduler.resources[0].dataSource.read();

 

And I've tried it this way as well. 

var scheduler = $("#scheduler").data("kendoScheduler");
scheduler.resources[0].dataSource.data(data);
scheduler.view(scheduler.view().name);

 

Both ways do not refresh the UI. Any help would be appreciated. 

 

 

Yoichi
Top achievements
Rank 1
 answered on 18 Jul 2016
1 answer
440 views

I am using the paste cleanup feature with version 2016.2.504 


I am getting error.
Kendo.MVC.UI.Fluent.EditorBuilder' does not contain a definition for 'PasteCleanup' and no extension method 'PasteCleanup' accepting a first argument of type 'kendo.MVC.UI.Fluent.EditorBuilder' could be found.


Could you please help in this?

 

Just to add more details to above query -


Here is my kendo editor definition like tbelow:


@(Html.Kendo().Editor()
            .Name("ManuscriptFormTextEditor")
             .PasteCleanup(p => p
                    .All(false)
                    .Css(false)
                    .KeepNewLines(false)
                    .MsAllFormatting(false)
                    .MsConvertLists(true)
                    .MsTags(true)
                    .None(false)
                    .Span(false)
                 )                 
            .Tools(tools => tools
                  .Clear()                
                  .Bold().Italic().Underline().Strikethrough()
                  .JustifyLeft().JustifyCenter().JustifyRight().JustifyFull()
                  .InsertUnorderedList().InsertOrderedList()
                  .Outdent().Indent()
                  //.CreateLink().Unlink()
                  //.InsertImage()
                  //.InsertFile()
                  .SubScript()
                  .SuperScript()
                  .TableEditing()
                  //.ViewHtml()
                  .Formatting()
                  .CleanFormatting()
                  //.FontName()
                  .FontName(items => items
                            .Add("Arial", "Arial")
                            .Add("Arial Narrow", "Arial Narrow")
                            .Add("Calibri", "Calibri")
                            .Add("Courier New", "Courier New")
                            .Add("Tahoma", "Tahoma")
                            .Add("Times New Roman", "Times New Roman")
                            .Add("Verdana", "Verdana")                                                        
                            )
                  //.FontSize()
                  .FontSize()
                  .FontColor().BackColor()
                  //.Print()
              )
              .HtmlAttributes(new { style = "width: 100%;height:500px;text-align:center;font-size:14px;" })
              .Encode(false)
              .Value(@<text>@Html.Raw(@ViewBag.ManuscriptFormText)</text>)
    )     


It is not throwing any error if i remove the code :
 .PasteCleanup(p => p
                    .All(false)
                    .Css(false)
                    .KeepNewLines(false)
                    .MsAllFormatting(false)
                    .MsConvertLists(true)
                    .MsTags(true)
                    .None(false)
                    .Span(false)
                 )

Stanimir
Telerik team
 answered on 18 Jul 2016
18 answers
4.1K+ views

Hi there, is there a way to bind Kendo MVC grid to dynamic object (or ExpandoObject)?
hkdave95
Top achievements
Rank 2
Iron
 answered on 15 Jul 2016
4 answers
752 views

hi,

i updated my VS 2015 with update 3 and now i cannot build my project that uses Kendo MVC Grid, v2015.1.429.340.

i am getting a huge number of errors like these:

KendoUIMVC\typescript\kendo.all.d.ts(245,9): error TS2300: Build:Duplicate identifier 'paramName'.
KendoUIMVC\typescript\kendo.all.d.ts(246,9): error TS2300: Build:Duplicate identifier 'useWithBlock'.
KendoUIMVC\typescript\kendo.all.d.ts(249,11): error TS2300: Build:Duplicate identifier 'Class'.
KendoUIMVC\typescript\kendo.all.d.ts(254,11): error TS2300: Build:Duplicate identifier 'Observable'....

how do i fix this?

thanks.

Viktor Tachev
Telerik team
 answered on 15 Jul 2016
1 answer
90 views

I am trying to set the filer option for columns A to G and also column Q but cannot seem to get any syntax to work.

The below works for setting the filter option for columns A to G but when I try to also include Q I get an error or only column Q is filtered

   .Filter(filter =>
                {
                    filter.Ref("A1:G7000").Columns(columns => { });
                 })

Error

    .Filter(filter =>

                {
                    filter.Ref("A1:G7000;Q1:Q7000").Columns(columns => { });
                })

 

Error
   .Filter(filter =>
                {
                    filter.Ref("A1:G7000,Q1:Q7000").Columns(columns => { });
                })

 

Only Column Q is filterable

   .Filter(filter =>
                {
                    filter.Ref("A1:G7000).Columns(columns => { });
                    filter.Ref("Q1:Q7000").Columns(columns => { });

                })

 

Any help on the syntax would be appreciated

 

Jeff

 

Veselin Tsvetanov
Telerik team
 answered on 15 Jul 2016
9 answers
383 views

I was hoping this project would just disappear, but unfortunately it has not.  And I'm beating my head against a wall to get this thing figured out.

I'm building a CSV file uploader, which upon upload it opens the CSV file and parses out the column headers.  It then presents this in a grid with an additional column that contains a dropdown.  It's to be used for custom CSV imports.  Once the grid is displayed, the user would go down each row, mapping a column to a property.

The grid is being loaded via one of the ViewModel properties.

@using FileUploader_Mapper.Models
@model CSVColumnsViewModel
 
@{
    ViewBag.Title = "Result";
}
 
<style>
    .k-grid td {
        line-height: 2em;
        padding: 0 0 0 1em;
    }
</style>
 
<h2>Result</h2>
 
<p></p>
 
@(Html.Label("lblMisc", "Columns from CSV File: " + Model.CSVFile))<br/>
 
@(Html.Kendo().Grid(Model.Columns)
    .Name("csvGrid")
    .HtmlAttributes(new { style = "width: 650px" })
    .TableHtmlAttributes(new { @class = "table-condensed" })
    .Columns(col =>
    {
        col.Bound(c => c.ColumnNumber).Width(25).Title("Col #");
        col.Bound(c => c.ColumnName).Width(400).Title("Column Name");
        col.ForeignKey(c => c.MappedTo, Model.MappingProperties, "Id", "Name").Title("Mapped To");
    })
    // .Pageable()
    .DataSource(ds => ds
        .Ajax()
        // .PageSize(20)
        // .ServerOperation(false)
        .Model(m =>
        {
            m.Id(c => c.ColumnNumber);
            m.Field(c => c.ColumnName).Editable(false);
            m.Field(c => c.MappedTo).DefaultValue(0);
        })
        .Update("SaveCSVDefinition", "Home")
    )
    .Editable(editable => editable.Mode(GridEditMode.InCell))
)

 

 You'll notice I have an Update method specified, but the method in the controller never gets called.  Am I correct in assuming the Update will only work if there is also a Read and Create?  I do not want to use AJAX to read the data to populate the grid, it's already right there in the view model, which is exactly what I want.  But I also want to get the mapped columns as well, but I never get anything.

 

Oh, and here's the controller code for now...  Even though it doesn;t really do much.  Yet.

[HttpPost]
[ActionName("SaveCSVDefinition")]
public ActionResult SaveCSVDefinition([DataSourceRequest]DataSourceRequest request, CSVColumn csvColumn)
{
    return Json("saving", JsonRequestBehavior.AllowGet);
}

So how do I get these updates to post to the controller? Ideally, I'd much rather save the whole thing at once, and even had a button with a click, but I couldn;t figure out how to get the model back out of the grid in order to post it via AJAX.

Pavlina
Telerik team
 answered on 15 Jul 2016
Narrow your results
Selected tags
Tags
+? more
Top users last month
Rob
Top achievements
Rank 3
Iron
Iron
Iron
Atul
Top achievements
Rank 1
Iron
Iron
Alexander
Top achievements
Rank 1
Veteran
Iron
Serkan
Top achievements
Rank 1
Iron
Shawn
Top achievements
Rank 1
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Rob
Top achievements
Rank 3
Iron
Iron
Iron
Atul
Top achievements
Rank 1
Iron
Iron
Alexander
Top achievements
Rank 1
Veteran
Iron
Serkan
Top achievements
Rank 1
Iron
Shawn
Top achievements
Rank 1
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?