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

I have this grid with Edit and Destroy column command buttons. As I click the Delete/Destroy button it instantly calls the Destroy action without waiting for the delete confirmation. How can I solve this?

 

@(Html.Kendo().Grid<Models.ViewModel>()
        .Name("grid")
        .EnableCustomBinding(true)
        .Columns(columns =>
        {
            columns.Command(command =>
            {
                command.Edit();
                command.Destroy();
            }).Width(180);
            columns.Bound(p => p.Sorting).Width(100).Filterable(false);
            columns.Bound(p => p.Code).Width(200).Filterable(true);
            columns.Bound(p => p.Description).Filterable(true);
        })
        .ToolBar(toolbar =>
        {
            toolbar.Search();
        })
        .Editable(editable => editable.Mode(GridEditMode.PopUp).DisplayDeleteConfirmation(true))
        .Filterable()
        .Pageable()
        .DataSource(dataSource => dataSource
            .Ajax()
            .Events(events => events.Error("error_handler"))
            .Model(model => model.Id(p => p.Id))
            .Read("gridReadDataSource", "MyGrid")
            .Update("gridEditDataSource", "MyGrid")
            .Destroy("gridDeleteDataSource", "MyGrid")
        )
)
Anton Mironov
Telerik team
 answered on 03 Jan 2024
3 answers
487 views

Hi, I would like to know if there is a way to load a PDF stored as VARBINARY(MAX) in a SQL Server Filestream field.

Thank you in advance.

 

Ivan Danchev
Telerik team
 updated answer on 02 Jan 2024
1 answer
26 views

Hello,

for a new project we're considering ASP.NET MVC, or React (Kendo React)

 

We like to create a scheduler with multiple users next to each other, per day.

In attachment is an drawing of the expected result.

Is this feasable with Telerik Scheduler, with drag and drop availabilities to move appointments between users?

Thanks,

 

Jeroen

Georgi
Telerik team
 answered on 26 Dec 2023
1 answer
69 views

Hello,

I have been having issues with Visual Studio 2022 (17.7 and 17.8) crashing when running a 'Find and Replace' or when trying to merge a file using GIT. After submitting the issue to the Visual Studio support team, we discovered that either the Telerik MVC or Core extension is the cause. 

Is anyone else experiencing this issue? If so, is it being fixed in the next release?

 

Thanks

Vesko
Telerik team
 answered on 22 Dec 2023
1 answer
28 views

I recently updated the Kendo library to 2023.3.1114.545 from 2022.3.  I did not change any code other than the style sheets.  My grids are showing a long drop down with the page numbers even though I do not specify it and other options like page records per page do not show.  Plus, the refresh button doesn't show.

I attached how it looks.

My CSS and script includes:

<link href="@Url.Content("~/Content/classic-silver/classic-silver.css")" rel="stylesheet" />
<link href="@Url.Content("~/Content/kendo/font-icons/index.css")" rel="stylesheet"  type="text/css" />

<script src="@Url.Content("~/Scripts/jquery-3.7.1.min.js")"></script>
<script src="@Url.Content("~/Scripts/kendo/2023.3.1114/jszip.min.js")"></script>
<script src="@Url.Content("~/Scripts/kendo/2023.3.1114/kendo.all.min.js")"></script>
<script src="@Url.Content("~/Scripts/kendo/2023.3.1114/kendo.aspnetmvc.min.js")"></script>

Kendo Grid code:

    @(Html.Kendo().Grid<ListModel>()
        .Name("List")
        .Columns(columns =>
        {
            columns.Bound(e => CaseNumber).Filterable(false).Title("Case Number")
            columns.Bound(e => e.LastName);
            columns.Bound(e => e.FirstName);
        })
        .Sortable()
        .Filterable()
        .Pageable(pageable => pageable
            .Refresh(true)
            .PageSizes(new int[] { 10, 25, 50, 100 })
            .ButtonCount(5))
        .DataSource(ds =>
        {
            ds.Ajax()
                .Read(read => read
                    .Action("Cases_Read", "CasesList")
                )
                .PageSize(25);
        })
        .ToolBar(tools => tools.Excel())
    )
Rey
Top achievements
Rank 2
Iron
Iron
 answered on 18 Dec 2023
0 answers
32 views

Dear Sir/Madam,

Telerik UI for Asp.net MVC and AJAX have been installed in my destkop.

I have created a project for Asp.net MVC with GRID AND MENU interface in visual studio 2017. 

I run dedug mode, the datagrid can't show any column. What's wrong of this?

 

Jacky
Top achievements
Rank 1
 asked on 14 Dec 2023
1 answer
49 views

I am trying to bind the datatable to the MVC grid and using ajax read to get the data. Everything is working as expected until I am trying to convert one of the column to foreignkey column.

Here is my sample code

 @(Html.Kendo().Grid<dynamic>()
                .Name("ReportGrid")
                .Scrollable()
                .Columns(columns =>
                {
                    foreach (var column in Model.TableConfig.MasterColumns)
                    {
                        if (refColumns.Contains(column.ColumnName))
                        {
                            var refData = Model.MetaData.Where(m => m.ColumnName == column.ColumnName).ToList();


                            columns.ForeignKey(column.ColumnName, new SelectList(refData, "DataValue","DataText")).EditorTemplateName("GridForeignKey");


                        }
                        else
                        {
                            columns.Bound(column.ColumnName);
                        }
                        //var c = columns.Bound(column.ColumnName);
                    }                
                })

 

I am getting the below error

 

System.AggregateException: 'One or more errors occurred. ('object' does not contain a definition for 'DataTable ColumnName')'
Mahesh
Top achievements
Rank 1
Iron
 answered on 14 Dec 2023
0 answers
28 views

Adding same question since the header is wrong and I am not able to update

I am trying to bind the datatable to the MVC grid and using ajax read to get the data. Everything is working as expected until I am trying to convert one of the column to foreignkey column.

Here is my sample code

 @(Html.Kendo().Grid<dynamic>()
                .Name("ReportGrid")
                .Scrollable()
                .Columns(columns =>
                {
                    foreach (var column in Model.TableConfig.MasterColumns)
                    {
                        if (refColumns.Contains(column.ColumnName))
                        {
                            var refData = Model.MetaData.Where(m => m.ColumnName == column.ColumnName).ToList();


                            columns.ForeignKey(column.ColumnName, new SelectList(refData, "DataValue","DataText")).EditorTemplateName("GridForeignKey");


                        }
                        else
                        {
                            columns.Bound(column.ColumnName);
                        }
                        //var c = columns.Bound(column.ColumnName);
                    }                
                })

 

I am getting the below error

 

System.AggregateException: 'One or more errors occurred. ('object' does not contain a definition for 'DataTable ColumnName')'
Mahesh
Top achievements
Rank 1
Iron
 asked on 14 Dec 2023
1 answer
33 views

Is there a way to create a custom viewer template for a scheduler event and have certain events be uneditable and open up in a viewer pop-up?

Eyup
Telerik team
 answered on 12 Dec 2023
2 answers
57 views

I am building a screen where user can view assignments in the grid. User can select records and those selections will be saved in the database. The checkbox is binded to "IsPreLoad" column/property.  I also need to show how many records are selected in a separate label.

Issue:

User has selected 2 records from the list and saved it in database. When the user goes back to the Assignment listing page both the records will be displayed as selected(checkbox selected) . When user clicks on the header checkbox to select all records that functionality works as expected. But when they try to unselect the header checkbox. I can see the records getting unselected but immediately the  grid shows previous two records as selected.

I think after unselecting all the records from the grid,  the grid is again binding data from grid read action. I am not sure how to resolve this issue.

Any help is appreciated.

Ivan Danchev
Telerik team
 answered on 06 Dec 2023
Narrow your results
Selected tags
Tags
+? more
Top users last month
Mark
Top achievements
Rank 1
Yurii
Top achievements
Rank 1
Leland
Top achievements
Rank 2
Iron
Iron
Iron
Hon
Top achievements
Rank 1
Iron
Deltaohm
Top achievements
Rank 3
Bronze
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Mark
Top achievements
Rank 1
Yurii
Top achievements
Rank 1
Leland
Top achievements
Rank 2
Iron
Iron
Iron
Hon
Top achievements
Rank 1
Iron
Deltaohm
Top achievements
Rank 3
Bronze
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?