Telerik Forums
UI for ASP.NET Core Forum
0 answers
194 views

Hello,

I have a kendo grid that contains child grid(s) that get created by using the "ClientDetailTemplateId".  I want to be able to edit the rows in the child grid via a PopUp editor.  The problem is that when I use HtmlHelper or TagHelper tags such as (@(Html.Kendo().NumericTexBoxFor(model => model.column).... or 'kendo-numerictextbox .../>), Validation span tags such as (<span asp-validation-for="TextBox" class="text-danger"></span>), or any sort of JavaScript within <script> tags, in my editor's template file I get an error that the template is not formed correctly. 

Also, if my model has a "Range" attribute such as "[Range(0, long.MaxValue, ErrorMessage = "Value must be positive")]", the numeric text box HTML helper causes the same error that the template is not formed correctly.

I realize that within templates JavaScript has a different notation such as #if(a=b){# ... #}#.  However this type of notation doesn't work either.  For example, I would like to include the following JavaScript code under my kendo numeric text box so that when the user clicks inside the box the value within gets selected, but this code causes an error.

<script>
     $("#TextBox").focus(function () {
         var input = $(this);
         setTimeout(function () {
             input.select();
         });
     });
 </script>

 

I don't know what I'm doing wrong, and I can't find the right documentation that would describe how to get something like this scenario to work.   Any help is appreciated.  Thanks.

Shawn A.

 

 

Shawn
Top achievements
Rank 1
 asked on 01 Aug 2019
1 answer
114 views

Example task "Task_A" and task "Task_B" are linked by the dependency "Finish to Start" (FS).
https://docs.telerik.com/devtools/aspnet-ajax/controls/gantt/server-side-programming/objects/dependencies

1. Your control can execute the following script:
  - if the "end date" of the task "Task_A" changes, does the "start date" of the task "Task_B" change?

Your control can execute the following script:
  - if the "end date" of the task "Task_A" changes, does the "start date" of the task "Task_B" change?

I tried to do it in the demo version. But, if I did everything right, then it does not work for me.
https://demos.telerik.com/aspnet-ajax/gantt/examples/overview/defaultcs.aspx

2. Do you have a different web control(Gantt) that can solve the problem of p. 2?

(ASP.NET AJAX, ASP.NET MVC, Blazor, PHP, JSP, Silverlight)

Peter Milchev
Telerik team
 answered on 01 Aug 2019
12 answers
624 views

hi ,

I am going to add a kendo Menu to my existing ASP.NET Core 2.2 MVC app.

Two questions come to mind : 

1.Do I add the menu to _Layout.cshtml ? 

2.how to security trimming . I'm using Azure Active directory (example controller decoration     [Authorize(Policy = "CanAccessAdminGroup")]  

 

Any examples ?

Thanks alot in advance,

Peter

Ivan Danchev
Telerik team
 answered on 31 Jul 2019
2 answers
173 views

I'm trying to implement the example I'm seeing here: https://demos.telerik.com/aspnet-core/autocomplete/serverfiltering.  My code is identical to what is provided in the example.

When using the demo on this page, I see the URLs like this (I'm pulling these from developer tools in the browser):

https://demos.telerik.com/aspnet-core/Home/GetProducts?text=test&filter%5Bfilters%5D%5B0%5D%5Bvalue%5D=test&filter%5Bfilters%5D%5B0%5D%5Boperator%5D=contains&filter%5Bfilters%5D%5B0%5D%5Bfield%5D=ProductName&filter%5Bfilters%5D%5B0%5D%5BignoreCase%5D=true&filter%5Blogic%5D=and

The key I want to point out here is that "text=test" is passed on the querystring to my backend page.

However, when I do this in my development environment, no "text" key is passed, I do however have all the filter keys being passed.

Am I doing something wrong?  My code is literally the same as in the example.

Thanks!

Michael
Top achievements
Rank 1
 answered on 31 Jul 2019
2 answers
104 views

Hi,

My start date is  "Start": "2019-07-27T00:00:00Z" <-- I assume this means UTC with zero offset.

I am curious about the 3 timezone fields :
"Timezone": null,
"StartTimezone": null,
"EndTimezone": null,

Currently they are null. But I assume I should be setting them to avoid future problems. Any code examples I can look at ?

Thanks,Peter

Nencho
Telerik team
 answered on 31 Jul 2019
4 answers
569 views
Hi,

How do you select the selection mode (single vs. multiple and cell vs. row) using tag helpers to create a grid?

Thanks!
Nikolay
Telerik team
 answered on 30 Jul 2019
2 answers
94 views

Is there a way to control the width of the controls (whether they be a textbox, or fk combo etc) in the inline edit mode?

Any sample code would be greatly appreciated.

THanks … Ed

 

Randy Hompesch
Top achievements
Rank 1
 answered on 28 Jul 2019
2 answers
1.0K+ views

Hi,

How can I add the default edit and delete buttons to a grid row template?

Thanks … Ed

 

Randy Hompesch
Top achievements
Rank 1
 answered on 28 Jul 2019
1 answer
67 views

SInce the dropdownlistFor has no id, how to get/set value?

Thanks … Ed

 

Marin Bratanov
Telerik team
 answered on 26 Jul 2019
17 answers
1.4K+ views

I am trying to implement a drop down list in a grid using the ForeignKey editor template. The grid edit mode is InCell. The “ForeignKey.cshtml” file is in my “Shared > Editor” Templates directory, and I have decorated my ViewModel attribute with the “ForeignKey” UIHint. Everything looks great when the grid loads (the correct text value displays for each grid item. See attached screenshot). Upon attempting to edit a grid item, however, the text display value changes to its corresponding numeric id value and the dropdownlist fails to load. Basically, it just looks like a regular textbox with the foreign key ID as the value. Screenshots are attached for reference. Relevant code is also below for reference. Thanks.

Relevant ViewModel property:

[UIHint("GridForeignKey")]

public int ManagerID { get; set; }

 

Relevant Grid code within the View file:

....

.Columns(columns =>
                     {
              columns.Bound(p => p.Code).Width(120).HeaderHtmlAttributes(new { style = "height: auto; white-space: normal; vertical-align: middle;" });
                            columns.Bound(p => p.Name).Width(120).HeaderHtmlAttributes(new { style = "height: auto; white-space: normal; vertical-align: middle;" });
                            columns.Bound(p => p.StartDate).Width(120).HeaderHtmlAttributes(new { style = "height: auto; white-space: normal; vertical-align: middle;" });
                            columns.Bound(p => p.EndDate).Width(120).HeaderHtmlAttributes(new { style = "height: auto; white-space: normal; vertical-align: middle;" });
                            columns
                                .ForeignKey(p => p.ManagerID, (IEnumerable<GCEdge.Models.ViewModels.CustomerViewModels.ProjectManagerLookupViewModel>)ViewData["projectManagerLookups"], "ManagerID", "Name")
                                .EditorTemplateName("GridForeignKey")
                                .Title("Manager")
                                .Width(150)
                                .HeaderHtmlAttributes(new { style = "height: auto; white-space: normal; vertical-align: middle;" });

                            
                            columns.Bound(p => p.Active).Width(120).HeaderHtmlAttributes(new { style = "height: auto; white-space: normal; vertical-align: middle;" });
                        })

 

GridForeignKey.cshtml Editor Template:

@model object
           
@(
 Html.Kendo().DropDownListFor(m => m)    
        .OptionLabel("Please select")    
        .BindTo((SelectList)ViewData[ViewData.TemplateInfo.GetFullHtmlFieldName("") + "_Data"])
)

Controller method that loads the IEnumerable collection into the ViewData object:

private void LoadProjectViewData(int ID, string Code)
        {
            IEnumerable<ProjectManagerLookupViewModel> PMs = _context
                .Employees
                .ToList()
                .Select(e => new ProjectManagerLookupViewModel
                {
                    ManagerID = e.ID,
                    Name = e.LastName + ", " + e.FirstName
                })
                .ToList();

            ViewData["rootID"] = ID;
            ViewData["projectManagerLookups"] = PMs;

            if (ID > 0)
            {
                ViewData["rootCode"] = Code;
            }
            
            LoadCustomerLookup();
        }

 

Viktor Tachev
Telerik team
 answered on 26 Jul 2019
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?