Telerik Forums
UI for ASP.NET MVC Forum
1 answer
39 views

I'm upgrading an application from a 2020 version of Kendo UI to version 2023.3.1010.  An issue I'm having is with a grid that has the row colour set via client templates.

For alternating rows this works, but for others the colour is made almost unnoticeable by the grids alternating row colours (image attached). In this example all rows should be tinted red (but this is dependent on the data being shown and is controlled in the model).

The grid definition is below:-


 @(Html.Kendo().Grid<WLI_Payments.Models.View_Requests_Master>
    ()
    .Name("Grid")

    .Columns(col =>
    {
        col.Bound(o => o.RequestID).Title("Ref.").ClientTemplate("<span style='#=PaymentReviewColour#'> #=RequestID#</span>");
        col.Bound(o => o.Directorate).Title("Directorate").ClientTemplate("<span style='#=PaymentReviewColour#'> #=Directorate#</span>");
        col.Bound(o => o.Site).Title("Site").ClientTemplate("<span style='#=PaymentReviewColour#'> #=Site#</span>");
        col.Bound(o => o.SessionDate).Title("Date").ClientTemplate("#=sessionDateToShowInPaymentReview#");
        col.Bound(o => o.PlannedStart).Title("Planned Start").ClientTemplate("#=PlannedStartToShowInPaymentReview#").HeaderHtmlAttributes(new { style = "overflow: visible; white-space: normal" });
        col.Bound(o => o.PlannedEnd).Title("Planned End").ClientTemplate("#=PlannedEndToShowInPaymentReview#").HeaderHtmlAttributes(new { style = "overflow: visible; white-space: normal" });
        col.Bound(o => o.MedicName).Title("Planned Practitioner").ClientTemplate("<span style='#=PaymentReviewColour#'> #=MedicName#</span>").HeaderHtmlAttributes(new { style = "overflow: visible; white-space: normal" });
        col.Bound(o => o.SessionType).Title("Type").ClientTemplate("<span style='#=PaymentReviewColour#'> #=SessionType#</span>");
        col.Bound(o => o.PointOfDelivery).Title("Point of Delivery").ClientTemplate("<span style='#=PaymentReviewColour#'> #=PointOfDelivery#</span>");
        //col.Bound(o => o.ForecastCost).Title("Planned Cost").Format("{0:C}").HtmlAttributes(new { style = "#=PaymentReviewColour#" });
        col.Bound(o => o.ForecastCost).Title("Planned Cost").ClientTemplate("#=ForecastCostToShowinPaymentReview#");
        col.Bound(o => o.CurrentPaymentApprovalPositionName).Title("Position").ClientTemplate("<span style='#=PaymentReviewColour#'> #=CurrentPaymentApprovalPositionName#</span>");
        col.Bound(o => o.CurrentPaymentApproverName).Title("Approver").ClientTemplate("<span style='#=PaymentReviewColour#'> #=CurrentPaymentApproverName#</span>");

        //col.Bound(o => o.PaymentStatus).Title("Status").HtmlAttributes(new { style = "#=PaymentReviewColour#" });
        col.Bound(o => o.RequestID).Title("").ClientTemplate("<button style='#=ShowPaymentReviewButton#' onclick='reviewRequest(#=RequestID#,\"#=CurrentPaymentApproverName#\");' class='btn btn-primary btn-xs' title='Review' data-toggle='tooltip' data-placement='top'><span class='bi bi-eye-fill' ></span></button>").HtmlAttributes(new { style = "#=PaymentReviewColour#" }).Filterable(false).Sortable(false);



    })
    .Size(ComponentSize.Small)
    .Events(e => e.DataBound("onBound"))
        .DataSource(ds => ds
        .Ajax()
        .Model(m => m.Id(p => p.RequestID))

        .PageSize(20)
        .Read(rd => rd.Action("RD_PaymentRequests_To_Review", "PaymentReview").Data("gridFilter")

        )

        )

        .Pageable(p => p.Refresh(true))
        .Sortable()

        .Filterable()

            )

The PaymentReviewColour will either be empty or "color:rgb(0,125,0);font-style:italic;";

How can I turn off the alternating row colours (or just ensure the colour displays for all rows)?

 

Thanks

Ivan Danchev
Telerik team
 answered on 01 Dec 2023
1 answer
60 views

Hello Community

 I'm currently facing an issue with utilizing PostgreSQL stored procedures and select queries in my reports when attempting to use dynamic parameterized input. Despite various attempts, I haven't been able to achieve the desired outcome.

Specifically, I am encountering challenges when trying to incorporate dynamic parameters into my stored procedures or select queries for report generation. The reports seem to be unable to properly handle dynamic input, and I'm struggling to identify the root cause of the problem.

If anyone has experience or insights into efficiently using dynamic parameterized input with PostgreSQL stored procedures or select queries for reports, I would greatly appreciate your guidance. Additionally, any examples or best practices related to this issue would be invaluable.

 

Thank you in advance for your time and assistance.

Eyup
Telerik team
 answered on 21 Nov 2023
0 answers
37 views
I have a ASP.NET MVC Grid


        @(Html.Kendo().Grid<SysViewModel>()
            .Name("grid")
            .Columns(columns =>
            {
                columns.Command(command =>
                {
                    command.Edit()
                    .Text("edit")
                    .UpdateText("update")
                    .CancelText("cancel");
                    command.Destroy().Text("delete");
                }).Width("8rem");

                columns.Bound(p => p.Id)
                    .Title("ID")
                    .Width("5rem");

                columns.Bound(p => p.CompanyId)
                    .Title("Company")
                    .ClientTemplate("#:CompanyName#")
                    .EditorTemplateName("CompanyList")
                    .Filterable(ftb => ftb.Multi(true).CheckAll(true))
                    .Width("15rem");
As you can see the column shows CompanyName, but is bound to CompanyId.

When trying to get filter with checkboxes for company, using:

Filterable(ftb => ftb.Multi(true).CheckAll(true))
I get the checkboxes with CompanyId.

Is there any way to show the CompanyName instead of the CompanyId with the checkbox filter?



Azhar
Top achievements
Rank 1
Iron
 updated question on 20 Nov 2023
1 answer
47 views

I have a kendo chart with two line series which have the same colour, but have different dash types, dotted and solid. On the chart legend, both series appear with solid lines, but I want the legend to have the dash type displayed - dotted or solid.

Using the HTMLHelper, I've tried to configure the legend using some settings within, but it was not clear from the documentation how this could be configured.

https://docs.telerik.com/aspnet-core/api/kendo.mvc.ui.fluent/chartlegenditemsettingsbuilder#chartlegenditemsettingsbuilder

            .Legend(legend =>
            {
                legend.Position(ChartLegendPosition.Top);
                legend.Item(x =>
                {
                    x.Visual("handler");
                });
            })

In the handler I can see there is options.markers.type, which is currently set to "rect", but from this API reference, there does not seem to be a dotted line type
https://docs.telerik.com/kendo-ui/api/javascript/dataviz/ui/chart/configuration/series.markers.type

Eyup
Telerik team
 answered on 20 Nov 2023
3 answers
59 views

Hi,

 

I have a scheduler controle that I am showing 1 day on but I don;t want it to be a specific day I am using it to assign appointments for Monday, Tuesday, Wednesday, etc reardless of the actual date so I would like to hide the date selector, current date and the heading showing the current date as shown below:

If I could also affect the line height for the times that would be great too as they are a little tall currently.

Any help would be gratefully received.

Thanks,

 

Ian

Ian
Top achievements
Rank 1
Iron
 updated answer on 17 Nov 2023
2 answers
95 views

I am  using the PanelBar with Items Binding. I am LoadingContent on the Expansion of a Panel.  I would like to "refresh" or re load the content after a panel has been expanded, collapsed and then re-expanded.  Currently, the panel does not re-load the content.

 

Is there a way to force the panel to be re-loaded?

Antonio
Top achievements
Rank 1
Iron
 answered on 17 Nov 2023
1 answer
39 views

Hello,

we want to add editable fields in the template part of a grid.

Our grid looks sth. like this:

@( Html.Kendo().Grid(Model.TABLE) .Columns(columns => { columns.Bound(c => c.PRIO); columns.Bound(c => c.COMMENT); }) .DataSource(dataSource => dataSource .Ajax() ... .Model(m => { m.Id(p => p.ID); }) ) .ClientDetailTemplateId("template") .Editable(e => e.Mode(GridEditMode.InCell)) )

The template does look sth. like this:

<script id="template" type="text/x-kendo-template">
    <div class="col-md-6">
        <p><strong>Beschreibung:</strong></p>
        <p>#: stm_bez1 #</p>
        <p>#: stm_bez2 #</p>
        <p>#: stm_bez3 #</p>
        <p>#: stm_bez4 #</p>
        <p>#: stm_bez5 #</p>
        <p>#: stm_bez6 #</p>
        <p>#: rsc_text1 #</p>
        <p>#: rsc_text2 #</p>
        <p>#: rsc_text3 #</p>
        <p>#: rsc_text4 #</p>
        <p>#: rsc_text5 #</p>
        <p>#: rsc_text6 #</p>
    </div>
    @*
        HOW WOULD WE IMPLEMENT THE EDITABLE FIELDS HERE?
    *@
</script>

How would we go about putting these fields in the template part, and have them editable and propagate to the server on save?:

Eyup
Telerik team
 answered on 15 Nov 2023
1 answer
39 views

Hey, I'm trying to sort the data in the MultiSelectFor, so it can be displayed in alphabetical order.


                            @(Html.Kendo().MultiSelectFor(model => model.UserIds)
                                .HtmlAttributes(new { @class = "large" })
                                .Placeholder("Select users ...")
                                .DataValueField("Value")
                                .DataTextField("Text")
                                .AutoClose(false)
                                .DataSource(.DataSource(ds => ds.Read("AvailableUsers", "UserApi"))
                                 )

I've searched for this issue and tried some suggested things but with no success: 


                            @(Html.Kendo().MultiSelectFor(model => model.UserIds)
                                .HtmlAttributes(new { @class = "large" })
                                .Placeholder("Select users ...")
                                .DataValueField("Value")
                                .DataTextField("Text")
                                .AutoClose(false)
                                .DataSource(ds => ds.Custom()
                                            .Transport(t => t
                                                .Read(r => r
                                                    .Action("AvailableUsers", "UserApi")
                                                    .Data("{ any: false }")
                                                )
                                            )
                                            .Sort(s => s
                                                .Add("Value")
                                                .Descending()
                                            ))
                                
                            )


 public JsonResult AvailableUsers()
 {
     var userRepo = new UserRepository(ntfy);
    var result = userRepo.GetAll().Select(_ => new SelectListItem
           {
                Text = string.Format("{0} ({1} {2})", _.Username, _.Firstname, _.Lastname),
                Value = _.Id.ToString()
           });
     return this.Json(result, JsonRequestBehavior.AllowGet);
 }
Anton Mironov
Telerik team
 answered on 13 Nov 2023
1 answer
52 views
I've seen some examples for displaying a context menu and retrieving the data item of the row that was clicked, but is there a way to also determine which column of the grid was clicked when the context menu is displayed?
Anton Mironov
Telerik team
 answered on 10 Nov 2023
1 answer
30 views
When I updated to 2023.3.1010, the refresh button in the grid pager shows up as a pause icon. When I examine the page, the span is using k-i-arrow-rotate-cw. Is there a workaround for this?
Anton Mironov
Telerik team
 answered on 09 Nov 2023
Narrow your results
Selected tags
Tags
+? more
Top users last month
Mark
Top achievements
Rank 1
Yurii
Top achievements
Rank 1
Leland
Top achievements
Rank 2
Iron
Iron
Iron
Hon
Top achievements
Rank 1
Iron
Deltaohm
Top achievements
Rank 3
Bronze
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Mark
Top achievements
Rank 1
Yurii
Top achievements
Rank 1
Leland
Top achievements
Rank 2
Iron
Iron
Iron
Hon
Top achievements
Rank 1
Iron
Deltaohm
Top achievements
Rank 3
Bronze
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?