Telerik Forums
UI for ASP.NET Core Forum
0 answers
21 views

In our UI for ASP.NET Core R3 2020 (2020.3.915) release, the Column menu message of unsticking a column is "null".

This bug will be resolved in our next official release.

In the meantime, as a workaround, manually set the Unstick Column menu message:

.ColumnMenu(c => c.Messages(m => m.Unstick("Unstick Column")))
Kendo UI
Top achievements
Rank 1
 asked on 16 Sep 2020
1 answer
1 view

Could we have an example of remote validation when Popup editing of a grid object ?

I added the [Remote] attribute to the DTO object. Added the Controller's check method, that receives always null as parameter, where should receive the modified string param. Please see for details the following question. I also get in the request playload the correct parameter, when the client sends to the server. But on the server side - always null.

Mihaela
Telerik team
 answered on 12 May 2021
1 answer
15 views

I try to use the number format #.### that should display

7 as 7

7.123678 as 7.124

7.4 as 7.4

, however is not the case...

cells.Add()
.VerticalAlign(SpreadsheetVerticalAlign.Center)
.Format("#.###");
displays 7. for 7, is there a way to fix the Excel bug and remove the dot, when there are any decimal ?

 

public static void Main()
{
	string format = "#.###";
	Console.WriteLine("123.456789m as {0} is {1}", format, (123.456789m).ToString(format));
	Console.WriteLine("     123.4m as {0} is {1}", format, (123.4m).ToString(format));
	Console.WriteLine("        123 as {0} is {1}", format, (123m).ToString(format));
}

output:

123.456789m as #.### is 123.457
     123.4m as #.### is 123.4
        123 as #.### is 123

serge
Top achievements
Rank 1
Iron
Iron
Iron
 updated question on 12 May 2021
0 answers
2 views

When the toolbar and sheetbar are invisible, the bottom horizontal scrolbar is not ajusted (is a little bit above it should be)

@(Html.Kendo()
    .Spreadsheet()
    .Name("spreadsheet")
    .HtmlAttributes(new {style = "width:100%"})
    .Toolbar(false)
    .Sheetsbar(false)

I mean, esthetically, if we suppose that the vertical and horizontal bars should have the same distance to the external border.

For the vertical scrolbar that distance is zero. Should be the same for the horizontal then.

picture:

detailed view:

or add a similar margin to the vertical one:


serge
Top achievements
Rank 1
Iron
Iron
Iron
 updated question on 12 May 2021
2 answers
6 views

I have a list of Countries in my Grid, a country has a Code, that is unique. The Grid is in EditCell mode. 

I need to perform a check, if newly inserted Country Code is Unique. 

So, on the controller I have

[AcceptVerbs("GET", "POST")]
public IActionResult KeyExist(string key)
{
	if (_countryService.CodeExists(key))
	{
		return Json($"The Code '{key}' is already used, please try another one!");
	}

	return Json(true);
}

how should I bind the KeyExist method to the grid's validation?
serge
Top achievements
Rank 1
Iron
Iron
Iron
 updated question on 12 May 2021
0 answers
2 views

In a Grid, I try to edit a Product, that should have a unique Code.

In that case, I need the remote validation, to test, if the edited code would exist already in the database, different, from the edited product, of course. 

For that, I need to send to the server the edited product Code, along with its Id.

In such cases, I would have an action like this, in the controller (documented here):

DTO:

[Remote(action: "VerifyCode", controller: "Products", AdditionalFields = nameof(ProductId))]
[Display(Name = "Product Code")]
public string Code { get; set; }

Controller:

[AcceptVerbs("GET", "POST")]
public IActionResult VerifyCode(string code, int id)
{
    if (!_productService.VerifyCode(code, id))
    {
        return Json($"The code {code} is already taken by another product but shoud be unique, please change the code.");
    }

    return Json(true);
}

how to perform such validation when editing the Grid? Ideally inCell edit, but at least in Popup Mode....

serge
Top achievements
Rank 1
Iron
Iron
Iron
 updated question on 12 May 2021
1 answer
7 views

I have a grid and I want to sum the number of true values in a boolean column. Is there a way to create a custom aggregate function to achieve this?

 

Brett

Aleksandar
Telerik team
 answered on 12 May 2021
0 answers
3 views

ASP.NETCore KendoGrid Correct way to disable delete for specific rows?

I have a use case where I need to disable the deletion of rows that still have children to maintain referential integrity of the database.  Instead of having the user hit DELETE and catch the error, I need to prevent the user from attempting to perform an invalid action.  I can attempt to hide the DELETE button in the onDataBound() or the onDataBinding() events but the results are poor and inconsistent.  When it works, it only works when the page is first loaded.  If the user performs an in-line edit on any row, the delete button unhides.  Other interactions with the page also unhide the DELETE button.  I have found several posts claiming that the "k-grid-delete" class can't be hidden. 

Instead of hiding the button outright, ideally I'd like to be able to still have the button visible, but in a disabled state. 

Is there a solution?

     function onDataBound(e) {
          var grid = $("#grid").data("kendoGrid");
          var rows = grid.tbody.children();
          rows.each(function (e) {
               var dataItem = grid.dataItem(this);
               if (dataItem.ChildrenCount > 0) {
                    var row = $("[data-uid=" + dataItem.uid + "]");
                    var deleteButton = row.find("k-grid-delete");
                    deleteButton.hide();
               }
          });
     }


Will
Top achievements
Rank 1
 asked on 11 May 2021
0 answers
3 views

Hi,

We need to develop a form for submitting data using kendo grid, in ASP NET CORE 5.0 MVC

basically we need to create an empty grid based on a database table, (this is clear using model binding), the user can click on a button in a toolbar for making a "Lookup" of that database, select one or many row and then, once selected, add them to the previous grid, ready for submit. 

What's the best way to achieve this with telerik controls?

Andrea
Top achievements
Rank 1
 asked on 11 May 2021
1 answer
6 views

Hello,

Is it possible to have server filtering in Razor Net Core 3.1? We used the demo as our base and referred to the documentation for server filtering (https://docs.telerik.com/aspnet-core/html-helpers/scheduling/scheduler/server-filtering). However we cannot pass Data("getAdditionalData") and the Data("forgeryToken") at the same time. Does anyone know how we can go about doing this so we can filter the results on the database side? Without the forgeryToken in Data, the app does not trigger the Read method (OnPostMeetings_Read)

Any insight is appreciated.

Thank you!

Stoyan
Telerik team
 answered on 11 May 2021