Telerik Forums
UI for ASP.NET Core Forum
4 answers
797 views

Hi - we have a ASP.NET Core application. It has a grid in which we are prefiltering a default for one column. The filtering works fine but the .k-grid-filter class for that column does not have the k-active-state class applied as it does when we manually click the icon to filter. So the user can not see that a default filter is applied when grid is rendered.

How can we implement this - show the  default filter with class applied that lets the user know that the column has filter applied

we are using the latest 2019 version of Telerik UI for ASP.NET Core.

the default filter is applied to the datasource in this way:

 .Filter(f => f.Add(cr => cr.Ccrstatus).IsNotEqualTo("Rejected").And().IsNotEqualTo("Open"))

 

 

Viktor Tachev
Telerik team
 answered on 25 Feb 2019
4 answers
170 views

My Home view contains a grid. When a row in the grid is clicked, a window is displayed in an iframe with a spreadsheet on it.

<div>
    @(Html.Kendo().Window()
            .Name("timecard")
            .Modal(true)
            .Actions(actions => actions.Close())
            .Draggable(false)
            .LoadContentFrom("Timecard")
            .Events(events => events
                .Open("timecard_OnOpen")
                .Close("timecard_OnClose")
            )
            .Iframe(true)
            .Width(1650)
            .Height(800)
            .Visible(false)
            .Deferred(true)
    )
</div>

 

In the Open event I am using an ajax call to the controller to get data to fill the spreadsheet. Once I have the data I want to populate the spreadsheet. The spreadsheet is somewhat complex with frozen rows, merged cells, etc. so I can't use a datasource. My issue is that I cannot get access to the spreadsheet on the iFrame window to populate it with the data.

function timecard_OnOpen(e)
{
    $.ajax({
        url: '@Url.Action("Load", "Timecard")',
        type: 'POST',
        data: { id: employee_key },
        success: timecard_LoadTimecardSuccess
    });
}
 
function timecard_LoadTimecardSuccess(data)
{
    var window = $("#timecard").getKendoWindow();
    var spreadsheet = $("#timecardSpreadsheet").data("kendoSpreadsheet");
}

 

The var spreadsheet is undefined. I want to be able to do something like this:

        var spreadsheet = $("#timecardSpreadsheet").data("kendoSpreadsheet");
        var sheet = spreadsheet.activeSheet();
        var range = sheet.range('B12'); // Spreadsheet cell name
        range.value("TEST");

 

 

 

Marin Bratanov
Telerik team
 answered on 22 Feb 2019
3 answers
111 views

Hi

I have a simple grid that allow add records and one of my read only field is DateTime.Today with localized format of "dd/MM/yyyy".

When i post the record to server i got invalid date error i.e. "The value '2/19/2019 4:00:16 PM' is not valid for Date.

I tried changing the DateTime..Now.ToString("MM/dd/yyyy") but same error still show.

Can anyone help? thanks.

Jimmy
Top achievements
Rank 1
Iron
Veteran
 answered on 22 Feb 2019
2 answers
376 views
How can we disable the Excel and PDF grid toolbar buttons if there is no record count?
Reid
Top achievements
Rank 2
 answered on 21 Feb 2019
1 answer
2.1K+ views

I want to display an enumeration variables in TreeList Column , for example :

public enum TrafficType
    {
        [Display(Name = "Car-1")]
        Car = 1,
        [Display(Name = "Train-2")]
        Train = 2,
        [Display(Name = "Airplane-3")]
        Airplane = 4
    }

If Telerik Grid, I can write code as follows:

columns.Bound(p => p.Category).ClientTemplate("#=Category.CategoryName#").Width(180);

But for Treelist, how can I do?


Tsvetomir
Telerik team
 answered on 21 Feb 2019
3 answers
258 views

Hi I am using the grid in asp.net core 2.1 excellent product by the way however i am having an issue its the inline popup is display more fields than i have defined in my grid layout for example

In my grid I would be expecting just the five columns here but its displaying the entire model in the popup. Also how does one use dapper for the crud operations is that possible as I am using stored procs to keep my site fast and clean to acehieve this.

 

Also how do i color the command buttons is that simple enough?

 

columns.Bound(p => p.Name).Filterable(false);
                        columns.Bound(p => p.Description);
                        columns.Bound(p => p.ActivityDate).Format("{0:MM/dd/yyyy}");
                        columns.Bound(p => p.EmployeeName);
                        columns.Bound(p => p.Status);

@(Html.Kendo().Grid<FuelActivityTrackerDal.Models.ActivityHeader>()
                    .Name("grid")
                    .Columns(columns =>
                    {
                        columns.Bound(p => p.Name).Filterable(false);
                        columns.Bound(p => p.Description);
                        columns.Bound(p => p.ActivityDate).Format("{0:MM/dd/yyyy}");
                        columns.Bound(p => p.EmployeeName);
                        columns.Bound(p => p.Status);
                        columns.Command(command => { command.Edit(); command.Destroy(); }).Width(160);
 
                    })
                       .ToolBar(toolbar => toolbar.Create())
    .Editable(editable => editable.Mode(GridEditMode.PopUp))
                    .Pageable()
                    .Sortable()
                    .Scrollable()
                    .Filterable()
                    .HtmlAttributes(new { style = "height:550px;" })
                    .DataSource(dataSource => dataSource
                        .Ajax()
                        .PageSize(Model.Count())
                        .Read(read => read.Action("Activity_Read", "Activity"))
                    )
)
 
 
<script type="text/javascript">
    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>
Tsvetomir
Telerik team
 answered on 21 Feb 2019
1 answer
110 views

I have a webpage built on Telerik controls. I am trying to show the page in the winforms application using web browser.

I face few issues when loading the page for first time.

RadTreeview is visible with the Parent Node details and they are visible like unordered list instead of + symbol. No action could be performed.

When i do a refresh on the screen i was able to perform the actions (expand,select,etc). I am facing this issue only with the first load of the webpage in web browser.

Could you please help me on how to solve this issue?

Regards,

Supriya.

Ivan Danchev
Telerik team
 answered on 20 Feb 2019
1 answer
213 views

Hello,

Can someone please shed some light on why this is not outputting a group header total?

<column field="regularHours" title="Regular Hours"

                        template="<div style='text-align: right'>#= kendo.toString(regularHours, '0.00') #</div>"
                        group-header-template="<div style='text-align: right'> Total: #= kendo.toString(sum, '0.00') #</div>"
                        footer-template="<div>Total: #= kendo.toString(sum, '0.00') #<div>">

</column>

Both the template and the footer-template are working but I have nothing showing for the group-header-template in my grid.

Any help appreciated,

 

Georgi
Telerik team
 answered on 19 Feb 2019
5 answers
388 views
The input field generated by DatePicker is of type text. Hence, when I serialize the form in which the input is contained into json, the date is not properly formatted. Especially as the culture of the browser can be anything while the rest service the form is posted to expect a culture-invariant date. The same is true with NumerictextBox by the way.
Viktor Tachev
Telerik team
 answered on 19 Feb 2019
1 answer
205 views

I need to manage group membership.  I'll select the group then I'll need a grid on the left that represents all people currently in the group.  I then need a grid on the right representing all people available that are not in the group.  In this middle, I need an Add and Remove button.  The add button shouldn't be enabled unless the grid on the right has focus and a user is selected.  The remove button should not be enabled unless the left grid has focus and a user is selected.  

If you have an example of this type of functionality, can you please post a link.  If not, some feedback on how I would go about this using a ASP.NET Core 2.2 components would be appreciated.

Viktor Tachev
Telerik team
 answered on 19 Feb 2019
Narrow your results
Selected tags
Tags
+? more
Top users last month
Rob
Top achievements
Rank 3
Bronze
Iron
Iron
Sergii
Top achievements
Rank 1
Iron
Iron
Dedalus
Top achievements
Rank 1
Iron
Iron
Lan
Top achievements
Rank 1
Iron
Doug
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Top users last month
Rob
Top achievements
Rank 3
Bronze
Iron
Iron
Sergii
Top achievements
Rank 1
Iron
Iron
Dedalus
Top achievements
Rank 1
Iron
Iron
Lan
Top achievements
Rank 1
Iron
Doug
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?