Hello,
I'm having issues trying to figure out how to change values (from the model) when I'm Incell Mode without triggers the OnRead events after. The actual code is working great since I was able to remove the Incell mode on the OnChangeModel event below, but OnRead is keeps call after (which I didn't need and slow user experience)
Is there a way to cancel the OnRead ?
<TelerikGrid OnRead="ReadItems" EditMode="GridEditMode.Incell"
@ref="@GridRef">
<GridColumns>
<GridEditDropDownColumn Field="Test1" Data="@Eval?.ListEvaluationTypes" Title="Title" Width="130px" OnChange="OnChangeModel" />
</GridColumns>
</TelerikGrid>
private TelerikGrid<EvaluationListDTO> GridRef { get; set; }
protected async Task OnChangeModel(object model)
{
var item = (EvaluationListDTO)model;
var state = GridRef?.GetState();
//Save in the Database
// use the state to remove the edited item (close the editor)
state.EditItem = null;
state.OriginalEditItem = null;
await GridRef.SetStateAsync(state);
}
It is a common request to show grids in alternating colors, rather than simply white and grey. Because the Grid component generates the <tr> element, we are left with manually setting each <td> element. A tedious but effective solution.
The feature I would like to request is to add 2 new tags to the <TelerikGrid> component, call them EvenRowClass, and OddRowClass. The behavior is the same as the Class tag, but they operate on Even and Odd numbered rows of data, respectively. Their values would be added to the <tr> element as <tr class="MyEvenClass"> or <tr class="MyOddClass" in the same manner class k-alt is generated or not. This would provide a simple yet extensible mechanism to achieve custom alternating row colors in a Grid.
Selection performance suffers if the Grid has a large page size and uses child components in column templates:
https://blazorrepl.telerik.com/QHaLcVbl25YrVZU821
This is because the Grid doesn't apply performance optimizations for templates and always re-renders them.
Please expose a setting to disable re-rendering if it's not necessary.
There should be a way to provide the Format for filtering of DateTime columns.
If a DateTime column has the format "dd.MM.yyyy" filtering for "EQUALS 01.01.2021" does not show lines with the timestamp "01.01.2021 01:00" but the user would expect to see this line.
Regards,
René
Grid - Import from Clipboard (Excel) when column name matches the first row header
I think it would be a great feature to be able to import copied data from excel into the grid either based on the index of the column or the header row in the clipboard matches the name of the column in Blazor Grid.
---
ADMIN EDIT
You can find an example of implementing this and the caveats it brings in the following sample project: https://github.com/telerik/blazor-ui/tree/master/grid/paste-from-excel
This feature requires research on how we could provide it as a built-in feature. So, any feedback on the matter will be appreciated.
---
We found out during SQL profiling that when bound to an IQueryable (linked to DbContext) with pagination enabled, the Telerik data grid called SQL to count elements twice. This is not a pre-render problem as those deplicated queries are actually executed twice (one pair for each render).
Our simplified code:
<TelerikGrid TItem="Item"
Data="_data"
PageSize="10"
Pageable="true"
Sortable="true">
<GridColumns>
<GridColumn Field="@nameof(Item.Id)" />
<GridColumn Field="@nameof(Item.Code)" />
</GridColumns>
</TelerikGrid>
@code {
[Inject] protected DbContext DbContext { get; set; }
private IEnumerable<Item> _data;
protected override void OnInitialized()
{
base.OnInitialized();
_data = DbContext.Items
.Select(x => new Item()
{
Id = x.Id,
Code = x.Code
});
}
}
===
ADMIN EDIT:
There are two possible ways to avoid the double COUNT:
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
}
Hi, please expose the debounce delay as a property of TelerikGrid so we can set how soon virtualized columns are loaded after the user scrolls.
**Admin Edit**
This feature request requires research, and if such DebounceDelay parameter can work with good quality in all cases - it will be implemented. Additionally, we will revise the feature together with loading next set of columns if it will be applicable.
**Admin Edit**
I have a grid that i use to display a number of different items with, some that have the need to display child or hierarchical grids, and some that don´t.
At the moment, all of the items show the "plus" button to expand the child grid, event though there is nothing there to show.
When a collection is null I think that the "plus" button to expand the hierarchical, or child grid, should be hidden.
Or at least I should be able to hide that button manually by choice.
Regards Magnus.
I have applications for which I would like to define the default join operator for Grid filters to be "OR" instead of the default "AND."
Please expose an option to customize the default logical operator in Filter Menu.
For example, I'd like something like this:
Field Name: record.TotalSales -> Auto-generated column title: "Total Sales" with inserted space
ADMIN EDIT: See also the idea below about "AutoGeneratedTitles" Func<string, string> property where the user could perform whatever processing they liked upon the default value. Please leave your comment on what approach you would prefer to be exposed.
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`
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.