When using the Filter Menu inside the Column Menu filter value is reset if Rebind is called. For reference, if using FIlter Row or a standalone Filter Menu value is not reset upon invoking Rebind.
Reproduction: https://blazorrepl.telerik.com/mdOJYHas48vPCPUv47.
Are there any plans to have the datagrid be both groupable and draggable?
Thanks,
Andy
The value of the FileName parameter is not updated properly in the OnBeforeExport event handler.
In this example. Select a cell in column C. Then double click on another cell in column C. The unhandled exception will show up and a null reference exception is logged in the console.
https://blazorrepl.telerik.com/QHuSQBlj170zO4u130
The exception message is:
System.InvalidOperationException: TelerikValidationComponent requires a cascading parameter of type EditContext. You can use Telerik.Blazor.Components.TelerikValidationTooltip`1[System.String] inside a EditForm or TelerikForm.
I am binding a Grid to a collection of ExpandoObjects. In the collection, there are decimal values. When I try to add Aggregates for the decimal values the Grid throws an exception.
<AdminEdit>
As a workaround, you can cast the decimal values to double instead.
</AdminEdit>
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);
}
===ADMIN EDIT===
Currently, we use groups for calculating all aggregates in Grid. We can optimize the process so that when there are no groups, specific aggregates are still calculated.
The problem is when filtering programmatically, the X that is normally used to clear the search box disappears.
I am following the Telerik guide here. https://docs.telerik.com/blazor-ui/components/grid/filter/searchbox
The problem is actually demonstrated in the example from that page.
Filtering by typing:
Filtering programatically:
Thanks.
When you combine frozen column with row selection and horizontal scrolling is applied (due to column and grid widths), column content are not hidden under frozen columns when a row is selected, as seen bellow in lines 2,3 and 4.
Checkbox, Product Name & Command columns are frozen. "Quantity per Unit" values are clearly visible behind frozen "Product Name" values. You can find a test scenario here (Telerik REPL for Blazor).
All themes suffer from this issue except Fluent theme. With default and bootstrap themes it happens on all odd selected lines and with material theme it happens on all selected lines.
The Blazor TelerikGrid component should support a dropdown column. It should be exactly the same as the dropdown column in the Ajax grid.
https://docs.telerik.com/devtools/aspnet-ajax/controls/grid/columns/column-types#dropdown
It seems the Grid and GridSearchBox assume the search string by taking the value of GridState.SearchFilter.FilterDescriptors[0].Value and this is causing a few issues:
I am expanding grid search to include non-string columns, and I want this to apply by default across our entire application without having to update every grid individually or developers having to remember to opt in.
To search other type columns, I’ve largely taken the logic from Search Grid in numeric and date fields - Telerik UI for Blazor and it works well. However, that solution utilizes a custom search box component that I would have to add to each grid.
Instead, I have placed this filter creation logic in the OnStateChanged handler as exemplified in How to Search Grid Items with a StartsWith Filter Operator - Telerik UI for Blazor, as we already have a handler for this event that all grids utilize.
This has worked wonderfully except for the issues I’ve mentioned.
If the first filter is a CompositeFilterDescriptor, it causes an exception. Specifically:
Unable to cast object of type 'Telerik.DataSource.CompositeFilterDescriptor' to type 'Telerik.DataSource.FilterDescriptor'.
at Telerik.Blazor.Components.Common.TableGridBase`2.LoadSearchFilter(IFilterDescriptor descriptor)
at Telerik.Blazor.Components.TelerikGrid`1.SetStateInternal(GridState`1 state)
at Telerik.Blazor.Components.TelerikGrid`1.<SetStateAsync>d__311.MoveNext()
at Web.Pages.Grid.<OnStateChangedHandler>d__18.MoveNext() in C:\src\Web\Pages\Grid.razor:line 196
If there is another filter in the collection that is not a CompositeFilterDescriptor, I can work around this problem by moving it to the front of the list.
// Make sure first filter is not composite.
var nonCompositeFilter = newSearchFilter.FilterDescriptors.OfType<FilterDescriptor>().FirstOrDefault();
if (nonCompositeFilter is not null && newSearchFilter.FilterDescriptors[0] is CompositeFilterDescriptor)
{
newSearchFilter.FilterDescriptors.Remove(nonCompositeFilter);
newSearchFilter.FilterDescriptors.Insert(0, nonCompositeFilter);
}
However, if all filters are composite, the exception is unavoidable.
If the GridState.SearchFilter.FilterDescriptors collection is empty, the search box gets cleared. This is a problem when a user needs to type more characters for a filter to be created.
For example, let’s say you are only searching DateTime columns and using the logic from Search Grid in numeric and date fields - Telerik UI for Blazor. As you type, it checks to see if the input is an integer between 1000 and 2100. Until you type the fourth digit, it will not meet that condition thus will not add a filter. So if you begin by typing “2”, it searches and a filter will not be added yet. However, because there are no filters, it will clear the search box. You won’t be able to type out a full year value of “2023” unless you type fast enough to outpace the debounce delay.
Using the same example as above but with an Enum column instead of a DateTime, begin typing text. If the text matches an enum name, a filter is added for the enum item’s underlying value. For example:
Sample project attached.
Hello,
new version has broken "dynamic" changing column properties/visiblity runtime, especially- selection mode and causing lot of "rerendering".
Video attachment:
1 - first part is OLD version(prior 4.1.0) 4.0.1
2 - seccond part(after changing next browser tab) is new version 4.1.0
SAME setup
Iam already using hint for blazor with IDs of columns, found in Your documentation...etc. @key="@("sIDX")"
.....
-->>Clicking on Button for changing grid mode and visibility of columns**
<TelerikToggleButton Title="Oznaceni vice radku" Icon="@FontIcon.ListUnordered" OnClick="@( _ =>{ CurrentStackItem.gSelectionMode=(CurrentStackItem.gSelectionMode==GridSelectionMode.Multiple)?GridSelectionMode.Single:GridSelectionMode.Multiple;CurrentStackItem.gSelectedItems = Enumerable.Empty<ExpandoObject>();})"
Selected="@(CurrentStackItem.gSelectionMode==GridSelectionMode.Multiple)"></TelerikToggleButton>
....
<GridColumns>
-->>First "static" 2 columns**
<GridCheckboxColumn Visible=@(CurrentStackItem.gSelectionMode==GridSelectionMode.Multiple) @key="@("sIDX")" Width="70px" Locked="true" SelectAll="true" SelectAllMode="GridSelectAllMode.Current"></GridCheckboxColumn><GridColumn FieldType=@typeof(bool) Visible=@(IsPicker==true || (XSmall==false && CurrentStackItem.gSelectionMode==GridSelectionMode.Single )) @key="@("sCMD")" Filterable="false" Sortable="false" Locked="true" Width="@((IsPicker==true && XSmall==true)?"45px":"120px")">
<HeaderTemplate> </HeaderTemplate><Template Context="ctx"><div @onclick:preventDefault="true" @onclick:stopPropagation="true">
-->> THIS part is hitting LOT OF TIME in debug (expected is at best only once)
@{if (XSmall==false)
{
-->> here is LOT OF dynamic buttons.
}
</div></Template></GridColumn>
-->> rest of the dynamic columns. In video, starting with "ciiislo org" in header
@if (GridDef.ColStore != null && GridDef.ColStore.Any())
{
foreach (var it in GridDef.ColStore.Where(x => x.Verejny == true))
{
<GridColumn @key=@it.FldName Field=@it.FldName FieldType=@it.FldType Title=@it.VerejnyNazev ShowFilterCellButtons="false" Width=@it.cSirkaSestava
TextAlign=@it.cZarovnani
><FooterTemplate>
@if (it.Sumovat == true)
{
@context.Sum
}
</FooterTemplate></GridColumn>
}
}
</GridColumns>
Feel free to change the Subject.
Thanks, have a nice day