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

I'm working in a migration to MVC .NET6 from .NET Framework, so in the Layout we use the following

@Html.Kendo().Splitter().Name("Splitter").Panes(p => {
p.Add().Content(RenderSection("Header", true).ToHtmlString());
p.Add().Content(RenderSection("Content", true).ToHtmlString());
});

As you can see we are using RenderSection() to take the HTML defined in other view. For each page we have the following code

But in .NET6 the same RenderSection() renders the content of the section. (has other behaviour)

There is other way to get the HTML from the sections?

 

Version: Telerik.UI.for.AspNet.Core.2020.2.513

MVC

Alexander
Telerik team
 answered on 26 Jul 2022
1 answer
228 views

Using Telerik UI for ASP.NET Core version 2021.2.511,

Some of the TagHelpers for the Wizard isn't working so I suspect I've set this project up incorrectly somehow. For what it's worth, the kendo-datepicker TagHelper works and renders correctly in the UI. However, the Wizard will not show up at all.

Here's what I've used, basically grabbed the code from the docs. The issue starts at the <wizard-step-form> tag, shows the following error: The wizard-step-form is not allowed by the parent <wizard-step> ... etc. 

The HTML Helper variation does work, however, but I'd prefer to use the TagHelper.


<div class="demo-section wide" style="width: 700px">
    <kendo-wizard name="wizard" on-done="onDone">
        <wizard-steps>
            <wizard-step title="Start">
                <wizard-step-buttons>
                    <wizard-step-button name="next" text="Next"></wizard-step-button>
                </wizard-step-buttons>
                <wizard-step-content>
                    <div class="wizardContainer">
                        <div style="text-align:center">
                            <h2>Welcome to the Registration Form</h2>
                            <h2>for the monthly Telerik seminar</h2>
                        </div>
                    </div>
                </wizard-step-content>
            </wizard-step>
            <wizard-step title="User details">
                <wizard-step-buttons>
                    <wizard-step-button name="previous" text="Previous"></wizard-step-button>
                    <wizard-step-button name="done" text="Register"></wizard-step-button>
                </wizard-step-buttons>
                <wizard-step-form name="registrationForm" orientation="vertical">
                    <validatable validate-on-blur="true" />
                    <form-items>
                        <form-item field="FirstName" html-attributes='new Dictionary<string, object> { { "required", "required" } }'>
                            <item-label text="First Name:" />
                        </form-item>
                        <form-item field="LastName" html-attributes='new Dictionary<string, object> { { "required", "required" } }'>
                            <item-label text="Last Name:"  />
                        </form-item>
                        <form-item field="Email" html-attributes='new Dictionary<string, object> { { "required", "required" } }'>
                            <item-label text="Email:" />
                        </form-item>
                    </form-items>
                </wizard-step-form>
            </wizard-step>
        </wizard-steps>
    </kendo-wizard>
</div>

 

Mihaela
Telerik team
 answered on 26 Jul 2022
1 answer
1.0K+ views

Hi All,

Is there any way to bind data from server using paging and do filtering on client side?

I have kendo  Grid and am binding  6000+ records using paging. For every page I am loading 20 records using post method but want do that filtering on client side without making any posts. Is there any way to stop serverfiltering. Do you have any suggestions?

Thanks!

 


 

 

 

Alexander
Telerik team
 answered on 26 Jul 2022
1 answer
114 views

Hi!

I have the following setup:

CsHtml:

	<div class="row mt-3">
		<div class="col-lg-4">
			@(Html.Kendo().DropDownListFor(m => m.CategoryHeadId)
			      .Size(ComponentSize.Medium)
				  .Rounded(Rounded.Medium)
				  .FillMode(FillMode.Solid)
				  .OptionLabel("Select head category...")
				  .HtmlAttributes(new { style = "width: 100%" })
				  .DataTextField("Name")
				  .DataValueField("Id")
				  .DataSource(source =>
				  {
					  source.Read(read =>
					  {
						  read.Action("GetLookupCategoriesHead", "Api");
					  });
				  })
				)
		</div>
		<div class="col-lg-4">
			@(Html.Kendo().DropDownListFor(m => m.CategoryMainId)
			      .Size(ComponentSize.Medium)
				.Rounded(Rounded.Medium)
				.FillMode(FillMode.Solid)
				.OptionLabel("Select main category...")
				.HtmlAttributes(new { style = "width: 100%" })
				.DataTextField("Name")
				.DataValueField("Id")
				.DataSource(source =>
				{
					source.Read(read =>
					{
						read.Action("GetLookupCategoriesMain", "Api")
						    .Data("filterMainCategories");
					})
					.ServerFiltering(true);
				})
				.Enable(false)
				.AutoBind(false)
				.CascadeFrom("CategoryHeadId")
				)
		</div>
		<div class="col-lg-4">
			@(Html.Kendo().DropDownListFor(m => m.CategorySubId)
				.Size(ComponentSize.Medium)
				.Rounded(Rounded.Medium)
				.FillMode(FillMode.Solid)
				.OptionLabel("Select sub-category...")
				.HtmlAttributes(new { style = "width: 100%" })
				.DataTextField("Name")
				.DataValueField("Id")
				.DataSource(source =>
				{
					source.Read(read =>
					{
						read.Action("GetLookupCategoriesSub", "Api")
						    .Data("filterSubCategories");
					})
					.ServerFiltering(true);
				})
				.Enable(false)
				.AutoBind(false)
				.CascadeFrom("CategoryMainId")
				)
		</div>
	</div>

Script:

@section Scripts {
	<script>
		function filterMainCategories() {
			return {
				headId: $("#CategoryHeadId").val()
			};
		}

		function filterSubCategories() {
			return {
				headId: $("#CategoryHeadId").val(),
				mainId: $("#CategoryMainId").val()
			};
		}
	</script>
}

Originally, this was a View on its own but later got refactored into an EditorTemplate. Since then, the second and third DropDowns are always disabled even if a parent makes a valid selection.

Console windows don't log any errors. I'm thinking it's an issue with the placement of the JS block. I tried placing it within a @Script section and directly. The thing that is really frustrating is that there are two views now using this EditorTemplate and one is working fine but the other has issues:

Create (Working):

	@using (Html.BeginForm("", "Letter", FormMethod.Post))
	{
		@Html.AntiForgeryToken()

		@Html.EditorFor(m => m, "Letter")

		<div class="row mt-3">
			<div class="col-md-1">
				<button type="submit" class="btn btn-primary w-100 me-5px" formaction="CreateSave" title="@(Model.IsUpdateCase ? "Update letter" : "Save letter")">@(Model.IsUpdateCase ? "Update" : "Save")</button>
			</div>
			<div class="col-md-1">
				<button type="submit" class="btn btn-default w-100" formaction="CreateSubmit" title="@(Model.IsUpdateCase ? "Update letter & submit" : "Save letter & submit")">Submit</button>
			</div>
		</div>
	}

ViewInfo (Not working):

	@using (Html.BeginForm("ViewInfo", "Letter", FormMethod.Post))
	{
		@Html.AntiForgeryToken()

		@Html.EditorFor(m => m.Letter, "Letter")

		<div class="row mt-3">
			<div class="col-md-1">
				<button type="submit" class="btn btn-primary w-100 me-5px" title="Submit">Submit</button>
			</div>
		</div>
	}

I have verified that the APIs are up and running and also the model for the template(s) is valid.

How do troubleshoot this behavior? And where should the script block files go per best practice? I think it should be in the template within the section.

DoomerDGR8
Top achievements
Rank 2
Iron
Iron
Iron
 answered on 25 Jul 2022
1 answer
662 views
I have a switch that I would like to bind to a model, is this possible?     
Mihaela
Telerik team
 updated answer on 25 Jul 2022
1 answer
145 views

Hello

We use Telerik UI to ASP.NET Core to build the Razor Page app.

After connecting Hebrew Localization

    <script src="~/kendo/js/jquery.min.js" asp-append-version="true"></script>

    <script src="~/kendo/js/kendo.all.min.js" asp-append-version="true"></script>

    <script src="~/kendo/js/kendo.aspnetmvc.min.js" asp-append-version="true"></script>

    <script src="~/kendo/js/kendo.culture.he-IL.min.js" asp-append-version="true"></script>

    <script src="~/kendo/js/kendo.messages.he-IL.min.js" asp-append-version="true"></script>

    <script src="~/kendo/js/jszip.min.js" asp-append-version="true"></script>

    <script>kendo.culture("he-IL");</script>

 

 

 

We get the following picture

The script file kendo.messages.he-il.js contains the following overrides

 

  /* Grid messages */

 

    if (kendo.ui.Grid) {

        kendo.ui.Grid.prototype.options.messages =

            $.extend(true, kendo.ui.Grid.prototype.options.messages, {

                "commands": {

                    "cancel": "בטל",

                    "canceledit": "בטל עריכה",

                    "create": "צור חדש",

                    "destroy": "מחק",

                    "edit": "עריכה",

                    "save": "שמור",

                    "select": "בחר",

                    "update": "עדכן"

                },

                "editable": {

                    "cancelDelete": "בטל מחיקה",

                    "confirmation": "האם הנך בטוח שברונך לבצע זאת?",

                    "confirmDelete": "אשר מחיקה"

                }

            });

    }

 

    /* Pager messages */

 

    if (kendo.ui.Pager) {

        kendo.ui.Pager.prototype.options.messages =

            $.extend(true, kendo.ui.Pager.prototype.options.messages, {

                "allPages": "All",

                "page": "עמוד",

                "display": "{0} - {1} מתוך {2} פריטים",

                "of": "מתוך {0}",

                "empty": "אין פריטים להצגה",

                "refresh": "רענן",

                "first": "לעמוד הראשון",

                "itemsPerPage": "פריטים בעמוד",

                "last": "לעמוד האחרון",

                "next": "לעמוד הבא",

                "previous": "לעמוד הקודם",

                "morePages": "עמודים נוספים"

            });

    } 

 

What we need to do to get localization at least within what is in the script?

 

Best regards

 

Mihaela
Telerik team
 answered on 21 Jul 2022
1 answer
175 views

Hi!

Why is it so difficult to have the gid set itself to 100% of the height of the container it is in? All the guides I see here are just trial and error attempts.

Here is my CSS hierarchy:

GridFullHeight.png

I need my grid to be using all available height of the container. Currently, the main grid is only taking half of the screen (450px, set internally by Kendo) and expanding the details template with a tab strip and a child grid, the look and feel just doesn't look or feel right. The child grid doesn't need to have extra length. In fact, it should do the reverse: max height just enough to show all rows and not a pixel more. How do I set this up?

Mihaela
Telerik team
 answered on 21 Jul 2022
1 answer
130 views

Hello,

Is there a way to add comments in ASP.NET Core Editor just like how you are able to on ASP.NET AJAX.

I see that I am able to use Telerik Document Processing to open a docx file and  add comments on there, but I want to be able to do that on the Editor.

 

Thank you,

Mihaela
Telerik team
 answered on 18 Jul 2022
1 answer
148 views

Hi There

I have a Grid that placed in a boostrap modal.

In this grid, there is an in cell edit column with a DropDownList as client template.

The DropDownList is not displayed, only the input box and the data is shown when enter edit mode of the cell.

No problem when placing the grid on the main body, outside the modal.

Can anyone help on how I can have the dropdownlist shown ? thanks in advance.

Alexander
Telerik team
 answered on 18 Jul 2022
5 answers
3.1K+ views

Scenario - Asp.net Core, Razor Pages     

If i have no Controller (using razor pages), is there a way to bind a column to a clientTemplate that contain some sort of Action Link or Navigation link?

I need this so a user can simple click on a link on a row in the grid whicj then does the usual "Edit, Details, Delete"

 

If i was to not have telerik grid and just us a table it would look like this:

 <td>
                <a asp-page="./Edit" asp-route-id="@item.Id">Edit</a> |
                <a asp-page="./Details" asp-route-id="@item.Id">Details</a> |
                <a asp-page="./Delete" asp-route-id="@item.Id">Delete</a>
            </td>
        </tr>
}
    </tbody>
</table>

 

Stefan
Top achievements
Rank 1
Iron
Iron
Iron
 answered on 15 Jul 2022
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?