Telerik Forums
UI for ASP.NET Core Forum
1 answer
110 views

I need to add a scope attribute  to make the KendoUI Grid 508 Compliant. How do I do that?

<th scope="col" </th>

<th scope="row"></th>

   @(Html.Kendo().Grid <PGC.Administration.ViewModels.UsersVM>()
                        .Name("users")
                        .Columns(columns =>
                        {
                            columns.Bound(p => p.UserName);
                            columns.Bound(p => p.FirstName);
                            columns.Bound(p => p.LastName);
                            columns.Bound(p => p.Email);
                            columns.Bound(p => p.LastLoginDate).Format("{0:MM/dd/yyyy hh:mm}");
                            columns.Bound(p=> p.UserPONames).Title("Program Office Names");
                            columns.Bound(p=> p.UserRoleName).Title("User Role Names");
                            columns.Command(command => { command.Custom("Edit").Click("showCreate");@* command.Destroy().Text(" ");*@ }).Width(150);
                        })

 

Alexander
Telerik team
 answered on 20 Mar 2023
0 answers
450 views

Hi all,

I'm having an issue with my TabStrip code.

Basically, .Selected and .SelectedIndex do not work to open the given tab when the page loads. I have to manually click on a tab to display it, and there is some strange formatting that makes it seem like the desired tab was selected but it was never displayed (borders around the tab etc).

I can pinpoint precisely the version of the NuGet package where this problem is introduced, and can confirm it exists up to the latest.

Code excerpt:

@(Html.Kendo().TabStrip()
    .Name(Model.SessionId + "_SessionPanelTabStrip")
    .Animation(animation => animation.Open(effect => effect.Fade(FadeDirection.In)))
    .Items(ts =>
    {
        ts.Add().Text("General")
            .Selected(true)
            .LoadContentFrom("SessionPanelGeneral", "Sessions", new {sessionId = Model.SessionId});
and this goes on further. This code works as expected up to and including the NuGet package Telerik.UI.for.AspNet.Core 2022.2.621. Any version after that, from 2022.2.802 up to and including the latest as of writing this post (2023.1.314) exhibit the issue where the tab is not selected by default when .Selected is true. 

For now I am just using the older version that is working, but I would like to upgrade at some stage to get all of the other changes in later versions. It would great if this could be fixed, whether on my end or in a future release.

Thanks
Bradley
Top achievements
Rank 1
 asked on 17 Mar 2023
2 answers
130 views

I got a grid that displays orders and details

This is the main grid:

@(
          Html.Kendo().Grid<BoWeb.Web.Models.OrderModel>().Name("gridOrders")
            .Sortable()
            .Scrollable()
            .Columns(cols =>{
              cols.Bound(col => col.OrderNr);
              cols.Bound(col => col.CreateDate).Format("{0:dd.MM.yyyy hh:mm}");
              cols.Bound(col => col.PaymentResource);
              cols.Bound(col => col.ShippingResource);
              cols.Bound(col => col.ShippingSurcharge);
              cols.Bound(col => col.TotalIncl);
            })
            .ClientDetailTemplateId("tmplOrderItem")
            .DataSource(ds => ds
              .Ajax()
              .Read(r => r.Url("/Customer/Admin?handler=ReadOrders").Data("forgeryToken"))
              .Model(m =>{
                m.Id(id => id.PKOrder);
              })
            )
            .Deferred()
        )

This works fine.

The template looks like this:

<script id="tmplOrderItem" type="text/kendo-tmpl">
  @(
    Html.Kendo().Grid<BoWeb.Web.Models.OrderItem>().Name("gridCart_#=PKOrder#")
      .Sortable()
      .Editable(edit => edit.Mode(GridEditMode.InLine))
      .Columns(cols =>{
        cols.Bound(col => col.Quantity).EditorTemplateName("IntegerEditor");
        cols.Bound(col => col.Caption);
        cols.Bound(col => col.SinglePriceIncl);
        cols.Bound(col => col.TotalPriceIncl);
        cols.Command(col =>
        {
          col.Edit().Text(" ").UpdateText(" ").CancelText(" ");
        }).Width(120);
      })
      .DataSource(ds => ds
        .Ajax()
        .Read(r => r.Url("/Customer/Admin?handler=ReadOrderItems&orderId=#=PKOrder#").Data("forgeryToken"))
        .Update(u => u.Url("/Customer/Admin?handler=UpdateOrderItem").Data("forgeryToken"))
        .Model(m =>
        {
          m.Id(id => id.FKSubItem);
          m.Field(f => f.Quantity);
          m.Field(f => f.Caption).Editable(false);
          m.Field(f => f.SinglePriceIncl).Editable(false);
          m.Field(f => f.TotalPriceIncl).Editable(false);
        })
      )
      .ToClientTemplate()
  )
</script>

The read works. No problem and data is displayed correctly.

But the update-handler is not called.

The handler looks like this:

public JsonResult OnPostUpdateOrderItem([DataSourceRequest]DataSourceRequest request, OrderItem item)
    {
      if(item != null && ModelState.IsValid)
      {

      }
      return new JsonResult(new[] { item }.ToDataSourceResult(request, ModelState));
    }

I also inject Xsrf and added 

@Html.AntiForgeryToken()

Of course there is also the

@Html.Kendo().DeferredScripts()

Any ideas why this is not working?

CPS
Top achievements
Rank 1
Iron
Iron
 answered on 15 Mar 2023
0 answers
225 views
I'm using two related listboxes to transfer data from one list to another.  In my backend, when I reference Request.Form["lstAssociated"] I can get a list of the id's from the listbox that contains the item I selected to send to the other list, however, I don't see anywhere in the data how I can obtain the ID of just the item I have selected.  We are using Razor forms.
Danielle
Top achievements
Rank 1
Iron
Iron
 asked on 14 Mar 2023
1 answer
125 views
I try to upload a 15MB xlsx file but it seems to crash/freeze my browser.
Alexander
Telerik team
 answered on 13 Mar 2023
1 answer
1.2K+ views

Hi,

How do we take a drop down with a list of values and put it on a gridview. and save the chosen values as text.

What would be the best way and easiest way ? 

For Example 

I have Table A which is bound to the Grid View. I want to show values from one of the column from Table B as a dropdown list of values in one of the column of the grid view.  There is no foreign key relationship between the tables.

2 EXAMPLE FOR IDEA:

 1) For Example : https://demos.telerik.com/aspnet-core/grid/custom-datasource

How can you add a dropdown list in the product name column, product list is coming from another table where there is no foreign key relationship

2) Another example : https://demos.telerik.com/aspnet-core/grid/foreignkeycolumnbinding  : How can we achieve category binding without a foreign key. 

Aleksandar
Telerik team
 answered on 13 Mar 2023
1 answer
579 views

Hi

I'm converting some code from Kendo MVC to Kendo aspnet core, and I've found something different, this used to work in the .cshtml

 @(Html.Kendo().Grid<AppointmentDateModel>()
          .Name("grid")
          .Columns(columns =>
          {
              columns.Template(c => { }).ClientTemplate("<div>#= TemplateString #</div>");
          })
    )

But it won't compile for Kendo asp.net core, it looks like ClientTemplate() has to be on a bound column (GridBoundColumnBuilder), rather than a template column (GridTemplateColumnBuilder).

Is there a standard way to code this, I don't have a column to bind to?

Thanks,

 


Alexander
Telerik team
 answered on 10 Mar 2023
1 answer
111 views

hi

how to refresh grid and TreeView Parent Page ?

The parent page includes grid and TreeView and I want the child page that is in the new tab
Update grid and TreeView.

Also, on the child page or the new tab, by clicked on the button, a kendo window will open in iframe mode, which I want to change the grid and TreeView after clickined the save button ، be updated on the main page.

Thanks

Alexander
Telerik team
 answered on 08 Mar 2023
2 answers
457 views
HI,
how can i add a file upload (image) in a kendo form?

I don't see item upload in the list (see image)

Thank you


n/a
Top achievements
Rank 1
Iron
 answered on 06 Mar 2023
0 answers
83 views

Hello
How can I content Script 

.ClientTemplate


transfer it to file or Partial, that is, to have a code similar to the following:


columns.Bound(e => e.TicketId).Title(" ").ClientTemplate("
 @await Html.PartialAsync("_MsgList_FileUpload_Select",new { MessageId = "#=MessageId#" })
")
thanks
Mohamad Javad
Top achievements
Rank 2
Iron
Iron
Iron
 asked on 06 Mar 2023
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?