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

Hi, 

I want to close the dropdown list as soon as the event (it creates the confirmation pop-up) is triggered from selecting an option from the list. 

How this can be achieved.

Thanks, 

 

Aleksandar
Telerik team
 answered on 24 Oct 2022
1 answer
157 views

Hello, I would like to know if there is any way to extract the graphs from an excel sheet.  I have managed to export the content of the excel sheet but I have not been able to export the graph that is generated there

So far this is the code I handle

 


 byte[] bytes = System.IO.File.ReadAllBytes(@"path");
                Stream stream2 = new MemoryStream(bytes);

                Workbook workbook = Workbook.Load(stream2, ".xlsx");


                Telerik.Windows.Documents.Spreadsheet.Model.Workbook document = workbook.ToDocument();

                document.ActiveSheet = document.Worksheets.First(sheet => sheet.Name == "Rep.F3");
                foreach (Telerik.Windows.Documents.Spreadsheet.Model.Worksheet sheet in document.Worksheets)
                {

                    if (sheet.Name != "Rep.F3")
                    {
                        sheet.Visibility = Telerik.Windows.Documents.Spreadsheet.Model.SheetVisibility.Hidden;
                        //document.Worksheets.Remove(sheet);
                    }
                    else
                    {
                        var shapes = sheet.Shapes;
                        var img= sheet.Images;
                        sheet.WorksheetPageSetup.PaperType = Telerik.Windows.Documents.Model.PaperTypes.A4;
                        sheet.WorksheetPageSetup.PageOrientation = Telerik.Windows.Documents.Model.PageOrientation.Portrait;
                        sheet.WorksheetPageSetup.CenterHorizontally = true;
                        sheet.WorksheetPageSetup.PrintOptions.PrintGridlines = false;
                        sheet.WorksheetPageSetup.ScaleFactor = new Telerik.Documents.Primitives.Size(0.9, 1);
                        sheet.WorksheetPageSetup.Margins =
                            new Telerik.Windows.Documents.Spreadsheet.Model.Printing.PageMargins(0
                            , 20, 0, 0);
                    }

                }

 

I have tried to get the list of images and forms but it does not return any result

Stoyan
Telerik team
 answered on 21 Oct 2022
1 answer
873 views
Noticed excel export of selected rows across pages not working, is there a work around for this issue?
Alexander
Telerik team
 answered on 21 Oct 2022
1 answer
206 views

Hello,

I have followed this help article, how to bind CheckBoxGroup to model on razor page. This article does not show how to get selected values back on post. 

https://docs.telerik.com/aspnet-core/html-helpers/editors/checkboxgroup/razor-page

OnPost CheckBoxGroupModel models that is bind property, it's CheckBoxGroupValue property stays null when posted back. Only way to get values back is to read them from Request.Forms["checkboxgroup"].

Stoyan
Telerik team
 answered on 20 Oct 2022
1 answer
925 views

Hi, 

I need to add a trash can against each option of the dynamic dropdown list. 

example:

How can this be achieved?

What I have achieved so far: 

Dynamically populating the list.

Thanks,

VM

Alexander
Telerik team
 answered on 20 Oct 2022
1 answer
257 views

The three dots buttons that open column menu settings work in the last three column but no in the others. On the other hand we use kendo windows, when we change the width of window; the column menu opener buttons work properly.

Aleksandar
Telerik team
 answered on 20 Oct 2022
1 answer
150 views

I am using the below line chart.

Is there a way to have the green series area filled in with green?

I would like the green series fully colored in as green. But leave the red series as a line.

 

 

 

 

 

 

 <div class="demo-section wide">
    @(Html.Kendo().Chart()
        .Name("chart")
        .Title("Hybrid car mileage report")
        .Legend(legend => legend
            .Position(ChartLegendPosition.Top)
        )
        .SeriesDefaults(seriesDefaults =>
            seriesDefaults.Line().Style(ChartSeriesStyle.Smooth)
        )
        .Series(series =>
        {
            series
                .Line(new double[] { 1040655525 })
                .Name("mpg")
                .Color("red")
                .Axis("mpg");
            series
                .Line(new double[] { 13652 })
                .Name("l/100 km")
                .Color("green")
                .Axis("l100km");
        })
        .CategoryAxis(axis => axis
            .Categories("Mon""Tue""Wed""Thu""Fri")
            // Align the first two value axes to the left
            // and the last two to the right.
            //
            // Right alignment is done by specifying a
            // crossing value greater than or equal to
            // the number of categories.
            .AxisCrossingValue(001010)
        )
        .ValueAxis(axis => axis
            .Numeric()
                .Title("miles")
                .Min(0).Max(100)
        )
        .ValueAxis(axis => axis
            .Numeric("km")
                .Title("km")
                .Min(0).Max(161).MajorUnit(32)
        )
        .ValueAxis(axis => axis
            .Numeric("mpg")
                .Title("miles per gallon")
                .Color("#ec5e0a")
        )
        .ValueAxis(axis => axis
            .Numeric("l100km")
                .Title("liters per 100km")
                .Color("#4e4141")
        )
        .Tooltip(tooltip => tooltip
            .Visible(true)
            .Format("{0}%")
        )
    )

</div>

 

Petar
Telerik team
 answered on 17 Oct 2022
1 answer
1.2K+ views

Hello,

I have a Form with an Ajax POST method. One of the fields is a DateTime and when it is being posted, it uses some kind of long format with a mix of culture... It break the ASP Model and marks it as invalid as it's not recognised as a DateTime. 

This is the payload from submiting the form, as you can see, the timezone is in french, while the date is in en-US. The client Kendo culture is also set as  en-US.

DateRequete: Tue+Oct+11+2022+00:00:00+GMT-0400+(heure+d’été+de+l’Est)


This is the form submit function:

function onFormRequeteSubmit(ev) { //Fonction pour FormRequuete
    ev.preventDefault();
    var modelData = ev.model;
    $.ajax({
        type: 'POST',
        url: "/FormHandler/Requete",
        beforeSend: function (xhr) {
            xhr.setRequestHeader('X-XSRF-TOKEN', getCookie('XSRF-TOKEN'));
        },
        data: modelData,
        dataType: 'json',
        success: function (data) {
            //removed for clarity
        },
        error: function (data) {
            //removed for clarity
        }
    })

};

 

I"ve tried the following before the $.ajax call, and it does post the date in a valid ISO format, but it breaks the post and somehow posts the actual page instead of the ajax url...

modelData.DateRequete.value = modelDate.DateRequete.toJSON();

 

How can I convert the date to a valid format before posting it and/or why is my client culture not set properly? This is the content of my <head>:

<script src="https://cdn.kendostatic.com/2022.2.510/js/cultures/kendo.culture.en-US.min.js"></script>
<script>
    kendo.culture("en-US");
    var culture = kendo.culture();
    console.log(culture.name); // outputs "en-US"
</script>

Mihaela
Telerik team
 answered on 14 Oct 2022
1 answer
91 views

When I click my (test) button to select a row (with Id = 2) in my grid, I get the error:

"Uncaught TypeError: Cannot read properties of undefined (reading 'get') at selectRowById".

Here is my function:

  function selectRowById(id) {
        var grid = $("#grid").data("kendoGrid")
        var dataItem = grid.dataSource.get(id);
        var dataItemUID = dataItem.get("uid"); 
        var tableRow = $("[data-uid='" + dataItemUID + "']");
        grid.select(tableRow);
    }

Here is my grid:

@(Html.Kendo().Grid<Document>()
    .Name("grid")
    .Columns(columns =>
    {
        columns.Bound(p => p.DocumentId).Title("Doc Id").Filterable(false).Width(90);
        columns.Bound(p => p.StorageContainer).Title("Container").Width(100);
        columns.Bound(p => p.FileName).Width(350);
        columns.Bound(p => p.DocStatus).Width(125);
        columns.Bound(p => p.FileSize).Width(125).HtmlAttributes(new { @style = "text-align: right" });
        columns.Bound(p => p.ClientDocumentId).Title("Client Doc Id").Width(200);
        columns.Bound(p => p.CreateDate).Format("{0:MM/dd/yyyy}").Width(130);
        columns.Command(command => { command.Edit().Text(" "); command.Destroy().Text(" "); }).Width(150);
    })
    .Editable(editable => editable.Mode(GridEditMode.InLine))
    .Selectable(selectable => selectable
        .Mode(GridSelectionMode.Multiple)
        .Type(GridSelectionType.Row))
    .Pageable()
    .Resizable(resize => resize.Columns(true))
    .Pageable()
    .Sortable()
    .Scrollable()
    .Reorderable(reorder => reorder.Columns(true))
    .Filterable()
    //.Groupable()
    .HtmlAttributes(new { style = "height:650px;" })
    .DataSource(dataSource => dataSource
    .Ajax()
    .PageSize(20)
    .Model(model =>
    {
        model.Id(p => p.DocumentId);
        model.Field(p => p.DocumentId).Editable(false);
        model.Field(p => p.CreateDate).Editable(false);
    })

    .Read(read => read.Action("Read", "Document").Data("getApplicationId"))
    .Create(update => update.Action("Create", "Document"))
    .Update(update => update.Action("Update", "Document"))
    .Destroy(update => update.Action("Delete", "Document"))
    )
)

 

Any help would be greatly appreciated. Thanks.

Mark

Alexander
Telerik team
 answered on 14 Oct 2022
1 answer
373 views

I have grid below. I did not like the way buttons are displayed. so would like to do 1 of these: 

1) move buttons to the bottom of the row to eliminate 2 column, mainly for mobile friendly

2) or at very least get rid of "Edit" & "Delete" label on these buttons to reduce space. When I removed button text,  buttons  no longer response to events. Why?

I have attached a screenshot. Could someone suggest a solution please!

 @(Html.Kendo().Grid(Model)
        .Name("grid")
        .ToolBar(toolbar => {
            toolbar.Search(); 
            toolbar.Custom().Text("Add").IconClass("bi bi-plus-circle").HtmlAttributes(new { id = "AddButton", @class="floatRight" });
            toolbar.Pdf().Text("PDF");
            toolbar.Excel().Text("Excel");})
        .Search(search=> search.Field(c=>c.Caption))
        .Selectable(select => select.Mode(GridSelectionMode.Single))
        .Events(ev => ev.Change("onChange"))
        .DataSource(dataSource => dataSource
            .Ajax()
            .PageSize(20)
            .ServerOperation(false)
         )
 
        .Pageable()
        .Sortable()
        .Columns(columns =>
        {
            columns.Bound(f => f.Id).Visible(false);  
            columns.Bound(f => f.Odometer).Title("Equipment List").ClientTemplate("<p><strong>#=Caption#</strong></p> <ul><li>Odometer: #=Odometer #</li><li>Engine Hour: #=EngineHour #</li><li>Created date: #= CreateDateString #</li><li>Last maintenance: #= LastMaintenance?.Description # on #= LastMaintenance?.CreateDateString #</li></ul>");
            columns.Command(command => { 
                command.Custom("Edit").IconClass("bi bi-pencil-square").Click("Update");
                command.Custom("Del").IconClass("bi bi-trash").Click("Archive");
            }).Title("Actions").Width(80);
        
        })
    )


Aleksandar
Telerik team
 answered on 13 Oct 2022
Narrow your results
Selected tags
Tags
+? more
Top users last month
Rob
Top achievements
Rank 3
Iron
Iron
Iron
Atul
Top achievements
Rank 1
Iron
Iron
Alexander
Top achievements
Rank 1
Veteran
Iron
Serkan
Top achievements
Rank 1
Iron
Shawn
Top achievements
Rank 1
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Rob
Top achievements
Rank 3
Iron
Iron
Iron
Atul
Top achievements
Rank 1
Iron
Iron
Alexander
Top achievements
Rank 1
Veteran
Iron
Serkan
Top achievements
Rank 1
Iron
Shawn
Top achievements
Rank 1
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?