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

I have the following grid.  However, I was given the requirement that we shouldn't have the search exposed full time.  We should only display it when we have more than 1 page worth of data.  How do I accomplish this?

@using Portal.Configuration
@using Portal.Models
 
@{
    ViewData["Title"] = "Customers";
    Layout = "~/Views/Shared/_Layout.cshtml";
}
 
<h2>Customers</h2>
 
<p>
    <a asp-action="Create">Create New</a>
</p>
<div class="row">
    <div class="col-xs-18 col-md-12">
        @(Html.Kendo().Grid<Customer>()
                      .Name("grid")
                      .Columns(columns =>
                      {
                          columns.Command(command => command
                              .Custom("Detail")
                              .Click("goDetail"))
                              .Width(Glossary.ButtonWidth);
                          columns.Bound(p => p.Name)
                              .Filterable(ftb => ftb.Cell(cell => cell.Operator("contains")
                                  .ShowOperators(false)
                                  .SuggestionOperator(FilterType.Contains)));
                          columns.Bound(p => p.ProfileId)
                              .Filterable(ftb => ftb.Cell(cell => cell.Operator("contains")
                                  .ShowOperators(false)
                                  .SuggestionOperator(FilterType.Contains)));
                          columns.Bound(p => p.DatabaseStatus.Name).Title("Database Status")
                              .Filterable(ftb => ftb.Cell(cell => cell.Operator("contains")
                                  .ShowOperators(false)
                                  .SuggestionOperator(FilterType.Contains)));
                          columns.Bound(p => p.AddTimestamp).Format("{0:MM/dd/yyyy}");
                      })
                      .Pageable()
                      .Sortable()
                      .Scrollable()
                      .Filterable(ftb => ftb.Mode(GridFilterMode.Row))
                      .HtmlAttributes(new { style = "height:550px;" })
                      .DataSource(dataSource => dataSource
                          .Ajax()
                          .PageSize(20)
                          .Read(read => read.Action("IndexJson", "Customers"))
                      )
        )
 
        <script type="text/javascript">
 
            function goDetail(e) {
                e.preventDefault();
                var dataItem = this.dataItem($(e.currentTarget).closest("tr"));
                window.location.href = '@Url.Action("Details", "Customers")/' + dataItem.Id;
            }
 
            function error_handler(e) {
                if (e.errors) {
                    var message = "Errors:\n";
                    $.each(e.errors,
                        function (key, value) {
                            if ('errors' in value) {
                                $.each(value.errors,
                                    function () {
                                        message += this + "\n";
                                    });
                            }
                        });
                    alert(message);
                }
            }
        </script>
    </div>
</div>
Georgi
Telerik team
 answered on 15 Feb 2019
2 answers
1.2K+ views

Hi,

I have a treeview and I want to bind hierarchical data. 

Country

State

Offices in State

I want to make call to the controller and get the data based on the node that is being expanded. To get the right data I want send the parameter of the currently selected node (Id, level) so that I can get the appropriate data to expand. 

 @(Html.Kendo().TreeView()
              .Name("exampleTreeView")
              .LoadOnDemand(true)
              .Checkboxes(checkboxes => checkboxes
                  .Name("checkbox")
                  .CheckChildren(true)
              )
              .Events(events => events
                  .Check("onCheck")
              )
              .DataTextField("Name")
              .DataSource(dataSource => dataSource
                  .Model(model=>model.Id("Value").HasChildren("HasChildren"))
                  .Read(read => read.Action("GetData", "MyController"))
              )
              )

Right now I can get the first set of data from getdata method and bind it. want to expand a nde which will call the same action method with some additional data to get the right data. 

I have two questions - 

1. (How) can I attach or bind additional property (level which could be country,state or office)

2. How can I pass this value to the GetData Action to get the right data.

Abinash
Top achievements
Rank 1
 answered on 14 Feb 2019
1 answer
570 views

 Does combobox/dropdowns come with client side filtering built in?  Should one use comboboxes and not dropdowns for this?

Thnks.

Marin Bratanov
Telerik team
 answered on 14 Feb 2019
1 answer
110 views

Am considering use of server side filtering and paging for combobox because expecting large number of dropdown values.

What would be  the recommended number of values count for which the use of server side filering/paging is recommended?  When would one start seeing performance issues with large number of dropdown values?

Thnks.

Marin Bratanov
Telerik team
 answered on 14 Feb 2019
2 answers
52 views

Your link returns a "not found" error:

 

https://demos.telerik.com/aspnet-core/tabstrip/events

 

Alex Hajigeorgieva
Telerik team
 answered on 14 Feb 2019
3 answers
363 views

Is there a guide for creating a Asp.Net core application on Mac OS X using kendo.ui for asp.net core ?

Or just using OS Windows and IDE VisualStudio ? 

Ianko
Telerik team
 answered on 14 Feb 2019
15 answers
269 views
Hello,
I'm new to Telerik and I'm trying to run your Scheduler demo for Core in my Visual Studio 2017. I installed Telerik.UI.for.AspNet.Core(2019.1.115) in my VS 2016.
But when I copy the code from your demo I get an error in: @(Html.Kendo().Scheduler<Kendo.Mvc.Examples.Models.Scheduler.TaskViewModel>()

Under Kendo.Mvc.Examples it cannot find "Models". Did the dll changed? How can I get to Kendo.Mvc.Examples.Models.Scheduler.TaskViewModel ?
Marin Bratanov
Telerik team
 answered on 13 Feb 2019
4 answers
1.4K+ views
I am using a DateTime column with filterable options enabled. When I apply a filter on this column, the request.Filters has a valid DateTime but it is applying an incompatible format when it calls SQL Server. Here is my code:

    public async Task<JsonResult> OnGetDataAsync([DataSourceRequest]DataSourceRequest request, CustomFilterModel customFilters)
    {
        IQueryable<DAL.Product> products = this.productService.GetByCriteria(customFilters);

        JsonSerializerSettings jsonSettings = new JsonSerializerSettings()
        {
            ContractResolver = new DefaultContractResolver()
        };

        return new JsonResult(await products.ToDataSourceResultAsync(request), jsonSettings);
    }

This is what EF generates: (abbreviated for clarity)

    SELECT ....
    WHERE [p].[DateAdded] <= '2018-10-01T00:00:00.0000000'

**Error:** System.Data.SqlClient.SqlException (0x80131904): Conversion failed when converting date and/or time from character string.

Basically, the generated SQL query does not work when I run it directly in SMMS. It only works if I convert the date to **'2018-10-01T00:00:00'**

Tech stack: .NET Core 2.2, Razor Pages, Kendo 2018.3.911, SQL 2018
Paito
Top achievements
Rank 2
 answered on 13 Feb 2019
6 answers
70 views

I have two auto completes working on the main page of this application.  One on the header and one that appears when the user resizes the browser down to a smaller screen width/

Both use the same controller ajax action.  It seems the first time the user types in the values it take about 5 seconds to render matches.  And subsequent searches are instant.  

Is there a way to optimize that so that that first search is instant?  Please note that the dataset is large.  Over 10,000 products.  But that data is cached in .NET Core at application startup so it is not hitting the database again on each search or a web service, rather reading from the same cached list.  And that list is optimized to contain only two fields, the product name and primary key.

Is there a way to pre-read the data for the list to make it faster?

 

Thanks

Konstantin Dikov
Telerik team
 answered on 13 Feb 2019
3 answers
463 views

Wanting to add tooltips to column headers on the grid.

Trying:

$(document).ready(function () {
    //grid header tooltip
    $('thead [data-title]').kendoTooltip({
        content: function (e) {
            return $(e.target).text();
        },
    });
})

 

Seems to work except there appears to be spurious tooltips.  Please see attached 1.png and 2.png.

These appear to be from title attributes from within child elements.  Please see 3.png and 4.png.

In the case of 3.png the title="" attribute appears to be dynamically added.

Would like to remove the empty title="" tooltip and convert the column menu tooltip due to title="Column Menu" to be of kendoTooltip as well (preferably using single initialization step).

 

 

Edward
Top achievements
Rank 1
 answered on 12 Feb 2019
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?