The Grid selection performance is worse in WASM when there is a command column. Here is a test page with a large page size, which makes this more evident.
<label><TelerikCheckBox @bind-Value="@ShowCommandColumn" /> Show Command Column</label>
<TelerikGrid Data="@DataList"
SelectionMode="@GridSelectionMode.Single"
Height="700px">
<GridColumns>
<GridColumn Field="@(nameof(DataModel.Pos))" Title="Pos" />
@if (ShowCommandColumn)
{
<GridCommandColumn Width="300px">
<GridCommandButton Command="Save" Icon="save">Reset Volume</GridCommandButton>
<GridCommandButton Command="Delete" Icon="delete">Delete</GridCommandButton>
</GridCommandColumn>
}
</GridColumns>
</TelerikGrid>
@code {
bool ShowCommandColumn { get; set; } = true;
List<DataModel> DataList { get; set; }
protected override async Task OnInitializedAsync()
{
DataList = new List<DataModel>();
for (int i = 1; i <= 500; i++)
{
DataList.Add(new DataModel
{
Pos = i
});
}
}
public class DataModel
{
public int Pos { get; set; }
}
}
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 a Grid with numerous columns and I am using inline editing. When in edit mode, I'd like to add custom content to each cell - for example, a validation error message from server validation.
To achieve that, I have to use EditorTemplate. However, I want to keep the default editor because I'd like to avoid having to add the relevant control for every single cell each time I add a new Grid.
The `Context` of `<GridColumn>` is of type `object`, requiring typecasting in order to use the value.
Instead, make `<GridColumn>` generic so that `Context` is strongly typed. If you use `TItem` as the name for the generic then Blazor will infer it without the user having to specify it.
The request targets a hierarchical Grid where some items are expanded - when I edit a parent item and then update it, all the respective detail items collapse.
Please add support for persisting the expanded state of the items.
---
ADMIN EDIT
---
The feature applies to the other data operations as well (for example, paging, sorting, filtering etc.).
Please expose an option to configure the field delimiter for CSV export. I want to set semicolon as field delimiter instead of a comma.
---
ADMIN EDIT
---
Internally the Grid uses SpreadStreamProcessing library to perform the export. That said, a necessary prerequisite to implement the current enhancement is that SpreadStreamProcessing supports settings for changing the delimiter when exporting to CSV. You may vote for the item and follow it to get status email updates.
For the time being, you may customize the exported file to set the desired field separator as suggested in the Grid CSV export - change the comma field delimiter knowledge base article.
Consider the following example. It will trigger AmbiguousMatchException, because reflection discovers two SpecialProp properties.
<TelerikGrid TItem="@GridModel"
Data="@GridData"
AutoGenerateColumns="true">
</TelerikGrid>
@code {
List<GridModel> GridData { get; set; } = new();
protected override void OnInitialized()
{
for (int i = 1; i <= 3; i++)
{
GridData.Add(new GridModel()
{
SpecialProp = i,
Text = "Text " + (i * 111)
});
}
}
public record GridModel : Base1 { }
public record Base1 : Base2
{
public new decimal? SpecialProp { get => base.SpecialProp / base.HelperProp.GetValueOrDefault(1); set => base.SpecialProp = value.HasValue ? (int)(value.GetValueOrDefault() * base.HelperProp.GetValueOrDefault(1)) : null; }
}
public record Base2
{
public int? SpecialProp { get; set; }
public string Text { get; set; }
public int? HelperProp = 10;
}
}
Why not replace
private PropertyInfo FieldPropertyInfo => ContainerGenericArgument?.GetProperty(Field);
with something like
PropertyInfo FieldPropertyInfo = ContainerGenericArgument?.GetProperties().FirstOrDefault(p => p.Name == Field);
with the possibility to cache the result from GetProperties()?
Hello,
I want to set AutoGenerateColumns="true", but exclude some of the class members (fields / columns), which I have declared manually in the GridColumns collection.
Key events will allow developers to enhance and customize the Grid keyboard navigation. For example -
Detect when the user presses the down-arrow key when on the last grid row. We want to force a "next page" when they do this, and a "previous page" if they are at the top of the grid and press the up-arrow key.
---
ADMIT EDIT
Everyone, please feel free to list other scenarios as well.
When working with grid column templates, it would be incredibly helpful if you could filter by the content of the cell itself rather than be restricted to a field that is a part of the model. Considering that the main use case of a template is to display something in a different format from how it appears on the model I think it's fair to say that most users would then expect to be able to filter the text they see rather than some value behind the scenes.
This has been problematic for example when trying to show data from a separate object by joining on a common ID value via the template. I understand one option would be to create a separate view model for the purposes of the grid but that potentially adds additional complexity to a project just to add some basic text filtering.
One workaround I've implemented for now is to use the OnRead event to manually filter the initial collection of data for my templated columns. I use a dictionary to map id values to my desired display text and then filter using LINQ. This is workable but again adds a lot of extra steps for something that would ideally be much simpler.
Thanks,
Kevin
So what I propose is a fixed width for a column of the grid (and locked) with the remaining columns auto-sizing.
In my situation, I have an action switch button where the client can delete a row, edit a row etc but the action code dropdown column needs to ALWAYS be the same width. The rest of the columns should automatically size based on the existing behaviour.
Now I have tried using the autosize for just that column, but I have to render the grid first, then run the autosize (which gives a fun show of resizing to the user) then all the columns become fixed width, but the vertical scroll bar doesn't move and stays in its initial position.
This feature request is to provide an option to configure the displayed format of the editor for the GridColumn. It is essential for the numeric and date editing. An alternative would be to follow the DisplayFormat parameter and reuse it in the DatePickers and NumericTextBox. However, we need to gather feedback for the required functionality from our customers.
Scenario
Rendering the grid column like so:
<GridColumn Visible="true" Field="ScalePercent" Title="Scale Percent" DisplayFormat="{0:P5}" VisibleInColumnChooser="false" />
The data in the grid column will show the 5 decimal precision. However, when we go in edit mode the value in the NumericTextBox is restricted to two decimal places.
Workaround
1. Usage of templates
2. Generic change of globalization setting for the NumericTextBox
`culture.NumberFormat.NumberDecimalDigits`
Hi,
is it possible to implement grid attribute that would disable alternating row coloring altogether?
It would leave onHover settings as is.
It's causing us problems when we color rows using onRowRender to custom color a row based on some value in the record, but alternating css "jumps in" and overrides onRowRender.
See attached screenshot (all rows should be green), but alt are still dark-grey )instead of green.
This should me marked as feature or bug.
BR, Smiljan