Telerik Forums
UI for ASP.NET MVC Forum
1 answer
137 views

I have an issue with my page where everything works fine except it will not go to pages 3, 5, and 11.  My datasource is a list of an object in my model.  I can add, save, anything except go to those pages.  Below is my code from the page. I am using Kendo 2020.3.1118 (don't have a license for anything newer).  If I click on the 3, nothing happens if I am on page 2 and click the next page arrow, nothing happens. If I am on page 4 and click the next page arrow nothing happens.  But if I am on page 6 and click it, I go to 7, then 8, etc. until I get to 10.  It only refuses those 3 pages out of the 12 that it creates for my data.  The counter on the bottom right works fine.  And if I take out the pageable ability, my dropdown quits working.  I have only been using Kendo for about a week or so.  Once I get this figured out, this project will actually be complete.  It is the last issue I have to solve.  Any help would be greatly appreciated.  

 @(Html.Kendo().Grid(Model).Name("EditableGrid")
                    .Columns(c =>
                    {
                        c.Command(command => command.Custom("Save").SendDataKeys(true).Click("sendLO2")).Width(95);
                        //c.Command(command => { command.Edit(); }).Width(150);
                        c.Bound(f => f.ID).Title("ID").Width(95);
                        c.Bound(f => f.LoanOfficerID).Title("Loan OfficerID").Width(100);
                        c.Bound(f => f.FullName).Title("Full Name").Width(125);
                        c.Bound(f => f.FirstName).Title("First Name").Width(125);
                        c.Bound(f => f.LastName).Title("Last Name").Width(125);
                        c.Bound(f => f.ReceivingLoanOfficerID).Title("Receiving Loan OfficerID").Width(150);
                        c.Bound(f => f.ReceivingFullName)
                            .ClientTemplate("#=ReceivingFullName.rcvFullName#")
                            .Title("Receiving Full Name")
                            .EditorTemplateName("OptionsLOs")
                            .Sortable(false)
                            .Width(180);
                        c.Bound(f => f.ReceivingFirstName).Title("Receiving First Name").Width(125);
                        c.Bound(f => f.ReceivingLastName).Title("Receiving Last Name").Width(125);
                        c.Bound(f => f.Active).Title("Active").Width(95);
                        c.Bound(f => f.CreatedDate).Title("Created Date").Width(125);
                        c.Bound(f => f.ReceivingEmployeeID).Title("Receiving EmployeeID").Width(125);
                        c.Bound(f => f.ReceivingLOID).Title("Receiving LOID").Width(125);
                        c.Bound(f => f.ReceivingTitle).Title("Receiving Title").Width(125);
                        c.Bound(f => f.ReceivingNMLSID).Title("Receiving NMLSID").Width(125);
                        c.Bound(f => f.ReceivingMobileNumber).Title("Receiving Mobile Number").Width(125);
                        c.Bound(f => f.ReceivingOfficeNumber).Title("Receiving Office Number").Width(125);
                        c.Bound(f => f.ReceivingEmailAddress).Title("Receiving Email Address").Width(125);
                        c.Bound(f => f.ReceivingWebsite).Title("Receiving Website").Width(150);
                        c.Bound(f => f.ReceivingBranchID).Title("Receiving BranchID").Width(125);
                        c.Bound(f => f.ReceivingTandemTeamID).Title("Receiving Tandem TeamID").Width(125);
                        c.Bound(f => f.ReceivingOriginationTeamID).Title("Receiving Origination TeamID").Width(125);
                        c.Bound(f => f.ReceivingPictureURL).Title("Receiving Picture URL").Width(150);
                        c.Bound(f => f.ReceivingQRCodeURL).Title("Receiving QRCode URL").Width(150);
                        c.Bound(f => f.ReceivingActive).Title("Receiving Active").Width(95);
                        c.Bound(f => f.ReceivingDateCreated).Title("Receiving Date Created").Width(125);
                        c.Bound(f => f.ReceivingCreatedBy).Title("Receiving Created By").Width(125);
                    })
                    .ToolBar(toolbar => toolbar.Create())
                    .Editable(editable => editable.Mode(GridEditMode.InCell))
                    .Pageable()
                    .Sortable()
                    .Scrollable()
                    .Filterable()
                    .HtmlAttributes(new { style = "height:650px;" })
                    .DataSource(DataSource => DataSource
                            .Ajax()
                            .PageSize(50)
                            .ServerOperation(false)
                            .Update(update => update.Action("SaveLO", "Home"))
                            .Create(update => update.Action("SaveLO", "Home"))
                            .Model(model =>
                            {
                                model.Id(p => p.ID);
                                model.Field(p => p.ReceivingFullName).DefaultValue(ViewData["defaultLO"] as Nova.ReceivingLO_LO.MVC.Models.LOOptions);
                            })

                        )
                    .Resizable(resize => resize.Columns(true))
        )
Daniel
Top achievements
Rank 1
Iron
 answered on 23 Dec 2022
0 answers
251 views

I am trying to use the PDFViewer to display a PDF downloaded from an Azure Blob.

In my view I have:


// Create a viewer if you do not have one already.
        var pdfViewer = $("#pdfViewer").data("kendoPDFViewer");
        if (!pdfViewer) {
            pdfViewer = $("#pdfViewer").kendoPDFViewer({
                pdfjsProcessing: {
                    file: ""
                },
                width: "100%",
                height: 500
            }).data("kendoPDFViewer");
        };

        // Build the desired URL to point to your handler that will return the PDF.
        var pdfHandlerUrl = "/Home/getBlob/" + selectedRows.BlobID;

        // Make the PDFViewer load the designated file.
        pdfViewer.fromFile(pdfHandlerUrl);

An in my controller (getBlob) I have the following:


var stream = new MemoryStream();
await file.DownloadToAsync(stream);
  stream.Position = 0;
                   
 return new FileStreamResult(stream, "application/pdf");

But in the view - I get a pop-up error message that says: PDF file fails to process.

 

Any suggestions?

 

 

 

 

 

Eddie
Top achievements
Rank 1
 asked on 23 Dec 2022
1 answer
452 views

I've just started a new project and used the latest release of the framework (v2022.3.1109). Unfortunately I've encountered some issues which didn't appear using earlier versions of the framework (pre R1 2022 I believe).

The problems are

  • the datepicker control stretches to 100% of the page, if a width is not set in the html attributes (I can't believe this is the default intended behavior)
  • I cannot reduce the font-size of the datepicker control regardless of where I put the style statement (parent container, html attributes etc..)
  • The same is true for the grid, whereas before font size could be adjusted using the style on the parent div, this no longer works

Is there any documentation detailing the changes from R1 2022 and how to achieve these relatively simple appearance changes?

I'm using bootstrap 5 and the kendo.bootstrap-nordic.min.css  css file.

Thanks

Eyup
Telerik team
 answered on 23 Dec 2022
1 answer
289 views

Hello, i came accross this article

https://feedback.telerik.com/document-processing/1356413-support-pdf-a-3?_ga=2.109487747.748254709.1671465274-760371442.1659361380&_gl=1*1e5wooq*_ga*NzYwMzcxNDQyLjE2NTkzNjEzODA.*_ga_9JSNBCSF54*MTY3MTU0ODg5MS44LjEuMTY3MTU0OTM4Mi42LjAuMA..

which says you can create a PDF/A3 format document but not the embedding. When would be feature available?

 

Regadrs,

Geetha

Martin
Telerik team
 answered on 23 Dec 2022
0 answers
113 views

I'm working on a new project using version v2022.3.1109. There seems to have been a change of behavior since the last version I used. When a call to a grids datasource read method fails, the grid isn't cleared of data, as used to be the case.

This can give a user the impression the call has worked. I can trap data source errors, but there doesn't seem to be a method to clear the current data from the grid.

What's the easiest way to clear the datasource if a read call fails?

The read call looks like:


 $("#Grid").data("kendoGrid").dataSource.read();

Thanks

AP
Top achievements
Rank 1
Iron
Iron
Veteran
 asked on 22 Dec 2022
1 answer
167 views

I just performed an upgrade of our Telerik UI for MVC from version 2021.1.119.545 to 2022.3.1109 via the Upgrade Wizard on the VS 2022 Telerik extension.  But now some of the javascript code is not working properly, in particular the tabStrip disable function.   Here is an example of the code that previously worked fine...

var tabStrip = $("#formTabStrip").kendoTabStrip().data("kendoTabStrip");

tabStrip.disable(tabStrip.tabGroup.children().eq(5));  <== no longer works after upgrade

Any idea why this may be happening?  

Thanks!

Ivan Danchev
Telerik team
 answered on 21 Dec 2022
1 answer
173 views

Hello,

I am Kendo Grid in MVC

The grid is set up for in-cell batch editing. One of the fields is a date field. If the date is selected using date picker the value stays in the cell, whereas if the date value is manually entered the value does not hold in the cell. Any suggestions why the value is not holding in the cell when manually entered.

Thank you

 

Eyup
Telerik team
 answered on 21 Dec 2022
3 answers
379 views
we implemented one global filter for other columns (i removed the columns in below code) but we need to do add the filter to the particular column (date)

@(Html.Kendo().Grid<Model>
            ()
            .Name("Activitiesgrid")
            .Columns(columns =>
            {               

                columns.Bound(c => c.ActivityRecordCreateDate).HeaderHtmlAttributes(new { style = "font-weight: bold;font-size: 13px;" }).HtmlAttributes(new { style = "font-size: 12px" }).Width(50);
                
                columns.Bound(c => c.ActivityDate).HeaderHtmlAttributes(new { style = "font-weight: bold;font-size: 13px;" }).HtmlAttributes(new { style = "font-size: 12px" }).Width(100).Format("{0:M/d/yyyy}");
                

            })
            .ToolBar(tools => tools.Excel().Text("Export"))
            .Excel(excel => excel.AllPages(true)
        .Filterable(true)
            
            )
              .Events(events => events.ExcelExport("incompleteCOATestsGridOnExcelExportActivities"))
            .DataSource(dataSource => dataSource
            .Ajax().Model(m =>
            {
                m.Id(p => p.rowIndex);

            })
            .PageSize(0)
            .Read(read => read.Action("GetKendoActivities", "EventsActivities", new { invokedFromMainMenu = true }))
            .ServerOperation(false)            
            .Events(events=>
            {
                events.RequestStart("request_start");
                events.RequestEnd("request_end");

            })
            )
            .NoRecords()
            .Filterable(filterable => filterable
                .Extra(false)
                .Operators(operators => operators
                        .ForDate(date => date.Clear()
                        .IsEqualTo("Is equal to")
                        .IsGreaterThan("Is After")
                        .IsLessThan("Is Before")
                        .IsNull("Is empty")
                        .IsNotNull("Is not empty"))
                        )
                )
            .Sortable()
            .Pageable()
            .Selectable()
            .NoRecords(x => x.Template("<div class='empty-grid' style ='float: top'></div>"))
            .Events(events =>
            {
                //events.FilterMenuInit("CustomFilter");
                events.FilterMenuOpen("CustomFilterOpen");
            })
// .ClientTemplate("#=AssignedDateFormat(data)#")
)
Eyup
Telerik team
 answered on 19 Dec 2022
1 answer
1.6K+ views

In CSP we were using script-src 'self' 'unsafe-inline' 

but for security purpose need to remove 'unsafe-inline' , we added  'nonce-a9f04fd1-06cf-4948-9d66-ea306e581896' for inline script.

applied nonce for inline script 

<script type="text/javascript" nonce="a9f04fd1-06cf-4948-9d66-ea306e581896">

</script>

but after applying these change kendo  controls not working. Our assumption is there are dynamic inline scripts generated  for kendo controls which not contains nonce. so it may cause an issue.

we also tried DeferredScripts but no success. after applying 'unsafe-inline'  it works.

<script type="text/javascript" nonce="a9f04fd1-06cf-4948-9d66-ea306e581896">

    @Html.Kendo().DeferredScripts()

</script>

 

Please suggest as we want to remove 'unsafe-inline' with kendo controls need to work.

 

Ivan Danchev
Telerik team
 answered on 16 Dec 2022
0 answers
648 views

Hi,

I have a razor page that implements a grid. I want to use javascript to set / unset the dirty markers for certain fields in the grid when there is an error.

I have searched this forum and google'd the problem, but I cannot get anything to work.

I tried :

  • setting .dirty to true
  • addClass("k-dirty-cell")
  • grid.refresh() after setting the dirty markers

Tried these suggestions:

Can I please get a simple example of when the on error fires the js function runs and marks / unmarks a cell dirty and the grid reflects those changes?

Here is a simplified example from a different post:

        function onError(e) {
            // got any error messages
            if (e.errors) {
                e.preventDefault();
                var grid = $("#grid").data("kendoGrid");
                var data = grid.dataSource.data();

                for (var i = 0; i < data.length; i++) {

                    data[i].dirty = true;
                }
                grid.refresh();
            }
        }

Thank you for your help.

Jeff
Top achievements
Rank 1
 asked on 13 Dec 2022
Narrow your results
Selected tags
Tags
+? more
Top users last month
Will
Top achievements
Rank 2
Iron
Motti
Top achievements
Rank 1
Iron
Hester
Top achievements
Rank 1
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Thomas
Top achievements
Rank 2
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Will
Top achievements
Rank 2
Iron
Motti
Top achievements
Rank 1
Iron
Hester
Top achievements
Rank 1
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Thomas
Top achievements
Rank 2
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?