Telerik Forums
UI for ASP.NET Core Forum
7 answers
793 views

Just an FYI for anyone who encounters the same issue i did.

 

I wanted to use Telerik UI for .Net Core however in VS2019, only the MVC options were available.

 

I checked the Progress Installer, but the option to enable VS2019 support was disabled in the Progress Installer.

The info tooltip says: "Requires Microsoft Visual Studio 2019 with .net core cross-platform development workload"

So I reran the VS Installer, but I had already installed the .net core cross-platform workload previously.

 

After googling and finding nothing online, I tried the VS installer again. I checked individual components.

I saw that core 3 sdk wasn't selected. I added that and scrolled through the full list looking for anything that may have to do with the latest .net core framework and web development.

After that was done, the Progress Installer option to support VS 2019 was available.

 

So if you have a similar issue, check the individual components tab on the VS installer.

Thanks,

Bruce

Yana
Telerik team
 answered on 19 Nov 2019
4 answers
824 views

Using EF Core 3.0 and Telerik Version 2019.3.1023.

Several controls are throwing exceptions from the toDataSourceResult Method on IQueryable Types.

These queries all worked on EF Core 2.2

example 1. Has filtering on the name fields from a kendo autocomplete

The LINQ expression 'Where, Person>>( source: OrderBy, Person>, string>( source: LeftJoin, Person, Nullable, TransparentIdentifier, Person>>( outer: Join>( outer: DbSet, inner: DbSet, outerKeySelector: (u) => u.UserInfoId, innerKeySelector: (u0) => u0.UserInfoId, resultSelector: (u, u0) => new TransparentIdentifier( Outer = u, Inner = u0 )), inner: DbSet, outerKeySelector: (ti) => ti.Outer.PersonId, innerKeySelector: (p) => (Nullable)p.PersonId, resultSelector: (ti, p) => new TransparentIdentifier, Person>( Outer = ti, Inner = p )), keySelector: (ti0) => ti0.Outer.Outer.LastName), predicate: (ti0) => Format( format: "{0}, {1}", arg0: ti0.Outer.Outer.LastName, arg1: ti0.Outer.Outer.FirstName).ToLower().Contains("powell"))' could not be translated. Either rewrite the query in a form that can be translated, or switch to client evaluation explicitly by inserting a call to either AsEnumerable(), AsAsyncEnumerable(), ToList(), or ToListAsync(). See https://go.microsoft.com/fwlink/?linkid=2101038 for more information.
public JsonResult GetUsers([DataSourceRequest]DataSourceRequest request)
        {
            try
            {
                IQueryable<UserInfoViewModel> model = UserInfoListQuery.Get((SecurityEntities)this.DbContext);
                DataSourceResult result = model.ToDataSourceResult(request);
                return Json(new DataSourceResult { Data = result.Data, Errors = null, Total = result.Total });
            }
            catch (Exception ex)
            {
                 
            }
        }

public static IQueryable<UserInfoViewModel> Get(SecurityEntities ctx, Nullable<bool> showAuthorized, Nullable<bool> showEmployees)

{

users = (from ui in ctx.UserInfo
                         join us in ctx.UserInfoStatistic on ui.UserInfoId equals us.UserInfoId
                         join p in ctx.Person on ui.PersonId equals p.PersonId into people
                         from person in people.DefaultIfEmpty()
                         orderby ui.LastName
                         select new UserInfoViewModel()
                         {                     
                             FirstName = ui.FirstName,
                             LastName = ui.LastName,                           
                         });

return users;

}

 

Example 2. has kendo grid inital sorting on a DateTime that was converted to a string

The LINQ expression 'OrderByDescending( source: Where( source: DbSet, predicate: (a) => a.UserInfoId == (Unhandled parameter: __userInfoId_0)), keySelector: (a) => a.RecordModifiedDateTime.ToString("g"))' could not be translated. Either rewrite the query in a form that can be translated, or switch to client evaluation explicitly by inserting a call to either AsEnumerable(), AsAsyncEnumerable(), ToList(), or ToListAsync(). See https://go.microsoft.com/fwlink/?linkid=2101038 for more information.
public static IQueryable<AuthenticationLogViewModel> GetAuthenticationLogForUser(SecurityEntities ctx, int userInfoId)
        {
 return (from al in ctx.AuthenticationLog
                    where al.UserInfoId == userInfoId
                    orderby al.RecordModifiedDateTime descending
                    select new AuthenticationLogViewModel()
                    {                      
                        ModifiedDate = al.RecordModifiedDateTime.ToString("g"),
                    }
}

 

public JsonResult GetAuthenticationLogForUser([DataSourceRequest]DataSourceRequest request, int userInfoId)
        {
            try
            {
                IQueryable<AuthenticationLogViewModel> model = AuthenticationLogQuery.GetAuthenticationLogForUser((SecurityEntities)this.DbContext, userInfoId);
                DataSourceResult result = model.ToDataSourceResult(request);
                return Json(new DataSourceResult { Data = result.Data, Errors = false, Total = result.Total });
            }
            catch (Exception ex)
            {              
            }
        }

 

 

Ianko
Telerik team
 answered on 19 Nov 2019
1 answer
98 views

In CSHTML page, I am able to display the icon image that is in SVG.

<svg class="em-c-btn__icon " data-em-icon-path="dist/unity-1.1.0/images/em-icons.svg">
         <use xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="dist/unity-1.1.0/images/em-icons.svg#icon-link"></use>
</svg>

However, it is not being displayed when it is bounded to Template column in Grid. 

Code for CSHTML

@(Html.Kendo().Grid<UserModel>()
        .Name("Grid")
        .Columns(columns =>
        { columns.Template("#=actionTemplate(data)#").Title("Actions").Media("(min-width: 450px"); })))

<script id="action-template" type="text/x-kendo-template">
    <svg class="em-c-btn__icon " data-em-icon-path="dist/unity-1.1.0/images/em-icons.svg">
            <use xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="dist/unity-1.1.0/images/em-icons.svg#icon-link"></use>
        </svg>
</script>

<script>
    var actionTemplate = kendo.template($("#action-template").html());
</script>

Please advise

Petar
Telerik team
 answered on 18 Nov 2019
3 answers
231 views

Hello. I am trying to create the below inside a Grid.

                     <div class="btn-group">
                                        <button data-toggle="dropdown" class="btn btn-outline-dark btn-sm"><i class="fa fa-ellipsis-h"></i></button>
                                        <ul class="dropdown-menu">
                                            <li><a class="dropdown-item" asp-page="./Details" asp-route-id="@item.ID"><i class="fa fa-eye"></i> Details</a></li>
                                            @if ((await AuthorizationService.AuthorizeAsync(
                                                  User, item,
                                                  PaymentOperations.Update)).Succeeded)
                                            {
                                                <li><a class="dropdown-item" asp-page="./Edit" asp-route-id="@item.ID"><i class="fa fa-pencil"></i> Edit</a></li>
                                            }
                                            @if ((await AuthorizationService.AuthorizeAsync(
                                                User, item,
                                                PaymentOperations.Delete)).Succeeded)
                                            {
                                                <li><a class="dropdown-item" asp-page="./Delete" asp-route-id="@item.ID"><i class="fa fa-trash"></i> Delete</a></li>
                                            }
                                            </ul>
                                    </div>

Sample Code will be much appreciated.

Regards.

Alex Hajigeorgieva
Telerik team
 answered on 18 Nov 2019
3 answers
102 views

Hi, this is my first time exploring the Grid in ASPNET.CORE. I am unable to display the grid on the page with the bare minimum by following the Grid Example (Index Controller and View). Please be rest assured that there is data being returned by the repository.

I am assuming that the Findings_Read([DataSourceRequest] DataSourceRequest request) will be called upon loading. However, it is not called at all. This is not the case when running the Telerik Trial Examples.

Please see the attached files for what I have written.

Let me know what am I missing here.

Viktor Tachev
Telerik team
 answered on 18 Nov 2019
1 answer
78 views

Hello,

I am trying to create a row with a nested grid template. In order to post for creation of new record in database I need to relate the child grid with the parent grid. If I add more rows I need this Id to increment, so parent and child grid will have the same Id.

How can I manage this? am I doing it the correct way? May you please provide me with an example?

Eyup
Telerik team
 answered on 18 Nov 2019
1 answer
67 views

Is there any example, how to drag and drop between two TreeLists like in the Drag and Drop example from Ajax: https://demos.telerik.com/aspnet-ajax/treelist/examples/itemsdragdrop/defaultcs.aspx

 

 

Viktor Tachev
Telerik team
 answered on 15 Nov 2019
16 answers
1.4K+ views

This worked in .NET 4. not so in Core. Is there an alternative to custom popup templates ???

.ToolBar(toolBar => {toolBar.Create();})
.Editable(e => { e.Mode(GridEditMode.PopUp); e.TemplateName("MaterialEdit");})
.Navigatable()

Viktor Tachev
Telerik team
 answered on 14 Nov 2019
1 answer
654 views

According to the demo at 

https://demos.telerik.com/aspnet-core/grid/paging

the range and total count of items does display in the far right of the grid paging control.  For example, the demo example displays initially "1 - 10 of 830 items".

In my use of the grid pager, it used to work fine just like in the demo with a range and total count of items displayed. But now with the current version 2019.3.1023 of UI for ASP.NET Core, the range and total count of items are no longer displayed with the grid pager.  Have defaults changed?  Or has the feature been removed?

What has changed? Or is it a bug?  Or perhaps just a problem in my hands on my machine?  Does anybody else have this problem?

Thanks, Carl

Alex Hajigeorgieva
Telerik team
 answered on 14 Nov 2019
5 answers
402 views

Im implementing a ViewComponent in a RazorPages application that includes two dropdownlists.  The primary would be returned with the initial view, the 2nd would be called via ajax.

Questions:
- Does the ViewComponent even need a model if I am using using a method in my VC to return data for the primary dropdown?
- If using using RazorPages, what is the syntax for the DataSource read action, which expects an MVC controler name and action?
Since the controller name is the name of the viewcomponent in this case and action would be something like "Handlers?handler=MyMethod

Petar
Telerik team
 answered on 13 Nov 2019
Narrow your results
Selected tags
Tags
+? more
Top users last month
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Sergii
Top achievements
Rank 1
Iron
Iron
Iron
Dedalus
Top achievements
Rank 1
Iron
Iron
Lan
Top achievements
Rank 1
Iron
Doug
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Top users last month
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Sergii
Top achievements
Rank 1
Iron
Iron
Iron
Dedalus
Top achievements
Rank 1
Iron
Iron
Lan
Top achievements
Rank 1
Iron
Doug
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?