Telerik Forums
UI for ASP.NET MVC Forum
1 answer
414 views
Hi,

I recently started working on Asp.Net MVC and also very new to Telerik UI for asp.net mvc. I created a new telerik mvc project and set the authentication mode to windows in web.config. The application runs fine on my PC. But when I upload it on to a windows server, it gives me a 'Resource not found' error indicating that it is missing login.aspx file. Is there another way to set the authentication mode to windows and get the application working in Telerik UI?
Please help.

Thanks.
Sebastian
Telerik team
 answered on 25 Jul 2014
1 answer
306 views
Here is a screen shot of my all. Validation are not working on Kendo Upload control used.



View has code:


 <div class="col-md-4">
                    @Html.Label("file", "Select File")
                    @(Html.Kendo().Upload()
                          .Name("upload")
                          .Multiple(false)
                          .Messages(msgs => msgs.Select("Browse"))
                          )
                   @Html.ValidationHtmlMessageFor(model => model.UploadFileName)
                </div>
                <div class="col-md-4 buttonBox">
                    @Html.Kendo().Button().Name("Save").Content("Upload File").HtmlAttributes(new {type = "submit"}) 

Code in View Model:

    [Required(ErrorMessageResourceType = typeof(Resources.Resources),
                  ErrorMessageResourceName = "FieldRequired")]
        [Display(Name = "Month")]
        public int ObjectiveMonth { get; set; }


Controller checks for ModelState.isValid

But the validation message do not show up

What could the reason be?

















Dimiter Madjarov
Telerik team
 answered on 25 Jul 2014
1 answer
247 views
Number of records to display should be a drop down with the number of users they would like to view per page. The default number should be 10 records. I want the selection criteria should be in denominations of 10 up to 40. (10, 20, 30, 40) 

Code in View:

@(Html.Kendo().Grid<IncentiveViewModel>()
            .Name("Incentive")
            .Columns(columns =>
            {
                columns.Bound(p => p.Make).EditorTemplateName("MakeDropDown").Sortable(true);
                columns.Bound(p => p.Model).EditorTemplateName("ModelDropDown").Sortable(true);
                columns.Bound(p => p.Year).Sortable(true);
                columns.Bound(p => p.Term);
                columns.Bound(p => p.Rate);
                columns.Bound(p => p.StartDate).Format("{0:MM/dd/yyyy}");
                columns.Bound(p => p.EndDate).Format("{0:MM/dd/yyyy}");
                columns.Bound(p => p.IsActive).ClientTemplate(
                    "# if (IsActive) { #" +
                        "Yes" +
                    "# } else { #" +
                        "No" +
                    "# } #"
                    );
                columns.Template(@<text></text>)
                    .Width(110)
                    .ClientTemplate(@"<a class=""k-grid-delete"" href=""\#""></a>");
            })
            .ToolBar(toolbar =>
            {
                toolbar.Create().Text("Add Incentive");
                toolbar.Save().SaveText("Save Changes").CancelText("Cancel Changes");
            })
            .Editable(editable => editable.Mode(GridEditMode.InCell))
            .Resizable(resize => resize.Columns(true))
            .Pageable(pageable => pageable
                .Refresh(true)
                .PageSizes(true)
                .ButtonCount(10))

            .Navigatable()
            .Sortable()
            .Resizable(resize => resize.Columns(true))
            .DataSource(dataSource => dataSource
                .Ajax()
                .Batch(true)
                .PageSize(10)
                .ServerOperation(false)
                    .Events(events => events.Error("ds_onError").Sync("incentivesDs_onSync").RequestEnd("ds_onRequestEnd"))
                .Model(model =>
                {
                    model.Id(p => p.IncentiveId);
                    model.Field(p => p.Year).Editable(true);
                    model.Field(p => p.Make).Editable(true);
                    model.Field(p => p.Model).Editable(true);
                    model.Field(p => p.Rate).Editable(true);
                    model.Field(p => p.StartDate).Editable(true);
                    model.Field(p => p.EndDate).Editable(true);
                    model.Field(p => p.IsActive).Editable(false);
                })
                .Create("Create", "Incentive")
                .Read("Read", "Incentive")
                .Update("Update", "Incentive")
                .Destroy("Destroy", "Incentive"))
                .Events(events => events.SaveChanges("incentivesGrid_onSaveChanges").Edit("grid_onEdit"))
         )

Even with this setting I see a paging drop down with 5, 10, 20 where as I want 10, 20, 30, 40..etc

Here is the result:

 




Dimo
Telerik team
 answered on 25 Jul 2014
1 answer
436 views
I am allowing my users to select rows in a kendo grid via a checkbox in the first column and right now the selections are lost if/when they change pages.  I was hoping there would be a way i could show a confirm dialog when when they click the page, but before the page changes and either
1) allow them to perform an action on the selected rows
2) lose the selections
3) stop the page change from occurring

I am having trouble actually stopping the page change from happening.  Are there any samples on how to do this?

Thanks,
-Logan
Dimiter Madjarov
Telerik team
 answered on 25 Jul 2014
3 answers
260 views
I have tried following the Validation Guide and the Batch Editing example but something is still amiss. The validation tooltip does not appear when I attempt to Save Changes after leaving a required field empty (i.e. Rate). We are using ASP.NET MVC 4 Razor and Kendo UI 2014.1.415.

CSHTML
@(Html.Kendo().Grid<IncentiveViewModel>()
      .Name("Incentive")
      .Columns(columns =>
      {
          columns.Bound(p => p.Make).EditorTemplateName("MakeDropDown").Sortable(true);
          columns.Bound(p => p.Model).EditorTemplateName("ModelDropDown").Sortable(true);
          columns.Bound(p => p.Year).Sortable(true);
          columns.Bound(p => p.Term);
          columns.Bound(p => p.Rate);
          columns.Bound(p => p.StartDate).Format("{0:MM/dd/yyyy}").EditorTemplateName("CalendarPicker");
          columns.Bound(p => p.EndDate).Format("{0:MM/dd/yyyy}");
          columns.Template(@<text></text>)
              .Width(110)
              .ClientTemplate(@"<a class=""k-grid-delete"" href=""\#""></a>");
      })
      .ToolBar(toolbar =>
      {
          toolbar.Create().Text("Add Incentive");
          toolbar.Save().SaveText("Save Changes").CancelText("Cancel Changes");
      })
      .Editable(editable => editable.Mode(GridEditMode.InCell))
      .Resizable(resize => resize.Columns(true))
      .Pageable(pageable => pageable
          .Refresh(true)
          .PageSizes(true)
          .ButtonCount(10))
      .Navigatable()
      .Sortable()
      .Resizable(resize => resize.Columns(true))
      .DataSource(dataSource => dataSource
          .Ajax()
          .Batch(true)
          .PageSize(10)
          .ServerOperation(false)
          .Model(model =>
          {
              model.Id(p => p.IncentiveId);
              model.Field(p => p.Year).Editable(true);
              model.Field(p => p.Make).Editable(true);
              model.Field(p => p.Model).Editable(true);
              model.Field(p => p.Rate).Editable(true);
              model.Field(p => p.StartDate).Editable(true);
              model.Field(p => p.EndDate).Editable(true);
          })
          .Create("Create", "Incentive")
          .Read("Read", "Incentive")
          .Update("Update", "Incentive")
          .Destroy("Destroy", "Incentive"))
      )


ViewModel (abbreviated with just one field)
[Display(Name = "Rate")]
[Required(AllowEmptyStrings = false, ErrorMessageResourceType = typeof(Resources.Resources), ErrorMessageResourceName = "FieldRequired")]
[Range(0, 12, ErrorMessage = "Value for {0} must be between {1} and {2}.")]
public decimal? Rate { get; set; }

I noticed that no validation attributes are being appended to the input field:
<input class="text-box single-line" id="Rate" name="Rate" type="text" value="" data-bind="value:Rate">


What am I missing? What more do you need to see? Thanks.

Adam
Rosen
Telerik team
 answered on 25 Jul 2014
7 answers
876 views
Hi,

Is there the way to hide all the times grid and just keep "All Day" row, since visits in my project are whole day events?

I have tried to set business hours to the same time, it didn't worked for me.

Any suggestion?

Thank you,
-Yuriy
Reiner
Top achievements
Rank 1
 answered on 24 Jul 2014
2 answers
443 views
Hi,

I'm wondering if it's possible to bind the ForeignKey column builder to a collection other than MVC's SelectList (for example, one with items containing properties other than just Id and Text).

In the regular DropDownListBuilder, there is an overload of BindTo() that takes an IEnumerable that allows you to do this, but from looking at the source code, all of the ForeignKey overloads for IEnumerable just convert it to a SelectList internally. My reason for wanting this is that we frequently have cases where the data in the ForeignKey needs an additional ID property for some related entity that we use for filtering the data source later.

The only way I've found to solve this so far is to use a Bound column instead and specify an editor template that uses a DropDownList with the BindTo overload that takes an IEnumerable. The problem with this is that the column will only display the integer ID outside of edit mode -- using ForeignKey will do the ID -> text mappings automatically in either mode. Is there a better way to do this?

Thanks,
Nick
Nicholas
Top achievements
Rank 1
 answered on 24 Jul 2014
1 answer
66 views
Hello,

In order to activate the adaptive rendering on the Scheduler, i have added Mobile() configuration like this:

.Mobile(MobileMode.Tablet)  and also for phone in phone view file.

But after adding this now when Scheduler loads on mobile device it doesnt not Show all Events on load. But if i Change week view or just navigate it will refresh and Display all .

Is there something i am missing?

Anamika
Georgi Krustev
Telerik team
 answered on 24 Jul 2014
6 answers
706 views
Hi there,

Following advice on another thread, I am using a client template to display a checkbox in place of a boolean field (named BooleanPropertyName for the purposes of this example):

Column Declaration:
 
columns => columns.Bound(m=> m.BooleanPropertyName).ClientTemplate(
"<input type='checkbox' " +
                                "#=BooleanPropertyName? 'checked=checked' : '' #" +
                                "disabled='disabled'</input>");


This is working fine when it comes to displaying and indeed editing the data. However, I am experiencing a problem when attempting to add a new record. I am using a custom edit form with the grid popup.

When clicking on the add button, I receive a jQuery error: "BooleanPropertyName" is undefined.". I can see where the error is occurring in what seems to be a function generated by the kendo grid:

function anonymous(data) {
var o,e=kendo.htmlEncode;with(data){o='<tr data-uid="'+(data.uid)+'" role=\'row\'><td  role=\'gridcell\'>'+e(data.OtherProperty==null?'':data.OtherProperty)+'</td><td  role=\'gridcell\'>'+(BooleanPropertyName ? 'Yes' : 'No' )+'</td><td  role=\'gridcell\'></tr>';}return o;
}


In the example above, I have included another property which is coming from a bound column - this appears to be working fine as it can get past this property before hitting the error.

I am fairly new to Kendo controls - what way do I need to modify the output of my client template in order to resolve this error?

Thanks,

P

Nikolay Rusev
Telerik team
 answered on 24 Jul 2014
1 answer
203 views
Hi there,

I have a Kendo MVC Grid where I have added a per row dropdown menu (similar to that found in this thread). This is using a Kendo Menu which is created at runtime via some configuration options I have set up in the project.

This works fine when the menu contains custom actions which I wish to execute (i.e. redirecting to another screen or displaying custom modal screen).

However, I was looking to include an "Edit" option in this menu which would trigger the built in Kendo Grid editing function which I have set up - either inline, incell or popup depending on which I require.

I'm not sure I have ever seen an example of a custom button or menu action which triggers a built in Kendo Grid function - can you point me towards an example of this?

Thanks,

Paul
Dimo
Telerik team
 answered on 24 Jul 2014
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
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
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?