Values of FilterMenu are not preserved in GridState.
If FilterRow is used instead of FilterMenu then the values are preserved in GridState.
(I believe that Filtering was preserved with FilterMenu as well in some previous version but I could be wrong.)
Regards,
René
Can you either fix the Export functionality to apply Custom footers that are not aggregated to the exported data or Change Enum options to add a Custom type to allow custom footer template values to be exported along with the other GrigAggregates?
I localize the names of my columns in the models. This works for the root-level model I bind to the grid, but using nested (navigation) properties does not let them pick up the title.
---
ADMIN EDIT
A sample project is attached that showcases the localization of the displayname attribute, and how that works for the main model. Since it does not work for the nested models, a small helper method to extract the required resource manually is added to the Title parameter of such a column.
---
Hi,
I am using a Blazor TelerikGrid component with Virtual ScrollMode. I have set a fixed Height, PageSize that exceeds the rows that fit in the grid, and a RowHeight which I have confirmed fits the row contents and resolves to a computed Height of the same value (using Chrome Dev Tools -> Computed tab). Everything works fine except that sometimes scrolling does not trigger the OnRead event and the rows displayed after scrolling are placeholders.
I don't experience this problem when I click the scroll arrow buttons (up or down). I don't experience the problem at all if I drag the scroll bar up or down. But if I page up/down, or click on the scroll page area up/down it will sometimes work and sometimes not. If placeholders are shown, I only need to click a scroll button up/down a few times for it to then read and display the correct rows.
To reproduce use the attached VS2019 project, click "Telerik Scroll Issue" nav menu, and in the TelerikGrid click the page down areas of the vertical scrollbar 3 times.
<AdminEdit>
I'm using the OnRead / OnCreate / OnUpdate / OnDelete events of the TelerikGrid. Most examples do not use OnRead to load data, instead using OnInitializedAsync().
When performing an update two events will fire, such as OnCreate and then OnRead to reload the grid data - which makes sense. The problem is OnRead is not awaited, so in effect the Read method can reload the data prior to data being updated on the server. This is especially the case if I have a JavaScript delete confirmation prompt.
What's my best way forward? Not use OnRead and use OnInitializedAsync instead? Somehow trigger OnRead again (which would effectively trigger it twice)?
Thanks,
Dave
On initialization of the Grid the oDataString is correct, but when I apply a Filter (through the FilterMenu) or apply a sort to a Grid column the ToODataString extension method throws with null reference exception. If the FilterMode is set to FilterRow or revert back to 2.16.0 everything works as expected.
<AdminEdit>
This bug extends to the functionality of the FilterMenu as a feature and is not connected only to the ToODataString();
</AdminEdit>
When I set more than one group on StateInit, I get an error - either the browser closes, or I see a stack overflow.
I'm using the Grid with a GridToolbar containing a GridSearchBox. I have the following requirement that I wish to be able to implement:
When focus is on the GridSearchBox and I hit Esc I would like to clear the search text.
Sample reproducible with workaround (to initialize the data source so it is not null) is below
Sample error and stack trace
ArgumentNullException: Value cannot be null. (Parameter 'source')
<TelerikGrid Data=@GridData Pageable="true" Height="300px">
<GridColumns>
<GridColumn Field="@(nameof(Employee.EmployeeId))">
<FooterTemplate>
some footer
</FooterTemplate>
</GridColumn>
<GridColumn Field=@nameof(Employee.Salary) Title="Salary">
</GridColumn>
<GridColumn Field=@nameof(Employee.Name)>
</GridColumn>
</GridColumns>
</TelerikGrid>
@code {
public List<Employee> GridData { get; set; } // = new List<Employee>(); // workaround
public class Employee
{
public int EmployeeId { get; set; }
public string Name { get; set; }
public decimal Salary { get; set; }
}
}
At the moment, the focus remains on the cell. It should be in the input so the user does not have to perform an extra action (say, click with the mouse) in order to edit data.
This also applies to inserting a new row - the first cell should be focused.
When I have a grid with Reordable=true and a ComboBox in the HeaderTemplate, I cannot click in the combo box because the reordable functionality prevents it.
---
ADMIN EDIT
This could be exposed through a data- attribute that you could add to your DOM elements so that the grid can know to skip them, for example:
<TelerikGrid Data="@MyData" Height="300px" Pageable="true" Sortable="true" FilterMode="@GridFilterMode.FilterMenu" Reorderable="true">
<GridColumns>
<GridColumn Field="@(nameof(SampleData.ID))" Title="This title will not be rendered">
<HeaderTemplate>
Continent <br />
<div style="text-align:center">Id</div>
<div @onclick:stopPropagation="true" data-draggable="false">
<TelerikComboBox Data="@Continents" Filterable="true" class="headerCombo"
@bind-Value="@SelectedContinentId"
TextField="@nameof(Continent.Name)" ValueField="@nameof(Continent.Id)" Id="MyId">
</TelerikComboBox>
</div>
</HeaderTemplate>
</GridColumn>
<GridColumn Field=@nameof(SampleData.Name) Title="First Name" />
</GridColumns>
</TelerikGrid>
@code {
/* Grid */
string result { get; set; }
void DoSomething()
{
result = $"button in header template clicked on {DateTime.Now}, something happened";
}
public class SampleData
{
public int ID { get; set; }
public string Name { get; set; }
public DateTime HireDate { get; set; }
}
public IEnumerable<SampleData> MyData = Enumerable.Range(1, 50).Select(x => new SampleData
{
ID = x,
Name = "name " + x,
HireDate = DateTime.Now.AddDays(-x)
});
/* ComboBox */
public class Continent
{
public int Id { get; set; }
public string Name { get; set; }
}
IEnumerable<Continent> Continents = new List<Continent>() { new Continent { Id = 1, Name = "Africa" }, new Continent { Id = 2, Name = "Asia" }, new Continent { Id = 3, Name = "South America" } };
public int SelectedContinentId { get; set; } = 1;
}
---
On initialization of the Grid the oDataString is correct, but when I apply a filter or apply a sort to a Grid column the ToODataString extension method generates an incorrect request URL. If I revert back to 2.16.0 everything works as expected.
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.
---
When I enter edit mode for a cell (I used InCell edit mode), the row height decreases.
*** Thread created by admin on customer behalf ***
Example Repo - https://github.com/benhysell/BlazorGridPagingIssue
tldr - OnRead args do not contain the correct page after restoring state without manual intervention.
Project Setup
Steps to Reproduce
Workaround
I currently have a work around, this can be seen in the other page 'Paging Work Around'.
Expected Behavior
If I set grouping in OnStateInit, the GroupFooterTemplate does not have data for the aggregates I have set. If I group manually by dragging a column header, the data is there.
------
ADMIN EDIT: This stems from a framework behavior. The <GridAggregates> tag is a child component of the grid and as such, initializes after the grid. Since there is no event when all such child components are initialized the parent component cannot wait for them before starting to render and thus, it initializes before it can know what aggregates are defined.