Expose GroupableSettings with an option to specify whether to render the group footer. The possible values should be always (like current implementation), or when the group is expanded. An example (just for demonstration) api would be:
```
<GridSettings>
<GridGroupableSettings Footer="@GridGroupableFooterVisible.Always | @GridGroupableFooterVisible.Expanded"></GridGroupableSettings>
</GridSettings>
```
I'd like for someone to be able to select all of the rows in a particular group. The main selection checkbox will just select all of the rows.
It would be nice if this also worked for sub grouping.
I want to place the Pager on top of the Grid. I know it can be handled with a Pager component integration in the Grid Toolbar, but I want to use the Toolbar for other purposes/actions. Please allow control over the Pager position.
I have created a custom model where I added an ExpandoObject and a couple properties to it. The Grid seems to render the data successfully but the data operations are not possible - the nested properties are treated as invalid. Please add support for nested ExpandoObject properties in custom models.
---
ADMIN EDIT
---
For the time being, there is a workaround that you may try. Use the ExpandoObject directly, do not nest it in the custom model - bind the Grid Data to a collection of ExpandoObject and populate its properties in the OnInitialized.
@using System.Dynamic
<TelerikGrid Data="@Data"
Pageable="true" Sortable="true" Groupable="true"
FilterMode="Telerik.Blazor.GridFilterMode.FilterRow"
EditMode="@GridEditMode.Incell"
Resizable="true" Reorderable="true">
<GridColumns>
<GridColumn Field="Id" FieldType="typeof(string)" Width="120px" />
<GridColumn Field="DetailData.PropertyInt" Title="Column A" FieldType="@typeof(int)" />
<GridColumn Field="DetailData.ProptertyString" Title="Column B" FieldType="@typeof(string)"/>
<GridColumn Field="DetailData.PropertyDate" Title="Column C" FieldType="@typeof(DateTime)"/>
</GridColumns>
</TelerikGrid>
@code {
public ExpandoObject[] Data { get; set; } = Array.Empty<ExpandoObject>();
protected override async Task OnInitializedAsync()
{
Data = new ExpandoObject[]
{
GetPopulatedExpando(1),
GetPopulatedExpando(2),
GetPopulatedExpando(3),
GetPopulatedExpando(4),
GetPopulatedExpando(5),
};
}
private ExpandoObject GetPopulatedExpando(int id)
{
dynamic expando = new ExpandoObject();
expando.Id = id;
dynamic nested = new ExpandoObject();
nested.PropertyInt = id;
nested.ProptertyString = "ID " + id;
nested.PropertyDate = new DateTime(2022, 4, id);
expando.DetailData = nested;
return expando;
}
}
Disabling the LoaderContainer prevents the Incell edit mode to work as expected
<AdminEdit>
As a workaround, set the Navigable attribute to true.
</AdminEdit>
I would like to request a simple update to the Grid component.
When a column width is too small - the column header text is cut-off or is unreadable.
For example:
It would be nice that on mouse hover, the full title would be rendered. Currently to achieve this, I have to implement a custom <HeaderTemplate> for every grid column and add a span myself:
<GridColumn Field="@nameof(SalesOrderLineItem.Quantity)">
<HeaderTemplate>
<span title="Order Quantity">Order Quantity</span>
</HeaderTemplate>
</GridColumn>
Can you update the GridColumn component and add a title attribute to the column <th> element so the browser can show the fill title should the user hover over it?
Internally it looks like you are using RadSpreadStreamProcessing for grid.ExportToExcelAsync() if you gave us an optional lamdba to manipulate IRowExporter while you are processing, it would make things a lot easier.
There were a couple other feature requests out there that you closed offering alternatives ways of doing this and we are actually just importing the stream back to RadSpreadProcessing object and then manipulating that way. Adding the Lambda would be a much more efficient way of handling this use case and probably very simple for you to implement.
Grouping by a nested (child) Grid column is not possible in OnStateInit.
A possible workaround is to group in OnAfterRenderAsync.
@using Telerik.DataSource
<TelerikGrid Data=@GridData @ref="TheGrid"
Groupable="true"
OnStateInit="@((GridStateEventArgs<User> args) => OnStateInitHandler(args))">
<GridColumns>
<GridColumn Title="Personal Information">
<Columns>
<GridColumn Field=@nameof(User.LName) Title="Last Name" />
<GridColumn Field=@nameof(User.FName) Title="First Name" />
</Columns>
</GridColumn>
<GridColumn Title="Status and Last Login">
<Columns>
<GridColumn Field=@nameof(User.StatusName) Title="StatusName" />
<GridColumn Field=@nameof(User.LastLoginDate) Title="Last Login" DisplayFormat="{0:yyyy-MMM-dd}" />
</Columns>
</GridColumn>
</GridColumns>
</TelerikGrid>
@code {
TelerikGrid<User> TheGrid { get; set; }
List<User> GridData { get; set; }
protected override void OnInitialized()
{
var data = new List<User>();
for (int i = 1; i <= 20; i++)
{
data.Add(new User()
{
Id = i,
FName = "First Name " + i,
LName = "Last Name " + i,
StatusId = i * 123,
LastLoginDate = DateTime.Now,
StatusName = "Status Name " + (i % 5 + 1)
});
}
GridData = data;
}
private void OnStateInitHandler(GridStateEventArgs<User> args)
{
GridState<User> desiredState = new GridState<User>()
{
GroupDescriptors = new List<GroupDescriptor>()
{
new GroupDescriptor()
{
Member = nameof(User.StatusName),
MemberType = typeof(string)
}
}
};
// will trigger an exception if grouping by a nested column
args.GridState = desiredState;
}
@*protected override async Task OnAfterRenderAsync(bool firstRender)
{
if (firstRender)
{
var desiredState = TheGrid.GetState();
desiredState.GroupDescriptors = new List<GroupDescriptor>()
{
new GroupDescriptor()
{
Member = nameof(User.StatusName),
MemberType = typeof(string)
}
};
await TheGrid.SetState(desiredState);
}
await base.OnAfterRenderAsync(firstRender);
}*@
public class User
{
public long Id { get; set; }
public int StatusId { get; set; }
public string StatusName { get; set; }
public string FName { get; set; }
public string LName { get; set; }
public DateTime LastLoginDate { 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
}
Column resizing does not work correctly together with filter row and detail template.
Resize the second or the third column to any direction. The first column will shrink to the same width, as the expand column.
This broke in version 2.24.
<TelerikGrid FilterMode="Telerik.Blazor.GridFilterMode.FilterRow"
Data="@GridData"
Resizable="true">
<DetailTemplate>
detail template
</DetailTemplate>
<GridColumns>
<GridColumn Field="Id" />
<GridColumn Field="Id" Title="Resize Me First" />
<GridColumn Field="Id" Title="Resize Me First" />
</GridColumns>
</TelerikGrid>
@code {
List<GridModel> GridData { get; set; }
protected override void OnInitialized()
{
List<GridModel> data = new List<GridModel>();
for (int i = 1; i <= 3; i++)
{
data.Add(new GridModel { Id = i });
}
GridData = data;
}
public class GridModel
{
public int Id { get; set; }
}
}
Does the Blazor grid have any support for any or all queries on sub-property collections? I would like to have the grid OnRead be able to generate a query against a sub-entity collection.
E.g.
GET serviceRoot/People?$filter=Emails/any(s:endswith(s, 'contoso.com'))
From what I can tell the Column.FieldName property only will generate a valid query for scalar properties. Is there any way to make this work?
Given the Northwind OData sample https://demos.telerik.com/kendo-ui/service-v4/odata. I would like to display a grid of all customers. In the grid, I would like to have a column that provides filtering for the orders shipper column as in the query below.
https://demos.telerik.com/kendo-ui/service-v4/odata/Customers?$expand=Orders&$filter=Orders/any(d: contains(d/Shipper/CompanyName,'Speedy Express'))
There does not seem to be a way for the in-built filter mechanism to use a lambda and it seems like there should be.
When you type something in the grid searchbox, there will be a X at the end to clear the box.
However, if you restore the grid from previously stored state like localstorage, and if the box has value, the X is not there.
Thanks!
Hello,
My Grid is setting filters in OnStateInit. Then, the filters are cleared via GridRef.SetState(null)
This used to work until 3.0.1, but not in 3.1.0. Here is a test page:
https://blazorrepl.telerik.com/mmEdFnvA31osNnjO20https://blazorrepl.telerik.com/QGadEnbT24qbDh1G49
If the window component does not implement a Width parameter, it will seem like docked to right when dragging. The issue stems from the update of top and left styles while the width of the component grows with them.
1. Open the repl
2. Initiate dragging
**Workaround**
Set the Width parameter of the Window component
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; }
}
}