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

Hello,

we have a Grid that is bound to an IEnumerable Property of the ViewModel being supplied by the server as you can see in the following code snippet:

01.@(Html.Kendo().Grid<AktionsTracker.Pages.PromotionEditModel.ModelDTO>(Model.Promotion.Models)
02.    .Name(ModelGrid)
03.    .Columns(c =>
04.    {
05.        c.ForeignKey("ModelId", Model.Models, "ModelId", "ModelCode").Title("Modellcode").Width(100);
06.        c.ForeignKey("ModelId", Model.Models, "ModelId", "ModelName").Title("Modellbezeichnung").Width(200);
07.        c.Bound(m => m.Absolute).Width(150);
08.        c.Bound(m => m.Relative).Width(150);
09.        c.Command(c => c.Edit());
10.        c.Command(c => c.Destroy());
11.    })
12.    // more code
13.    .DataSource(c =>
14.    {
15.        c.Custom()
16.        .Schema(s =>
17.        {
18.            s.Model(m =>
19.            {
20.                m.Id("ModelId");
21.                m.Field("ModelId", typeof(int)).Editable(false);
22.                m.Field("Absolute", typeof(Decimal?));
23.                m.Field("Relative", typeof(Decimal?));
24.            });
25.        });
26.    })
27.)

We now want to programmatically insert a new record with a specific Id (guaranteed to be unique and have an entry in the ForeignKey-Collections) and directly put the Row into Edit-Mode.

At first, we tried to simply call grid.addRow() and handle the beforeEdit event to set the ModelId but this did not work out since the ModelId has to be non-Editable.

Therefore, we have resorted to a different approach where we execute the following code in a javascript function:

1.var grid = $("#@ModelGrid").data("kendoGrid");
2.grid.dataSource.add({ ModelId: value, Absolute: null, Relative: null });
3.grid.editRow($("#@ModelGrid tbody tr:last-of-type"));

i.e. we add the pre-filled record to the datasource of the grid and manually start the editing via the call to editRow.

The problem is the following:

  • Record is added and edit-mode is entered
  • We manually set the required properties and press the Update button
  • We press the Edit button on the same row
  • We press Cancel to end the editing without saving changes => as a result the row disappears even though it has been previously saved!

It does not matter how often we have update the record with valid data, as soon as we press Cancel the record will disappear every time.
I want to reiterate that it is fine and *intended* that the row disappears if Cancel is clicked directly after adding the row. However, having it disappear after multiple succesfull updates is not what we want at all.

How can we fix this behaviour?

Best Regards

Wolfgang Weilguny
Top achievements
Rank 1
Veteran
 answered on 08 Sep 2020
10 answers
823 views

Tag helpers in a form allow the following:

https://docs.microsoft.com/en-us/aspnet/core/mvc/views/working-with-forms

@model CountryViewModel

<form asp-controller="Home" asp-action="Index" method="post">

<select asp-for="Country" asp-items="Model.Countries">

</select>

<br />

<button type="submit">Register</button>

</form>

 

How do I accomplish the same thing with Kendo Listbox?

Nikolay
Telerik team
 answered on 08 Sep 2020
1 answer
66 views

Hello,

I have a grid with client template that holds two values from datasource. Is it possible to filter this two fileds at once using one filter menu (e.g adding secondary filter on the fly when bounded column is filtered)?

Nikolay
Telerik team
 answered on 08 Sep 2020
3 answers
247 views
Hello Team;

I've installed [licensed] my Telerik ASP.Net Core and running the sample app. for every screen I go to the attached blue popup dialog shows up regarding ACCEPT COKKIES or SAVE SETTINGS. No matter which one I select, I keep getting this annoying dialog box.

How can I get ride of it? Why does it keep showing?

Thanks!
..Be
Dimitar
Telerik team
 answered on 08 Sep 2020
3 answers
500 views

Hi

I am using kendo grid inline editing . I want to dynamically fill the value of one column based on the values added from 2 other  columns.
example:

Col A+ Col B = Col C

Fill the value dynamically whiling editing or new insert within in cell kendo grid  

Patrick | Technical Support Engineer, Senior
Telerik team
 answered on 01 Sep 2020
1 answer
101 views

Hi, 

I am trying to use the .net core FileManager component.I have implemented a custom back end that no longer reads the file system, instead integrates with my database and Azure blob storage. Everything working ok for that. 

 

The issue I'm having is with the display for the created and modified timestamps.

My users will be in different timezones so I will need to convert the timestamps to the user's local time. I'm storing timestamps in utc in the database

As far as I can tell the current file manager widget is not setup for that.

I'm trying to intercept the datasource so that I can parse the data objects, read the Utc timestamps, convert them to the user's local timezone in the client side, and populate the non-utc timestamps, so they show correctly in the filemanager control.

I can't yet work out how to do that though. can anyone help?

 

many thanks

Petar
Telerik team
 answered on 31 Aug 2020
3 answers
151 views

I'm interested in using the Editor control in a new project, but I'm concerned with the functionality in the Demo (https://demos.telerik.com/aspnet-core/editor/index). For example, how do I change the properties of a cell in a table?  If I put my karat in the cell then click the Table Wizard button, I can choose a background color but it creates a whole new table within the cell -- but what I want is to modify the selected cell.

If I select the table, eight boxes appear at the corners and mid-points of the exterior border of the table.  I can drag these boxes to resize the table.  However, a copy of the boxes remains at the original size and they do not go away unless I refresh the page.

If I click the "View HTML" button then a dialog is displayed, but the text area for the HTML code is only two lines tall.  I'm unable to resize the control.

Are these all bugs in the Editor control?  Any idea when they may be resolved?

Thanks!

Ivan Danchev
Telerik team
 answered on 31 Aug 2020
1 answer
94 views
I'm trying to replicate the example "https://demos.telerik.com/aspnet-mvc/tilelayout/reordering" on my PC.

I have copied the images in appropriate location.

I copy and past the code from the example code, but i don't see anything. Why?

Thanks 

Fabio
Eyup
Telerik team
 answered on 31 Aug 2020
2 answers
109 views

I am using your PDF Viewer and Document processing to merge PDF files together.  Now, my requirement is to merge multiple PNG files together.  Do you have a control that will do this?  If not, any idea how I would go about this?  

As a side thought, maybe I could meet the requirement by adding the 2 PNG files into a PDF file; one after another.  Do you have an example on how to do this?

Thanks in advance for your help,

Joel

Joel
Top achievements
Rank 2
Bronze
Iron
Iron
 answered on 28 Aug 2020
1 answer
1.9K+ views

Hey,

 

I am using kendo grid incell edit mode in my project

I want to convert the alphabets to upper case(in caps) as the users enter in the cells. As he types in the letters should automatically change in CAPS - from a to A  

Patrick | Technical Support Engineer, Senior
Telerik team
 answered on 28 Aug 2020
Narrow your results
Selected tags
Tags
+116 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?