I would like to achieve this:
I have a GridLayout width 3 Rows (50px, Auto, 50px)
The second row is expanding due to the Browser-Height.
Inside this second Row I would like to put a Grid that expands along to the maximum available height when the User resizes the Browser.
If I give the Grid the Height of "100%" the Height is too low if the Grid has no rows. I would like to expand the Grid always to the maximum available space. At the moment I try to calculate the height with JavaScript in Pixel but I hope that there would be a better way !?
Is there any ?
I'm using
ChartCategoryAxis Type="@ChartCategoryAxisType.Date" BaseUnit="@ChartCategoryAxisBaseUnit.Fit"
Is there a way to show the labels as DayOfWeek (Wednesday) instead of date (3/1) ?
I have a grid that loads big data. We used to use the ObservableCollection but opted to use the OnRead for better performance (loading takes time when using ObservableData). We have EventAggregators and PropertyChanged events running async OnInitialised().. Does this affect the OnRead event? We manually track the Add, Edit/Update, Delete and Duplicate actions on the grid.
So upon running our blazor app, the grid won't load the data on the grid and has the loading animation on endless loop. (Tried waiting for it to load for about 2 hours). Also tried debugging line per line from which I saw that upon executing the OnRead, the args,Data and args,Total were popullated properly.
<TelerikGrid
OnRead="@OnGridRead"
Data="Data"
Pageable="true"
PageSize="10"
Width="100%"
Sortable="true"
Navigable="true"
Groupable="true"
SelectionMode="GridSelectionMode.Single"
SortMode="@SortMode.Single"
FilterMode="@GridFilterMode.FilterMenu"
Resizable="true"
OnRowClick="OnRowClickCallback"
Reorderable="true"
AutoGenerateColumns="true">
I have a grid that displays financial information nicely. However, I need a second grid to access the selected row from the first grid so that it can display further details.
First (fully functioning) grid in brief:
<TelerikGrid Data="@vm.Model.CO_DetailsList"
@ref="grid"
EditMode="@Telerik.Blazor.GridEditMode.Incell">
<GridColumns>
<GridColumn Field="@nameof(CO_Details.Seg0)" Title="Fund" Width="70px">
<EditorTemplate>
<TelerikComboBox Data="@vmSeg0.Model"
TextField="Value"
ValueField="Value"
TItem="GL_Seg0RO"
TValue="string"
@bind-Value="vm.Model.CO_DetailsList[index].Seg0">
<ComboBoxSettings>
<ComboBoxPopupSettings MaxHeight="@seg0CmbHeight"/>
</ComboBoxSettings>
</TelerikComboBox>
</EditorTemplate>
</GridColumn>
</GridColumns>
</TelerikGrid>
I am stuck with a problem that I just can't seem to solve:
I have built a TelerikForm with a Submit button. The requirement is to change the enabled status of this button depending on whether the form has been modified or not.
So the basic code is :
<TelerikForm @ref="@FormRef"
Model="@EntityModel"
OnSubmit="@OnSubmitHandler"
>
<FormValidation>
<DataAnnotationsValidator />
</FormValidation>
<FormItems>
<CascadingValue Name="TheForm" Value="@FormRef">
@foreach (var form_item in FormItemCollection)
{
<DynamicComponent Type="@form_item.ComponentType" Parameters="@form_item.Parameters" />
}
</CascadingValue>
</FormItems>
<FormButtons>
<TelerikButton
ButtonType="@ButtonType.Submit"
Enabled="@SaveEnabled"
ThemeColor="primary">Speichern</TelerikButton>
</FormButtons>
</TelerikForm>
The ButtonShould be changed on the EditContext.IsModified() state.
So I tried:
protected override void OnAfterRender(bool firstRender) { if (firstRender) { FormRef.EditContext.OnFieldChanged += EditContext_OnFieldChanged; } base.OnAfterRender(firstRender); } private void EditContext_OnFieldChanged(object sender, FieldChangedEventArgs e) { SaveEnabled = true; StateHasChanged(); }
I have a main grid that can have 300+ rows.
Within that each row can be expanded to a sub grid with say 100 rows.
And then each row within that has 4 sub grids that can have 20-30 rows.
I have it built and working but on large accounts this runs way too slow!
Each grid has its own class and there are loops filling in each grid.
I am looking for a faster way to load those grids.
I am wonder if I could be pointed in the direction of an example that shows say how to load each sub grid on the fly when its parent grid is expanded.
Thanks in advance.
Deasun
Hello,
I have the following grid:
<TelerikGrid Data="@Customers"
Pageable="false"
Sortable="true"
ScrollMode="@GridScrollMode.Virtual"
OnRead="@ReadItems"
LoadGroupsOnDemand="true"
FilterMode="@GridFilterMode.FilterRow"
PageSize="20">
<GridColumns>
<GridColumn Field="Number" Title="Nr" Width="150px" />
<GridColumn Field="Zip" Title="ZIP"></GridColumn>
<GridColumn Field="City" Title="City"></GridColumn>
<GridColumn Field="FirstName" Title="First"></GridColumn>
<GridColumn Field="LastName" Title="Last"></GridColumn>
</GridColumns>
</TelerikGrid>
with code-behind:
public async Task<DataEnvelope<CustomerDTO>> FetchPagedData(DataSourceRequest dataSourceRequest)
{
var result = await Http.PostAsJsonAsync(ApiRoutes.Customer.POST_Lazy(), dataSourceRequest);
var fullList = await result.Content.ReadFromJsonAsync<DataEnvelope<CRMCustomerDTO>>();
return fullList;
}
protected async Task ReadItems(GridReadEventArgs args)
{
var dataResult = await FetchPagedData(args.Request);
if (args.Request.Groups.Count > 0)
{
args.Data = dataResult.GroupedData.Cast<object>().ToList();
}
else
{
args.Data = dataResult.CurrentPageData.Cast<object>().ToList();
}
args.Total = dataResult.TotalItemCount;
StateHasChanged();
}
and web-api:
[HttpPost("Lazy")]
public async Task<DataEnvelope<CustomerDTO>> GetLazy([FromBody] DataSourceRequest dataSourceRequest)
{
DataEnvelope<CustomerDTO> dataEnvelope = new();
var customers = await _context.Customer
.Include(c => c.Address)
.ToListAsync();
var customerDTOs = _mapper.Map<List<CustomerDTO>>(customers);
DataSourceResult result = customerDTOs.ToDataSourceResult(dataSourceRequest);
if (dataSourceRequest.Groups.Count > 0)
{
dataEnvelope = new DataEnvelope<CustomerDTO>
{
GroupedData = result.Data.Cast<AggregateFunctionsGroup>().ToList(),
TotalItemCount = result.Total
};
}
else
{
dataEnvelope = new DataEnvelope<CustomerDTO>{
CurrentPageData = result.Data.Cast<CustomerDTO>().ToList(),
TotalItemCount = result.Total
};
}
return dataEnvelope;
}
Now, when im calling the method FetchPagedData() the filters are set correctly.
However, in GetLazy() the filters are not. The correct amount of filters is set, but every set filter is empty with the operator IsEqualTo.
Why is that and how can I fix it?
I tried building my own object with the filters and recreate it from there, but I can't access the members of IFilterDescriptor.
Any help is much appreciated!