Using the Excel Export for Grid creates the Excel file, but on opening it, the columns that contain data are hidden. Unless I unhide the columns, the sprceadsheet looks empty.
---
ADMIN EDIT:
One idea to go about this is to expose an event that would allow users to modify the column width values before they get sent for export. The benefit of this approach is that if the columns are resized, the user will receive their current size in the specified unit e.g. rem, em or % and will be able to set the width in px.
Another idea is to default such column widths to some hardcoded value (say, 64px) or even the grid might try to calculate them (which can cause questionable results in stranger settings, but it is an idea - if an event gets exposed you will be able to do that in your application code).
---
This will let Excel mark the field as a Date and act according to the current culture on the machine that opens the file.
---
ADMIN EDIT:
This feature would let you define custom formats, so you may want to Vote for it and Follow it too: Custom Format for Excel Export per column. It is important to keep in mind that the Excel formats are completely different from the .NET formats.
If this is of high importance for you right now, you could create your own Excel file with the desired settings by following the example from this thread.
---
Horizontal scroll bar is visible, but doesn't move with cursor/current-cell.
---
ADMIN EDIT
Applies also to vertical scrolling with or without row virtualization (e.g., using InCell edit mode, pressing Enter will open the next row for editing, but it will not work out with row virtualization at all after the current viewport, and without virtualization you will not see what's happening until you start typing and the browser calls .scrollIntoView() for the editor)
---
If after adding a new item to a grid with inline edit the save button is double-clicked (e.g. by accident) two new items are added instead of one. Right now, the only way to prevent this seems to be to check if an item is already contained in GridData at the top of the OnCreate-Handler and cancel if necessary. If a unique ID is not available yet (because it is created by the database when saving at the end of the handler) this means every Property has to be compared to check for equality. This is very annoying.
Please add a parameter "DisableWhileBeingHandled" to TelerikButtons and make this the default for the CommandButtons in a Grid. The Buttons should only accept clicks if the previous handling is finished.
Kind regards,
René
For example in the following demo:
https://demos.telerik.com/blazor-ui/grid/custom-filter-menu
If I first filter "38" by "Size" and then open the second filter menu "Product Name", I see all the product names in the pop-up, not only the previously filtered by "Size" names. I want to see in the second filter pop-up only the filtered names by "Size".
It will be nice to have this grid filter out-of-box, so you don't have to scroll to unwanted values not part of the first filter.
------------ADMIN EDIT-------------
As a possible workaround, you can use the Filter Menu Template:
It allows you to change the data for the filter menu.
Initially, the grid is filtered by "Is FTE? = True". It shows 20 lines. The sum of "Hours" should be 800. But the footer shows another value (depends on the random logic which you've implemented). See the attached screenshot.
Then, when changing the filter, the correct sum is shown.
But I need the correct value initially...
Re: I've just found out that using the OnRead event instead of the standard data binding solves the issue. Better said, it's a possible work-around.
I suggest adding a FieldExpression property to the GridColumn so a developer would not need to create view models and templates for simple transformations of the existing model's properties. The field expression would be used for filtering and sorting as well. Its type would be Func<T, object> or Expression<Func<T, object>>.
<TelerikGrid Data="@Persons">
<GridColumns>
<GridColumn FieldExpression="@(p => p.FirstName + " " + p.LastName)" />
</GridColumns>
</TelerikGrid>
Please support Display(Order = ...) with autogenerated Grid columns.
Such functionality will also be useful for controlling the order of manually declared columns when using a custom component for reusable columns. For example: https://blazorrepl.telerik.com/cGOtbwOX21f6zQcy35 - the "Name" column is rendered last and currently one cannot control its order.
public class DateModel
{
[Display(Order = 2)]
public string Id { get; set; }
[Display(Order = 1)]
public string Text { get; set; }
}
The Grid OnEdit event cannot be cancelled if the user tabs into a cell that should not allow editing.
REPL test page: https://blazorrepl.telerik.com/QcERELbm37c9SzzZ32
Click on "Foo 2" or "Bar 2", and start tabbing. You will be able to edit the values on row 3, which should not happen.
There are two possible workarounds: use a conditional EditorTemplate, or check editability in OnUpdate.
<TelerikGrid Data="@GridData" EditMode="@GridEditMode.Incell" Navigable="true"
OnEdit="@EditItem" OnUpdate="@UpdateItem">
<GridColumns>
<GridColumn Field="@nameof(GridModel.Foo)" Title="Foo (bug)" />
<GridColumn Field="@nameof(GridModel.Bar)" Title="Bar (workaround)">
@*<EditorTemplate>
@{
var item = context as GridModel;
// workaround 1
if (item.IsEditable)
{
<TelerikTextBox @bind-Value="@item.Bar" />
}
else
{
<span class="k-textbox k-input k-rounded-md">
<input class="k-input-inner" tabindex="0" readonly value="@item.Bar" />
</span>
}
}
</EditorTemplate>*@
</GridColumn>
<GridColumn Field="@nameof(GridModel.IsEditable)" Title="Is Row Editable?" Editable="false" />
</GridColumns>
</TelerikGrid>
@code {
List<GridModel> GridData { get; set; }
void EditItem(GridCommandEventArgs args)
{
GridModel item = args.Item as GridModel;
if (!item.IsEditable)
{
args.IsCancelled = true;
}
}
void UpdateItem(GridCommandEventArgs args)
{
var argsItem = args.Item as GridModel;
var index = GridData.FindIndex(i => i.Id == argsItem.Id);
// workaround 2
//if (index != -1 && argsItem.IsEditable)
//{
GridData[index] = argsItem;
//}
}
protected override void OnInitialized()
{
GridData = new List<GridModel>();
for (int i = 1; i <= 5; i++)
{
GridData.Add(new GridModel()
{
Id = i,
Foo = "Foo " + i.ToString(),
Bar = "Bar " + i.ToString(),
IsEditable = i % 2 == 0
});
}
}
public class GridModel
{
public int Id { get; set; }
public string Foo { get; set; }
public string Bar { get; set; }
public bool IsEditable { get; set; }
}
}
Allow the Grid to support Enums which are mapped to use datatypes different from int. Currently, if I try to use the following Enum, an InvlidCastException is generated:
public enum ShortEnum : short
{
Value1,
Value2,
Value3
}
I am adding validation messages for the popup form fields and I do not want to display the ValidationSummary in addition to them. Please add option to remove it.
---
ADMIN EDIT
---
Built-in field validation messages will be exposed in future version of the product. Thus, you can add inline or tooltip validation messages to the Popup edit form without an EditorTemplate.
For the time being, you can remove the ValidationSummary with some CSS. Here is an example of hiding the ValidationSummary and adding inline ValidationMessage for the ProductName field: https://blazorrepl.telerik.com/cckycgPf37NZfy9J11
Currently, the validation of the grid can be disabled altogether via the GridValidationSettings.Enabled option. However, we cannot control the validation of the grid per column.
Also, we cannot control when the validation is triggered. The simple inputs expose the ValidateOn option, but it cannot be set to the default editors of the grid without the need for an explicit declaration of a custom editor.
Hello,
Currently the Id and Field properties of GridColumnState in the GridState do not have setters. As a result, these properties are not deserialized, e.g. when sending GridState information from the client to the server in WebAssembly apps.
I would like to determine the existing columns in the Grid and tailor the database request, so that the fetched data includes only the required columns.
Another possible use case is detecting outdated GridState information in localStorage, after the app has been updated and the Grid contains different columns.
I have enabled the Column Menu and I am using a Filter Menu Template with only one TextBox. With this setup I am able to only type one letter before the Filter Context is reset.
Reproduction: https://blazorrepl.telerik.com/wnYxagGE14oxMFH659.
The value of the FileName parameter is not updated properly in the OnBeforeExport event handler.