Adding custom buttons to Kendo Window

1 Answer 162 Views
Window
Mark
Top achievements
Rank 1
Mark asked on 30 Jun 2023, 04:19 PM

we are upgrading to Telerik and we have a grid button that shows details beyond what the row is showing. 

 

i have the button and the pop up working but im unsure on how to make this ->

<div class="modal-footer">
                                        <a asp-action="UpdateClaimStatus" asp-route-claimId="@item.ClaimId" asp-route-newStatus="-1"
                                           asp-route-cycle="@Model.CycleId" asp-route-page="@(Model.Page)" asp-route-status="@(Model.StatusFilter)"
                                           asp-route-sort="@(Model.Sort)"
                                           class="btn btn-outline-secondary @(item.StatusID < 2 ? "" : "disabled")"
                                           onclick="showElement('actionShield')">
                                            <i class="fa fa-refresh"></i>
                                            Re-import Claim
                                        </a>
                                        <button type="button" class="btn btn-outline-primary" data-dismiss="modal">
                                            Close
                                        </button>

 

 

Work with this ....

@(Html.Kendo().Window().Name("Details")
    .Title("Claim Details")
    .Visible(false)
    .Modal(true)
    .Draggable(true)
//.Width(300)
)

 

thanks!!!!

1 Answer, 1 is accepted

Sort by
0
Stoyan
Telerik team
answered on 05 Jul 2023, 01:08 PM

Hello Mark,

As far as I understand you need to integrate the Html that includes ASP.NET Core TagHelper syntax into the content of the Window. If that is correct you can achieve this functionality by adding the code to the Content configuration property of the Window:

@(Html.Kendo().Window().Name("Details")
    .Title("Claim Details")
    .Visible(false)
    .Content(@<text>
                <a asp-action="UpdateClaimStatus" asp-route-claimId="@item.ClaimId" asp-route-newStatus="-1"
                                           asp-route-cycle="@Model.CycleId" asp-route-page="@(Model.Page)" asp-route-status="@(Model.StatusFilter)"
                                           asp-route-sort="@(Model.Sort)"
                                           class="btn btn-outline-secondary @(item.StatusID < 2 ? "" : "disabled")"
                                           onclick="showElement('actionShield')">
                                            <i class="fa fa-refresh"></i>
                                            Re-import Claim
                                        </a>
                                        <button type="button" class="btn btn-outline-primary">
                                            Close
                                        </button>
     </text>)
    .Modal(true)
    .Draggable(true)
)

Importantly, make sure to remove attributes and options related to Bootstrap modals because they interfere with Kendo UI PopUps.

Give the suggested approach a try in the Telerik REPL example I have prepared and let me know how it works on your side.

Regards,
Stoyan
Progress Telerik

As of R2 2023, the default icon type will be SVG instead of Font. See this blogpost for more information.
Tags
Window
Asked by
Mark
Top achievements
Rank 1
Answers by
Stoyan
Telerik team
Share this question
or