Telerik Forums
UI for ASP.NET Core Forum
2 answers
19 views

Hi,

I have been using UI for ASP.NET AJAX for over 10 years and have used the radWindow to display a page containing a details, create or edit form as follows:

window.radopen("rw/Project.aspx?Id=" + id + "&pt=" + projecttype"PopUpWin1");

 

Having finally made the leap to Razor Pages, I cannot see how to adopt this technique using UI for ASP.NET Core. I can see that you have integrated Grid and Window  create and edit functionality but, in this case, I cannot use a Telerik Grid and have to use an existing custom control with a table in it to render the data rows in a foreach loop. If it's possible, I'd prefer to keep this Razor Pages than MVC for a number of reasons. Please let me know if you need any further information.

 

Many Thanks,

Craig

Aleksandar
Telerik team
 updated answer on 16 Jun 2021
1 answer
8 views

 

Hello, 

I am:

- using the linear gauge

- have a method "FormatLongNumber" that formats the label value

- * need a way to access the current label value so that i can pass the data to the formatting function. the highlighted line below shows the call to the function. however i do not know how to pass the actual value

- the text that is highlighted in red is where i need to access the value of the current label

Thanks!

Bill

 

 

Html.Kendo().LinearGauge()
                       .Name("faultcount_#=FaultCount#")
                        .HtmlAttributes(new { data_bind = "value: FaultCount" })

                       .Scale(scale => scale
                         .Ranges(ranges =>
                         {
                             ranges.Add().From(27500).To(35000).Color("red");
                         }
                             ).Labels(label =>
                             label.Visible(true).Color("white").Template("#=FormatLongNumber(value)#")).Line(line => line.Visible(true))
                       .Vertical(false)
                           .Min(0) // Set the min value of the LinearGauge.
                           .Max(35000) // Set the min value of the LinearGauge.
                           .MajorTicks(ticks=> ticks.Color("white"))
                           .MinorTicks(mticks=> mticks.Color("white"))
                       )
                       
                       .Pointer(pointer => pointer


                           .Shape(GaugeLinearPointerShape.BarIndicator)
                           .Color("white")
                       )
Aleksandar
Telerik team
 updated answer on 16 Jun 2021
1 answer
10 views

I have a grid that is using a custom editor template (pop up). I would like when a user is ready to create a new entry, they have the choice to upload a list of files as well.

In my custom editor I have this:

 @(Html.Kendo().Upload()
            .Name("files")
            .HtmlAttributes(new { aria_label = "files" })
        )

In my Grid model, it has a member that looks like this: (Entry is the class name)

public IEnumerable<IFormFile> files {get;set;}

And my controller signature looks like this :

public ActionResult Create_Entry(Entry entry, [DataSourceRequest] DataSourceRequest request)

However Entry.files is always null. I cant seem to get the file upload widget to bind to that mode property?

I have tried adding an extra parameter for files in the controller params but that doesnt work either.

Any help is appreciated.

 

 

Aleksandar
Telerik team
 answered on 15 Jun 2021
2 answers
5 views
How do I set the default zoom option?  I need it to "Fit to screen" when it loads
Joel
Top achievements
Rank 1
Iron
Iron
 answered on 14 Jun 2021
1 answer
11 views

Hi,

Is there a UI functionality that could be called to clear all the filters on the grid? Or if this doesn't exist is there a way to just get the whole grid again?

Thanks,

Ivan

Petar
Telerik team
 answered on 14 Jun 2021
1 answer
9 views

Hi everybody,

I'm using .net Core 3.1 and Kendo for Aspnetcore and I'm very happy so far with it.

But I have a question regarding the usage of Editor Templates in Kendo Grids in combination with an active CSP (inline scripts not allowed).

Using .Deferred() is already working to show my Grid, but I'm facing an issue when I try to use editor templates. Editor templates are not rendered because of a violation of the CSP.

Is there any way to edit lines in a Kendo Grid while inline-scripting is restricted by a CSP?

Thanks!

Beatrice

Aleksandar
Telerik team
 answered on 14 Jun 2021
1 answer
8 views
Hello - I have trouble getting an inline dropdownlist to display in my grid. I believe I have followed the examples out there, but I must be missing something. Any help would be a appreciated. When I run the app this is what I "undefined" in the cells that use a dropdownlist editor and when I click on the cell to edit a text box opens up instead of a drop down list. 

Here is my setup. (non relevant elements removed).

                            @(Html.Kendo().Grid<ETModel.Areas.Admin.Models.EventTriggerGridItem>()
                            .Name("TriggerItems")
                            .Columns(columns =>
                            {
                                columns.Bound(p => p.TriggerAction).ClientTemplate("#=TriggerAction.TriggerActionName#").Sortable(false).Filterable(false).Width(150);
                                columns.Command(command => command.Custom("Delete").Click("deleteEventTrigger")).Width(95);
                            })
                            .PersistSelection()
                            .Editable(editable => editable.Mode(GridEditMode.InCell))
                            .Selectable()
                            .ClientDetailTemplateId("TriggerDetailTemplate")
                            .Scrollable(s => s.Height("auto"))
                            .Resizable(r => r.Columns(true))
                            .DataSource(dataSource => dataSource
                                .Ajax()
                                .Batch(true)
                                .Events(events => events.Error("error_handler").RequestStart("hide_validation"))
                                .Model(model =>
                                {
                                    model.Id(p => p.EventTriggerID);
                                    model.Field(p => p.TriggerAction).DefaultValue(ViewData["DefaultTriggerAction"] as GridLookupItem).Editable(true);

                                })
                                .Read(read => read.Action("EventTriggerGrid_Read", "ETModelManager", new { emodelid = Model.EModelID }))
                                .Update(update => update.Action("EventTriggerGrid_Update", "ETModelManager"))
                                .Destroy(destroy => destroy.Action("EventTriggerGrid_Delete", "ETModelManager"))
                                )
                            )


Model...

    // ETModel Builder Grid Support Classes 

    public class TriggerAction
    {
        public string TriggerActionID { get; set; }
        [UIHint("TriggerAction")]
        public string TriggerActionName { get; set; }

    }


    public class EventModelView
    {
        public List<TriggerAction> TriggerActionList { get; set; }

        public EventModelView()
        {

            
            TriggerActionList = new ModelSelectList().GridSelectList("[etm].usp_EventModelDB_GetTriggerActionList").Select(x => new TriggerAction
            {
                TriggerActionID = x.ID,
                TriggerActionName = x.Name,
            }).ToList();

        }

    }

Controller... 

            ViewData["TriggerActionList"] = emodelview.TriggerActionList;
            ViewData["DefaultActionList"] = emodelview.TriggerActionList.First();


Editor Template 

@model ETModel.Areas.Admin.Models.EventModelView
@(Html.Kendo().DropDownListFor(m => m)
    .Name("TriggerAction")
    .DataValueField("TriggerActionID")
    .DataTextField("TriggerActionName")
    .BindTo((System.Collections.IEnumerable)ViewData["TriggerActionList"])
    .OptionLabel("Select...")
    .HtmlAttributes(new { @class = "w-100" })
)








Stoyan
Telerik team
 answered on 10 Jun 2021
0 answers
9 views

I have attached the error picture, we can't find the kendo control for the following. I would appreciate if you can advice. 

 

Thanks

Miro
Top achievements
Rank 1
Iron
 asked on 10 Jun 2021
0 answers
5 views

Hi,

Any example on  Form Conditional Validation ?

Thanks

Xavier
Top achievements
Rank 1
 asked on 09 Jun 2021
1 answer
12 views

I have an asp.net core razor that contains a TreeView control, populated from a List<TreeViewItemModel> .

<form id="EditEmployees">

 <div>

                  Html.Kendo().TreeView()
                        .Name("ActiveEmployees")
                        .TemplateId("treeview")
                        .BindTo((IEnumerable<TreeViewItemModel>)ViewBag.employeeList)
                        .Checkboxes(c => c.CheckChildren(true))
                        .DragAndDrop(false)
                    )

</div>

 

       <br />

        <div class="form-group form-inline row pull-right">
            <div class="col-sm-10 ">
                <button value="Save" style="margin:0 5px;" class="btn btn-navy">Save</button>
            </div>
        </div>

</form>

My issue:
When I submit the form back to the POST Action in the Controller I would like pass the checked items.
For some reason i can't see the items

Aleksandar
Telerik team
 updated answer on 09 Jun 2021