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

Hi everyone, I am trying to implement the following functionalities with Grid and Server side filtering/paging:

  • For the "Subject" column, I would like a dropdown with the ability to choose between two static values: "NPF" and "PF".

columns.Bound(p => p.TipoSoggetto).Groupable(false).Filterable(ftb => ftb.UI("tipoSoggettoFilter"));

 

And the script --> function tipoSoggettoFilter(element) { element.kendoDropDownList({ dataSource: { data: ["NPF", "PF"] } }); }


  • For the "Operator" column, I would like to display a dropdown with values taken from a list item with value and text. I can see the dropdown and the filter works, but I don't see the corresponding text value in the grid; the cell simply remains empty (even though the filter works correctly).

var operatori = _ctx.Users.OrderBy(u => u.Email).Select(e => new SelectListItem
        {
            Text = e.NomeOperatore,
            Value = e.Id.ToString()
        }).ToList();
        ops.AddRange(operatori);
        ViewData["Operatori"] =  new SelectList(ops, "Value", "Text");
        ViewBag.Operatori = new SelectList(ops, "Value", "Text");
And in view:
@(Html.Kendo().Grid<AVR.Models.Output.GetAllAvr>()
            .Name("AVRgrid")
            //.ToolBar(t => t.Search())
            .Columns(columns =>
            {
               
                columns.Bound(p => p.DataInserimento).Format("{0:dd/MM/yyyy}").Groupable(false);
                columns.Bound(p => p.Subject).Groupable(false).Filterable(ftb => ftb.UI("tipoSoggettoFilter"));
                columns.ForeignKey(p => p.UserId, (System.Collections.IEnumerable)ViewData["Operatori"], "Text", "Text")
                    .Title("Operator").Width(200);
                columns.Command(command =>  command.Custom(" ").IconClass("fa-solid fa-eye").Click("showDetails")).Width(45);
            })
            .Pageable(p => { p.PageSizes(new[] { 10, 20, 30 }); })
            .Sortable()
            //.Scrollable()
            .Groupable()
            .Filterable(ftb => ftb.Mode(GridFilterMode.Row))

            .DataSource(dataSource => dataSource
                .Ajax()
                .Model(model =>
                {
                    model.Field(p => p.UserId).DefaultValue(1);
                })
                .PageSize(10)
                .Read(read => read.Action("GetAllFiltered", "AVR"))
            )
        )
What am I doing wrong in these two approaches? Is it possible to do this, or do I need additional jQuery support?
Mihaela
Telerik team
 answered on 13 Sep 2024
1 answer
108 views
I have a kendo grid to which grouping is applied. Group expand/collapse is working fine when grid has non editable columns. But when I add one editable column to columns collection, grid's expand collapse stopped working. Please provide any workaround to this issue.
Eyup
Telerik team
 answered on 13 Sep 2024
1 answer
133 views

I have the following bit of configuration on a grid:

<filterable enabled="true" extra="true">
    <operators>
        <date isnotnull="Is set" isnull="Is not set" lt="Before" gte="On or after" />
    </operators>
</filterable>

which results in the filter menu in the attached image.  The problem is there is no obvious way for a user to select a single criteria.  The And/Or dropdown doesn't have a "Just The Above" option.  From looking at what is sent to the server side in the debugger, I found that if the user picks a second condition which requires an argument (such as equal, not equal, before, after, etc.) but doesn't provide the argument then the filter menu logic will only include the top condition.  But that's not particularly intuitive to users.  And given that the first condition in the list on my date columns (and hence the default) is "Is Not Set", then users would have to explicitly change the bottom condition in order to only have a single condition.

 

 

Mihaela
Telerik team
 answered on 11 Sep 2024
1 answer
67 views

Hello everyone,
I’m trying to use expansion panels in a way that the content is loaded only when the panel is opened. So when the user clicks on a panel, they might see the loading icon and then see the data received from the server. Is it possible to do this?

 

Thank you

Alexander
Telerik team
 answered on 10 Sep 2024
1 answer
135 views

I am looking at using the scheduler control (Restrictions in ASP.NET Core Scheduler Component Demo | Telerik UI for ASP.NET Core)

I see there are various ways to restrict appointments, is there a way to do so where certain dates would not allow appointments?  I need to restrict holidays and other specific dates from containing appointments.  

Also, is there a way to restrict appointmetns to specific business hours.  In the demo it has a button to Show Business Hours but appointments don't seem to be restricted to those hours - I was able to schedule one outside of business hours.

Last, is there a way to note certain dates with a specific background color? I want holidays to be clearly shown so it's easier on the user.

Thanks!

 

Ivan Danchev
Telerik team
 answered on 10 Sep 2024
1 answer
97 views

I have a menu component on my view, which gives access to actions that relate to the current record on screen - so in effect I need to have the menu items have URLs similar to the following :

/Controller/Action/{cust_id}/{action_type}

Where {cust_id} will relate to the main record loaded, and {action_type} is rendered from a list within the model of all the available actions. The text for the URLs need to show the action name.

I have tried binding my menu to the Model as per the code below - is there a  recommended way to pass in the variable elements, or do I have to abandon the ActionName and ControllerName below, and just construct the whole Url manually? I have put pseudo code in to show what I mean :

@( Html.Kendo().Menu() .Name("menu") // The name of the Menu is mandatory. It specifies the "id" attribute of the widget. .BindTo(Model.TaskTypes, mappings => { mappings.For<CRM.Core.CRM.TaskType>(binding => binding // Define the first level of the Menu. .ItemDataBound((item, type) => // Define the mapping between the Menu item properties and the model properties. { item.Text = type.TaskTypeName; item.ActionName = "New"; item.ControllerName = "Task";
item.SomePropertyHere = model.CustomerId; item.SomeOtherPropertyHere = type.TaskTypeId; })); }) )



Mihaela
Telerik team
 answered on 09 Sep 2024
1 answer
80 views

I define my menu using taghelpers.  I see that the HTML helpers allow security trimming with the HideParent feature, but it appears that the taghelpers only support a boolean for security trimming and hence no way to enable the HideParent feature.  Is that true? Or is there a way to enable it?

Additionally, is there any server-side hook that can be used with the taghelper where I can perform custom filtering after the security trimming has been run but before the menu has been rendered to HTML?   This would be a workaround if HideParent is not available, as well as allow for custom filtering such as removing extra menu separators, etc.

Eyup
Telerik team
 answered on 04 Sep 2024
1 answer
225 views

Hi Team,

After upgraded kendo components and using bootstrap 5 as shown below:

"@progress/kendo-theme-bootstrap": "^8.0.1",
"@progress/kendo-ui": "^2024.2.514",
"@types/esprima": "^4.0.5",
"@types/he": "^1.2.2",
"@types/kendo-ui": "^2023.2.5",
  "bootstrap": "^5.2.1",

The export Excel in kendo TreeList triggering an error:

TypeError: data.slice is not a function
    at init.success (kendo.data.js:3858:1)
    at success (kendo.data.js:3748:1)
    at options.success (kendo.data.js:2219:1)
    at fire (jquery.js:3496:1)
    at Object.fireWith [as resolveWith] (jquery.js:3626:1)
    at done (jquery.js:9786:1)
    at XMLHttpRequest.<anonymous> (jquery.js:10047:1)

Here is the code I am using, the exporting Excel is not working, could someone please help ?

@(
Html.Kendo().TreeList<DevelopmentEmployeeDirectoryRemoteModel>()
    .Name("development-tree-list-basic")
    .DataSource(dataSource => dataSource
    .Read(read => read.Url($"{Url.Content("~")}/Development?handler=KendoTreeListDataSourceRead").Data("forgeryToken"))
    .Model(m =>
    {
        m.Id(f => f.EmployeeId);
        m.ParentId(f => f.ReportsTo).Nullable(true);
        m.Field(f => f.FirstName);
        m.Field(f => f.LastName);
        m.Field(f => f.ReportsTo);

    })
    .ServerOperation(false))
    .Columns(columns =>
        {
            columns.Add().Field(f => f.FirstName).Width(250);
            columns.Add().Field(e => e.LastName);
            columns.Add().Field(e => e.Position);
            columns.Add().Field(e => e.Extension).Title("Ext").Format("{0:#}");
        })
    .Toolbar(tools => {                                            
        tools.Pdf();
        tools.Excel();
        tools.Spacer();
        tools.Search();
    })    
    .Excel(excel => excel.FileName("Kendo UI TreeList Export.xlsx").ProxyURL(Url.Action("Excel_Export_Save", "Development")))
    .Pdf(pdf => pdf.FileName("Kendo UI TreeList Export.pdf")
               .AllPages()               
               .PaperSize("A4")
               .Margin("2cm", "1cm", "1cm", "1cm")
               .Landscape(true))
    //.ColumnMenu()
    .Filterable()    
    .Selectable(true)
    .Scrollable(false)
    .Sortable()
    .Resizable(true)
    .Reorderable(true)
    .Deferred(true)
)


 

Anton Mironov
Telerik team
 answered on 28 Aug 2024
1 answer
77 views

Hi there,

is there any way to dowload and try trial version of Kedno.UI Core for Asp.Net core 3.1? The newest version does not support .net core 3.1.

Alexander
Telerik team
 answered on 28 Aug 2024
1 answer
113 views

I've got a vexing problem with this inherited code base.

The application has dozens of reports. Each report has two datepickers, StartDate and EndDate. 

As part of a company-wide migration, we're upgrading all of our projects to the latest frameworks and nuget packages. I did that with this application. I'm now using Telerik UI for ASPNET Core 2024.2.514. The previous version was 2020.1.114. 

While in test, the users are reporting that numbers are off from what's in production. Before, if they entered an end date of 7/1/2024, the Value that got passed into the query was inclusive of everything that happened on 7/1. In the current version, it looks like the Value is non-inclusive, so end date is 7/1/2024 00:00:00. 

The only thing I've done to the application is upgrade these packages, and the only thing that affects these date ranges was upgrading the Telerik UI.

So - first things first - does a datepicker (not datetimepicker) ALWAYS default to 00:00:00 as the time portion? Across these versions?

Thanks for any info. Let me know if there's any other info I can provide. 

Anton Mironov
Telerik team
 answered on 27 Aug 2024
Narrow your results
Selected tags
Tags
+? more
Top users last month
Cynthia
Top achievements
Rank 1
Iron
Toby
Top achievements
Rank 3
Iron
Iron
Iron
Danielle
Top achievements
Rank 1
Iron
Iron
Joel
Top achievements
Rank 3
Bronze
Bronze
Iron
yw
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Cynthia
Top achievements
Rank 1
Iron
Toby
Top achievements
Rank 3
Iron
Iron
Iron
Danielle
Top achievements
Rank 1
Iron
Iron
Joel
Top achievements
Rank 3
Bronze
Bronze
Iron
yw
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?