Telerik Forums
UI for ASP.NET MVC Forum
2 answers
80 views

<script id="detail-template" type="text/x-kendo-template">
  <div class='shipping-details'>
    <ul>
      <li><label>Applied:</label>kendo.toString(#= Applied #, "MM-dd-yyyy" )</li>
    </ul>
  </div>
</script>

 

I have a DateTime field in my model which I want to format.  How do you do this in 'UI for ASP.NET MVC' and how do you format kendo # variables in general?

'kendo.' is not recognized in the "text/x-kendo-template", #= Applied # is and displays the full DateTime.

 

 

 

Joe
Top achievements
Rank 1
 answered on 19 Jan 2016
9 answers
120 views
I'm trying to build a monitoring page for a Telerik Scheduler in MVC and trying to refresh the page every minute. I can-do a reload() every minute but was hoping for a more elegant solution. I'm trying the following code in javascript However I don't see the time-bar updating. setInterval(function () {

var scheduler = $("#ReservationsTimeLine").data("kendoScheduler");

var start = Date.now();
var end = start + 2 * 60 * 60 * 1000;

scheduler.startDate = start;
scheduler.endDate = end;
scheduler.dataSource.read();
scheduler.refresh();

}, 60000); //1 minute
Denis Buchwald
Top achievements
Rank 1
 answered on 18 Jan 2016
7 answers
995 views

Hello everyone,

 

Is it possible to remove the "k-textbox" class from MaskedTextBox? I have my own Bootstrap/Material Design input class.

 

<div class="form-group form-group-material-light-blue">
    @(Html.Kendo().MaskedTextBox()
          .Name("phone_number")
          .Mask("(999) 000-000-000")
          .HtmlAttributes(new {@class = "form-control floating-label mdc-text-grey-700"})
          )
</div>

But still after the page renders "k-textbox" gets added automatically.

 

Please advice,

Alex

 

Alex
Top achievements
Rank 1
 answered on 18 Jan 2016
1 answer
489 views

I have an MVC Razor app with the Kendo Grid using the popup editor modeled on the demo.  The popup comes up OK, and the model is invoked and does it's validation steps.  I do not use Entity Framework, the model has validation logic that applies business rules.  My problem is that when validation fails, or succeeds for that matter, the demo does not show what to return to the view/grid.  How are errors formatted for example? 

My other question is what to return if successful?  The object the controller got from the editor is a singular object, not IQueriable or IEnumerable.  My grid is populated with data, and the model has already done the insert to the database if validation passed.  Do I refresh the grid, and if so, how can I make sure the user is kept in the same section of the grid?

My controller code for Create is shown below (the return code shows an Intellisense error you can't see here):

[AcceptVerbs(HttpVerbs.Post)]
public ActionResult EditingPopup_Create([DataSourceRequest] DataSourceRequest request, BuyerAssignmentRecord bar)
{
    if (bar != null)
    {
        if (bar.DepartmentOI == 0) { bar.DepartmentOI = -1; }
        if (bar.EmployeeOI == 0) { bar.EmployeeOI = -1; }
 
        if (bar.Validate())
        {
            bar.Create();
        }
        else
        {
            // todo: what to return if validation failed?
        }
    }
    return Json(new[] { BuyerAssignmentRecord }.ToDataSourceResult(bar, ModelState));
}

Boyan Dimitrov
Telerik team
 answered on 15 Jan 2016
11 answers
631 views

I am using a dropdownlist in grid. The value is showing correctly in the column but when I click on the the column, the dropdownlist comes without the selected value. I have attached 3 images.

 

I need the value to be selected when I will click on the column and the dropdownlist will appear with that value. In my case when I will click on the column, the dropdownlist will appear with "DB" selected. And then I can change another value if I want. How can I do that?

 

 

Thanks

Kevork
Top achievements
Rank 2
 answered on 14 Jan 2016
1 answer
436 views

Hello, 

the AuthorizeAttribute does for well initial authorization and authentication and for actions that return views, but it doesn't work for grid commands such as save. Well it actually prevent the saving process, but the routing to the error-action doesn't work properly, because the save-command doesn't expect a view to be returned.

 

Rather than redirecting I'd like to hide commands/toolbar-items based on the role a user has in our database, but so far I only found an option like this based on AD-roles. Is there any way for me to do this?

Dimo
Telerik team
 answered on 14 Jan 2016
1 answer
3.5K+ views

I cannot create a grid in my MVC 6 application. I get "The kendo.aspnetmvc.min.js script is not included."

I am trying to run with the 30-day trial. I cannot find that js in the lib folder.

Dimo
Telerik team
 answered on 14 Jan 2016
1 answer
91 views

Hi,
       I am using Custom Editor Template in my Scheduler. Can you please tell me as how to include tab in the Custom Editor Template?

 When trying to add tab using below code

 

<div id="tabExample" style="float:left;width:98%;font-size: 1.1em !important;">
<ul>   
        <li><a href="#tab1">Tab1</a></li>   
        <li><a href="#tab2">Tab2</a></li
        </ul>
        </div>
 
//And in Script
<script type="text/javascript">
        $(document).ready(function () {
 $("#tabExample").tabs();
 });
</script>

 

I am getting javascript error like "Invalid Template".

Can you help me on this.

 

Thanks,

Dilip

 

 

Vladimir Iliev
Telerik team
 answered on 14 Jan 2016
3 answers
135 views

I tried this sample code from here: http://docs.telerik.com/kendo-ui/aspnet-mvc/helpers/spreadsheet/overview

and I don't get anything that renders on the view. I am also wondering where I can find some advanced examples of the spreadsheet control as I need to be able to freeze panes disable tool bar items or make them not show and so on.

 

Regards.

Dimiter Madjarov
Telerik team
 answered on 14 Jan 2016
7 answers
1.5K+ views

My dates pickers are showing no values when loaded, if I look at source I can see that they have a value, but it is not showing. you can see below that value is present.

HTML generated 

<span class="k-widget k-datepicker k-header"><span class="k-picker-wrap k-state-default"><input name="StartDate" class="k-input" id="StartDate" role="combobox" aria-disabled="false" aria-expanded="false" aria-readonly="false" aria-owns="StartDate_dateview" style="width: 100%;" type="text" value="2015/09/05" data-role="datepicker" data-val-required="The StartDate field is required." data-val="true" data-val-date="The field StartDate must be a date."><span class="k-select" role="button" aria-controls="StartDate_dateview" unselectable="on"><span class="k-icon k-i-calendar" unselectable="on">select</span></span></span></span>

 

 MVC config

@Html.Kendo().DatePickerFor(Function(m) m).Format("yyyy/MM/dd").ParseFormats({"dd-MM-yyyy", "dd/MM/yyyy", "MM/dd/yyyy", "yyyy/MM/dd", "yyyy-MM-dd"}).Value(Model)

Thanks

Gary Davis
Top achievements
Rank 2
 answered on 13 Jan 2016
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?