Telerik Forums
UI for ASP.NET Core Forum
1 answer
232 views
I need to have a fixed tabstip content body instead of collapsing based on the content size. Like minimum height or fixed height with scrollbars on overflow.
Alexander
Telerik team
 answered on 03 Feb 2022
1 answer
1.6K+ views

Question 1: I have a bool field that I want to show as a checkbox (checked if true, unchecked if false). I added it to grid as far as I know how to but I know it isn't reflecting true or false because the checkbox is unchecked even if the value is true. 

Question 2: when I check a checkbox and move on to another row, it does not stay checked and instead it reverts back to unchecked. How do I set it up so that it remains checked when I select another row? 


 @(Html.Kendo().Grid<ArusUI.Areas.PODashboard.Models.POModel>()
                        .Name("poGrid")
                        .Columns(columns =>
                        {
                            columns.Command(command => command
                                    .Custom("Print")
                                    .Click("printRow"))
                                .HtmlAttributes(new { title = "PO" })
                                .Width(150);
                            columns.Bound(p => p.resend)
                                .Title("Resend")
                                .Editable("isResendEditable")
                                .ClientTemplate("#if(poEdiObjectMode == 'EMAIL'){# <input id='resend_' onclick='resendSelect(this)' name='resend_#=poNum#_#=poReleaseNbr#_#=poRevisionNbr#' value='#=resend#' class='k-checkbox' type='checkbox' /> #} else {# <p> </p> #}#")
                                .Width(135)
                                .Filterable(ftb => ftb.Multi(true))
                                .HtmlAttributes(new { style = "text-align:center;" });
                            columns.Bound(p => p.resend)
                                .Width(110)
                                .HtmlAttributes(new { @class = "kendo-column", style = "text-align:center;" })
                                .Editable("isResendEditable")
                                .ClientTemplate("#if(poEdiObjectMode == 'EMAIL'){# <input type ='checkbox' id='poResend_#=poNum#' class='k-checkbox' /> #} else {# <input type ='checkbox'id='poResend_#=poNum#' class='k-checkbox' disabled='disabled' /> #}#");
                            columns.Bound(p => p.poNum).Width(130).Editable("readOnlyCol").HtmlAttributes(new { @class = "disabled-kendo-column" });
                            columns.Bound(p => p.poReleaseNbr).Width(130).HtmlAttributes(new { @class = "disabled-kendo-column" });
                            columns.Bound(p => p.poRevisionNbr).Width(130).HtmlAttributes(new { @class = "disabled-kendo-column" });
                            columns.Bound(p => p.poIssueDT)
                                .Width(150)
                                .Format("{0:MM/dd/yyyy}")
                                .HtmlAttributes(new { @class = "disabled-kendo-column" });
                            columns.Bound(p => p.poEdiObjectMode)
                                .Width(100)
                                .Filterable(ftb => ftb.Multi(true))
                                .HtmlAttributes(new { @class = "disabled-kendo-column" });
                        })
                            .Editable(editable => editable.Mode(GridEditMode.InCell))
                            .Selectable(selectable => selectable
                                        .Mode(GridSelectionMode.Single))
                            .Scrollable(scrollable => scrollable.Endless(true))
                            .Scrollable(a => a.Height("650px"))
                            .PersistSelection(true)
                            .Navigatable()
                            .Sortable()
                            .Filterable(filterable => filterable
                                .Extra(true)
                                .Operators(ops => ops
                                .ForString(str => str.Clear()
                                .Contains("Contains")
                                .DoesNotContain("Does not contain")
                                .IsEqualTo("Is equal to")
                                .IsNotEqualTo("Is not equal to")
                                .StartsWith("Starts with")
                                .EndsWith("Ends with")
                                .IsNull("Is null")
                                .IsNotNull("Is not null")
                                .IsEmpty("Is empty")
                                .IsNotEmpty("Is not empty"))))
                        .AutoBind(false)
                        .Excel(excel => excel
                            .FileName("PODashboard.xlsx")
                            .Filterable(true)
                            .AllPages(true)
                            .ProxyURL(Url.Action("Excel_Export_Save", "poGrid")))
                        .Reorderable(reorder => reorder.Columns(true))
                        .ClientDetailTemplateId("template")
                        .Events(e => e.DataBound("poGridDataBound"))
                        .Events(e => e.CellClose("POGridCellClose"))
                        .DataSource(dataSource => dataSource
                        .Ajax()
                        .ServerOperation(false)
                        .PageSize(25)
                        .Events(x => x.Error("onGridError"))
                        .Read(read => read.Action("GetPO","PO").Data("getPOParams").Type(HttpVerbs.Get))
                        .Model(model =>
                        {
                            model.Id(m => m.poNum);
                            model.Field(field => field.poReleaseNbr).Editable(false);
                            model.Field(field => field.poRevisionNbr).Editable(false);
                            model.Field(field => field.poIssueDT).Editable(false);
                            model.Field(field => field.poEdiObjectMode).Editable(false);
                            model.Field(field => field.resend).Editable(true);
                        })
                        ).Resizable(resize => resize.Columns(true))
                        )

function isResendEditable(e) {
    var ediType = e.poEdiObjectMode; var editable = false;
    if (ediType == "EMAIL") { editable = true; }

    return editable;
}

public class POModel
    {
        [DisplayName("Vendor")]
        public string vendorName { get; set; }
        [DisplayName("PO #")]
        public string poNum { get; set; }

        [DisplayName("Buyer")]
        public string buyer { get; set; }

        [DisplayName("Release #")]
        public string poReleaseNbr { get; set; }

        [DisplayName("Revision #")]
        public string poRevisionNbr { get; set; }

        [DisplayName("Original Issue")]
        public string poIssueDT { get; set; }

        [DisplayName("EDI Type")]
        public string poEdiObjectMode { get; set; }
  
        public bool resend { get; set; }
    }



\

Stoyan
Telerik team
 answered on 02 Feb 2022
1 answer
2.0K+ views
I am currently using a Dialog and Template on Grid change event for a custom edit form. How do I let the popup editor know to use my template for popup edit?
Francis
Top achievements
Rank 1
Iron
Iron
Iron
 answered on 02 Feb 2022
1 answer
370 views

I am using a form in a .net Core project.  I want to disable/enable a maskedtextbox based on ViewBag properties.  It works for regular text boxes, but not a masked text box.  Here is a portion of my code:

i.Add()
.Field(f => f.LastName)
.Label(l => l.Text("Last Name:"))
.Editor(e =>
{
e.TextBox().Enable(ViewBag.canEdit);
});
i.Add()
.Field(f => f.CellPhone)
.Label(l => l.Text("Cell Phone:"))
.Editor(e =>
{
e.MaskedTextBox().Mask("(000) 000-0000").Enable(ViewBag.canEdit);
});

 

Alexander
Telerik team
 answered on 02 Feb 2022
1 answer
706 views

Hey guys,

I know that your intention with the kendo button was always to render a button of type "button". Also I know you're providing a kendo form widget to render a full form with a submit button.

But isn't there any solution to achive a basic html form and then render a kendo button of type "submit"? I know I can change it with jquery manually afterwords or by registrating an function which will fire the submit again, but i would only use this when there isn't any built in solution to force it as type submit.

My intention was to render the kendo button with the tag helper and then manually set the type but it will be always overridden back to type "button" instead of keeping it as "submit".

<kendo-button name="btnSubmit" theme-color="ThemeColor.Primary" class="float-right" type="submit">
                Speichern
                @(Html.Kendo().Loader()
                    .Name("loader")
                    .HtmlAttributes(new { aria_busy = "false", aria_description = InfoMessages.LoadingOperation, aria_live = "polite" })
                    .Size(LoaderSize.Small)
                    .ThemeColor(LoaderThemeColor.Light)
                    .Type(LoaderType.InfiniteSpinner)
                    .Visible(false)
                )
            </kendo-button>

Stoyan
Telerik team
 updated answer on 02 Feb 2022
1 answer
2.3K+ views

Good afternoon,

Is there an easy way to use the built-in Grid popup edit window to only edit a few model fields rather than all of them?

I want an edit popup with three fields, update and cancel, and to prepopulate with the values from the grid row.

Can this be achieved, or will I need to build a custom popup window?

Kind regards,

Richard

Alexander
Telerik team
 answered on 01 Feb 2022
1 answer
415 views

Hey guys,

I have a problem with my HtmlHelper. My ButtonBuilder does not contain a definition for ThemeColor (like described on your demo page here). Funny is that my KendoLoader does have that. Any suggestions (see my picture)?

I had that error with the Kendo Release R3 2021 and currently I've updated to the current last version (2022.1.119) through Progress Control Panel and still it is.

FYI: @using Kendo.Mvc.UI is in my _ViewImports included. There is no change when I implement that code line into my current view.

@(Html.Kendo().Loader()
                    .Name("loaderDropDown")
                    .Size(LoaderSize.Medium)
                    .ThemeColor(LoaderThemeColor.Dark)
                    .Type(LoaderType.InfiniteSpinner)
                    .Visible(false)
                )
                @(Html.Kendo().Button()
                    .Name("btnEditPrivacy")
                    .Icon("edit")
                    .HtmlAttributes(new { style = "min-width: 27px;", title = "Datenschutzerklärung bearbeiten" })
                    .ThemeColor(ThemeColor.Primary)
                )

 

Edit:
Alright guys, it was my fault. I forgot to update my telerik nuget package. Now it's working! Thanks anyways!

Daniel
Top achievements
Rank 3
Iron
Iron
Iron
 answered on 01 Feb 2022
1 answer
140 views

I am struggling to understand how to handle create operations when ListView contents must be associated with a parent object.  To demonstrate by using examples from your docs, let's say the orders are part of a store object:

public class StoreViewModel
{
    public int StoreID {get; set;}
    IEnumerable<OrderViewModel> StoreOrders {get; set;}
    // various other fields
}

My goal is to have a View, Model type is the StoreViewModel, and a ListView showing the Orders from a specific store.  The Create function of the ListView would need to know the store ID and have it passed somehow.  I think I need something like this:

@model StoreViewModel

@(Html.Kendo().ListView<OrderViewModel>()
    .DataSource(ds => ds
        .Ajax()
        .Model(m => m.("OrderID")
        .Read(read => read
            .Action("Orders_Read", "ListView")
            .Data(@<text>@Html.Raw(Json.Serialize(Model))</text>)    
        )
        .Create(create => create
            .Action("Orders_Create", "ListView")
            .Data(@<text>@Html.Raw(Json.Serialize(Model))</text>)    
        )
    )
)

 

The controller has this method for read, which works perfectly:

public ActionResult Orders_Read([DataSourceRequest]DataSourceRequest request, StoreViewModel store)
{
    // code that returns orders from one store
}

However, when I try to create, the same .Data parameter doesn't seem to be passed:

public ActionResult Orders_Create([DataSourceRequest]DataSourceRequest request, StoreViewModel store)
{
    // misc code to make a new order and add to DB goes here
    newOrder.StoreID = store.StoreID;  // this fails
}

When looking through this with the debugger, "store" is populated in the Orders_Read method, but is null in the Orders_Create method, even though I'm trying to use them the same way.  While that's concerning, I suspect there's an overall better way to do this period.  Are there any examples that show similar scenarios with related models/objects?

 

Stoyan
Telerik team
 updated answer on 31 Jan 2022
1 answer
97 views

Good afternoon,

I have updated to the latest version of Telerik ASP.NET Core (2022.1.119).

The scrollbars are missing from the 'View HTML' window. Even the online demo is the same.

All tools in ASP.NET Core Editor Component Demo | Telerik UI for ASP.NET Core

Previously it looked like this:

Is there a fix for this?

Kind regards,

Richard

Stoyan
Telerik team
 answered on 31 Jan 2022
0 answers
249 views
We recently upgraded our Angular application from .NET Core 3.1 to .NET 6.  We are now trying to upgrade Kendo to the latest supported version.  When I try to update the Nuget package Telerik.UI.for.AspNet.Core the 2021.3.1207 package is showing as the latest supported version.  I followed the instructions on updating the package.json file, but now all of our controls are having styling issues.  I see there was a more recent release but it's not showing up as an option in the Nuget Package Manager, is there some way I can refresh that?
Nate
Top achievements
Rank 1
Iron
 updated question on 28 Jan 2022
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
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
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?