Telerik Forums
UI for ASP.NET Core Forum
2 answers
354 views
I am attempting to set 

"Html.ViewData.TemplateInfo.HtmlFieldPrefix"

on a partial view to bind elements of a collection back to a view model.

If I set the prefix as well as overriding the id property in the dropdownlist html
the name property seems to have an extra prefix attached

 

See the Demo where the first dropdown has the id set and produces an invalid name.

The second dropdown does not have the id set and the name produced is correct.

Demo

This does not seem to occur when setting the id, prefix, and using the html helpers.

 

jovaughn
Top achievements
Rank 1
Iron
 answered on 20 Jan 2022
1 answer
108 views

When adding a data source to a TreeList using the HTML helper method Html.Kendo().TreeList<...>().DataSource(....) there is no possibility to define the data type that should be used. The data source accepts the JSON data generated by my API, but any updates are submitted using form data, The same problem appears when defining a standalone data source using the helper method Html.Kendo().DataSource<...>().TreeList(....). It is possible to change the TreeList(...) configuration to a Custom(...) configuration, however it is not possible to define the parent identifier of the model in this case.

Html.Kendo().DataSource<MyViewModel>()
        .Name("datasource")
        .TreeList(source =>
        {
            source.Batch(true);
            source.ServerOperation(false);
            source.Model(model =>
            {
                model.Id(x => x.Id);
                model.ParentId(x => x.Parent);
                model.Expanded(x => x.Expanded);
            });
            source.Read("Read", "Api");
            // No way to use JSON here
            source.Create(ajax => ajax.Action("Write", "Api").Type(HttpVerbs.Post));
            source.Update(ajax => ajax.Action("Write", "Api").Type(HttpVerbs.Put));
            source.Destroy(ajax => ajax.Action("Write", "Api").Type(HttpVerbs.Delete));
        })

Aleksandar
Telerik team
 answered on 19 Jan 2022
1 answer
113 views
Hello, if I purchase the DevCraft Ultimate bundle for $2199, then after my first year opt to NOT renew the M&S for $1,099... I understand my product will still work and I can continue to develop the my products with the license I originally purchased, I just won't be able to receive updates and support... however, if on year 3 I decide to renew, can I just get back in to M&S for just $1,099 to continue receiving updates and support? or will I have to re-purchase the whole bundle again?
Karina
Telerik team
 answered on 18 Jan 2022
1 answer
214 views

available Editor with model @model:


@model service.Models.ServiceViewModel
@(Html.Kendo().Editor()
            .Name("Description")
            .Tools(tools => tools
                .Clear()
                .Bold().Italic().Underline()
                .JustifyLeft().JustifyCenter().JustifyRight()
                .InsertUnorderedList().InsertOrderedList()
            )
            .StyleSheets(css => css
                .Add(Url.Content("~/shared/web/editor/editorStyles.css"))
            )
            .Value(@<text></text>)
            .HtmlAttributes(new { style = "width: 100%;height:400px" })
        )


public class ServiceViewModel
    {
********
        public string Description { set; get; }
*****
}

I save the data to the database.
When I pull the data to correct, the data is shown without markup.
At the same time, the data is saved as:

"&lt;p&gt;1&lt;/p&gt;&lt;p&gt;&lt;strong&gt;2&lt;/strong&gt;&lt;/p&gt;&lt;p&gt;&lt;em&gt;3&lt;/em&gt;&lt;/p&gt;"

Stoyan
Telerik team
 answered on 17 Jan 2022
1 answer
2.4K+ views

Hello, I am trying to add DatePicker to my grid. I would like for it to display the date from a field but allow users to change the date using DatePicker. The example I found works for standalone but I'm having a hard time figuring out how to implement within my grid, have it default to whatever the current value is, and allow it to be editable. 

View:

                    @(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.poNum).Width(130).HtmlAttributes(new { @class = "disabled-kendo-column" });
                            model.Field(field => field.poReleaseNbr).Editable(false);
                            model.Field(field => field.poRevisionNbr).Editable(false);
                            columns.Bound(p => p.poReviewDT)
                                .Width(150)
                                .ClientTemplate(
                                    Html.Kendo().DatePicker()
                                    .Name("poReviewDT_#=poNum#_#=poReleaseNbr#")
                                    .Value("poReviewDt")
                                    .ToClientTemplate().ToString()
                                    );
                        })
                            .Editable(editable => editable.Mode(GridEditMode.InCell))
                            .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"))
                        .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.poReviewDT).Editable(true);
                        })
                        ).Resizable(resize => resize.Columns(true))
                        )

 

Property:

[DisplayName("Review Date")]
public string poReviewDT { get; set; }

Currently the calendar button does not render until you click into the column and when you do click the calendar button, it immediately closes - so I'm definitely missing a few steps. 

Thanks

 

 

Mihaela
Telerik team
 answered on 17 Jan 2022
2 answers
404 views

Hello everyone,

I was curious if there's a way to implement an HScrollBar to a UI when the grid gets too populated to fit on one screen. Any help would be appreciated. Thank you! 

Dess | Tech Support Engineer, Principal
Telerik team
 answered on 12 Jan 2022
1 answer
150 views

Scenario pic

Hi everyone,

I would like to know is it possible to export grid data to specific row and columns via through  excelExportHandler? (As the provided Pic)

I've noticed that we could use jquery to set background color of the excel file,

Would this solve my question?

 

Stoyan
Telerik team
 answered on 06 Jan 2022
1 answer
197 views

Hi,

I want to use kendo-chat to show conversations between two people, but I want to highlight or change some message's colour and not all of them.

a simple example is like I have some initial messages that system is going to send and then two people are going to talk, so I want to change the color of the system messages to something else compare to the user's conversations

Is there any way I can do it?

Alexander
Telerik team
 answered on 05 Jan 2022
1 answer
153 views

Hi everyone,

I'm aware of there is WordProcessing component for processing documents.

I've also notice that in grid demo there are functions for exporting Excel and PDF.

Is there a  solution for exporting Microsoft .docx documentation?

Mihaela
Telerik team
 answered on 30 Dec 2021
1 answer
231 views

 

there is a form.Added element DropDownTree. When you click on the confirmation, you need to get the value in the controller Category. Preferably in the format string []. Tell me how you can get values, even in a different format.Thank you. 


<form asp-action="CreateService" asp-controller="ServiceSubmit" asp-antiforgery="true" data-ajax="true" data-ajax-method="post" data-ajax-update="#result_login_register" >
                        <input name="IsValid" type="hidden" value="@ViewData.ModelState.IsValid.ToString()" />
                        <div class="form-group">
                            <label asp-for="Name">Краткое название</label>
                            <input asp-for="Name" class="form-control" />
                            <span asp-validation-for="Name" class="text-danger"></span>
                        </div>
                        <div class="form-group">
                            <label>Категория</label>
                            @(Html.Kendo().DropDownTree()
                                .Name("Category")
                                .DataTextField("Category")
                                .HtmlAttributes(new { style = "width: 100%" })
                                .AutoClose(false)
                                .Checkboxes(checkboxes => checkboxes
                                    .Name("checkedFiles")
                                    .CheckChildren(true)
                                )
                                .DataSource(dataSource => dataSource                                    
                                    .Model(model => model
                                        .Id("IdCategory")
                                        .HasChildren("HasChildren")
                                    )
                                    .Read(read => read
                                        .Action("CategoryPodServic_Read", "ServiceSubmit")
                                    ).ServerFiltering(false)
                                )
                            )
                            @*<span asp-validation-for="Category.CategoryPod" class="text-danger"></span>*@
                        </div>
                        <div class="form-group">
                            <input asp-for="Raion" class="form-check-input" type="checkbox" value="" id="Raion">
                            <label class="form-check-label" for="Raion">
                                Выезд на район
                            </label>
                        </div>
                        <div class="form-group">
                            <label asp-for="Description">Описание</label>
                                @(Html.Kendo().Editor()
                                    .Name("Description")
                                    .HtmlAttributes(new { style = "width: 100%; height:400px" })
                                    .Tools(tools => tools
                                        .Clear()
                                        .Bold().Italic().Underline()
                                        .JustifyLeft().JustifyCenter().JustifyRight()
                                        .InsertUnorderedList().InsertOrderedList()
                                    )
                                )
                            <span asp-validation-for="Description" class="text-danger"></span>
                        </div>
                        <button class="btn btn-success" type="submit" >Сохранить</button>
                    </form>


Mihaela
Telerik team
 answered on 29 Dec 2021
Narrow your results
Selected tags
Tags
+? more
Top users last month
Jay
Top achievements
Rank 3
Bronze
Iron
Iron
yw
Top achievements
Rank 2
Iron
Iron
Stefan
Top achievements
Rank 2
Iron
Iron
Iron
Kao Hung
Top achievements
Rank 1
Iron
Bohdan
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Jay
Top achievements
Rank 3
Bronze
Iron
Iron
yw
Top achievements
Rank 2
Iron
Iron
Stefan
Top achievements
Rank 2
Iron
Iron
Iron
Kao Hung
Top achievements
Rank 1
Iron
Bohdan
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?