Hi,
I am using telerikgrid control to display the employees information. I have telerikgridcheckboxcolumn which is bind to a IEnumerable list of employee who are eligible for promotion.
I am looking for a solution to disable this header checkbox when there is none of the employee is eligible for promotion.
Please see below my code snippet for Grid and Checkbox:
<TelerikGrid Data="ShipmentInfo" SelectionMode="GridSelectionMode.Multiple" SelectedItems="SelectedEmployees" Class="grid-no-scroll" Sortable="true" Size="Telerik.Blazor.ThemeConstants.Grid.Size.Medium" Resizable="true" Pageable="false" Height="55vh" ScrollMode="GridScrollMode.Scrollable" FilterMode="GridFilterMode.None" OnRowRender="@OnRowRenderHandler" SelectedItemsChanged="@((IEnumerable<EmployeeInfoDto> employeess) => SelectedItemsChanged(employees))">
<GridCheckboxColumn Title="Allow Promotion" SelectAll="true" CheckBoxOnlySelection="true" HeaderClass="@GetHeaderCssClass()"></GridCheckboxColumn>
private void SelectedItemsChanged(IEnumerable<EmployeeInfoDto> employees)
{
// Checkboxes are disabled for shipments that aren't allowed to be routed but we don't want the select all function to select unroutable shipments
// so remove any unroutable shipments from the given collection and set that to the SelectedItems collection
SelectedEmployees = employeess.Where(s => s.EligibleForPromotion).ToList();
}
Please can you help get my desired requirement.
Thanks & regards,
Afreen
I have a grid that lists some records that have a column called Status. The initial state of the grid does not include any records with a status of "Finished" but I want to allow the user to remove that filter as they need to.
When I use the code below it does not allow me to set a default filter in the grid which can be removed by the end user.
private async Task OnStateInitHandler(GridStateEventArgs<FlagVM> args)
{
var cfd = new CompositeFilterDescriptor()
{
FilterDescriptors = new FilterDescriptorCollection()
{
new FilterDescriptor() { Member = "Status/Name", Operator = FilterOperator.DoesNotContain, Value = "Finished", MemberType = typeof(string) }
},
LogicalOperator = FilterCompositionLogicalOperator.And
};
var state = new GridState<FlagVM>
{
FilterDescriptors = new List<IFilterDescriptor>() {}
};
state.FilterDescriptors.Add(cfd);
args.GridState = state;
}
I've also tried something like this with no luck. I basically want to set the UI filter to an initial state for the user.
protected async Task SetGridDefaultFilter()
{
GridState<FlagVM> desiredState = new()
{
FilterDescriptors = new List<IFilterDescriptor>()
{
new CompositeFilterDescriptor(){
FilterDescriptors = new FilterDescriptorCollection()
{
new FilterDescriptor() { Member = "Status/Name", Operator = FilterOperator.DoesNotContain, Value = "Approved", MemberType = typeof(string) }
},
LogicalOperator= FilterCompositionLogicalOperator.And
}
}
};
await GridRef.SetState(desiredState);
Hi,
I am using Telerikgrid to display the data which I am loading from database.
At a time there can be only couple of 100 records return from database. There is no custom formatting or any calculation when loading the data in the grid. I am not using the paging.
I am still seeing the records are loading in the grid very slowly.
What can be done to improve the performance?
Thanks & regards,
Afreen
Hi,
I am using the Telerikgrid in my code to display the data. I have also implemented the SelectedItemsChanged event to handle and updating a value in the IEnumerable list. The problem which I am facing is the following:
When I am checking or unchecking the TelerikgridCheckboxColumn the SelectedItemsChanged event is firing only on the items which are displaying on the current page not the entire list.
I want this event should fire for all the items in the list not just on the current page.
Can you please help to fix this issue? Do I need to set some property of the Telerikgrid?
Thanks,
Afreen
I am using Telerik.UI.for.Blazor version 4.1.0. I recently cleared my nuget cache, and started getting the error noted below. I have already followed the procedure to clear nuget cache and re-install Telerik.UI.for.Blazor, but I keep getting this build error. This is happening on pages that are using Grid, at line:
var datasourceResult = folderStructure.ToDataSourceResult(args.Request);
error CS0012: The type 'DataSourceRequest' is defined in an assembly that is not referenced. You must add a reference to assembly 'Telerik.DataSource, Version=2.1.3.0, Culture=neutral, PublicKeyToken=29ac1a93ec063d92'.
I have followed the example here to bind the grid to a data table: Bind to DataTable (telerik.com)
Everything seems to work fine, but the searching functionality. Is there something special I have to make that work?
<TelerikGrid Data=@GridData.AsEnumerable() TItem="DataRow"
Pageable="true"
Sortable="true"
Resizable="true"
FilterMode="@GridFilterMode.None"
@bind-PageSize="@PageSize">
<GridSettings>
<GridPagerSettings InputType="PagerInputType.Input"
PageSizes="@AppSettings.PageSizes"
ButtonCount="5"
Adaptive="true">
</GridPagerSettings>
</GridSettings>
<GridExport>
<GridExcelExport AllPages="@true" />
</GridExport>
<GridToolBarTemplate>
<GridCommandButton Command="custom" Icon="@FontIcon.MaxWidth" Size="sm" OnClick="@AutoFitAllColumns">Auto-fit</GridCommandButton>
<span class="k-toolbar-spacer"></span>
<GridCommandButton Command="ExcelExport" Icon="@FontIcon.FileExcel" Size="sm">To Excel</GridCommandButton>
<span title="Searches the items in the below grid." class="tooltip">
<GridSearchBox DebounceDelay="200" Placeholder="Search" Size="sm"></GridSearchBox>
</span>
</GridToolBarTemplate>
<GridColumns>
@foreach (DataColumn col in GridData.Columns)
{
<GridColumn Field="@col.ColumnName" Title="@col.ColumnName">
<Template>
@((context as DataRow).ItemArray[col.Ordinal].ToString())
</Template>
</GridColumn>
}
<GridColumn Field="@nameof(RawDataVm.SearchString)" Title="" Width="1%" ShowFilterCellButtons="false" OnCellRender="@((e) => e.Class = "merge-border")">
<Template>
@("")
</Template>
</GridColumn>
</GridColumns>
</TelerikGrid>
Also, the private TelerikGrid<DataRow> Grid { get; set; } = null!; declaration seems to be null, should it be a different object type?
This might not be the correct place to ask this, but you all have been so much help the past that I figured I'd ask here.
I'm running into a brand new issue where connecting to SignalR in debug(localhost) is no longer working, but the odd part is that everything works just fine in production.
My code (red arrow is where it fails):
The error:
System.Net.Http.HttpRequestException: An error occurred while sending the request. ---> System.IO.IOException: The request was aborted. ---> System.IO.IOException: The response ended prematurely while waiting for the next frame from the server. at System.Net.Http.Http2Connection.<ReadFrameAsync>g__ThrowMissingFrame|69_1() at System.Net.Http.Http2Connection.ReadFrameAsync(Boolean initialFrame) at System.Net.Http.Http2Connection.ProcessIncomingFramesAsync() --- End of inner exception stack trace --- at System.Net.Http.Http2Connection.ThrowRequestAborted(Exception innerException) at System.Net.Http.Http2Connection.Http2Stream.CheckResponseBodyState() at System.Net.Http.Http2Connection.Http2Stream.TryEnsureHeaders() at System.Net.Http.Http2Connection.Http2Stream.ReadResponseHeadersAsync(CancellationToken cancellationToken) at System.Net.Http.Http2Connection.SendAsync(HttpRequestMessage request, Boolean async, CancellationToken cancellationToken) --- End of inner exception stack trace --- at System.Net.Http.Http2Connection.SendAsync(HttpRequestMessage request, Boolean async, CancellationToken cancellationToken) at System.Net.Http.HttpConnectionPool.SendWithVersionDetectionAndRetryAsync(HttpRequestMessage request, Boolean async, Boolean doRequestAuth, CancellationToken cancellationToken) at System.Net.Http.DiagnosticsHandler.SendAsyncCore(HttpRequestMessage request, Boolean async, CancellationToken cancellationToken) at System.Net.Http.RedirectHandler.SendAsync(HttpRequestMessage request, Boolean async, CancellationToken cancellationToken) at Microsoft.AspNetCore.Http.Connections.Client.Internal.AccessTokenHttpMessageHandler.SendAsync(HttpRequestMessage request, CancellationToken cancellationToken) at Microsoft.AspNetCore.Http.Connections.Client.Internal.LoggingHttpMessageHandler.SendAsync(HttpRequestMessage request, CancellationToken cancellationToken) at System.Net.Http.HttpClient.<SendAsync>g__Core|83_0(HttpRequestMessage request, HttpCompletionOption completionOption, CancellationTokenSource cts, Boolean disposeCts, CancellationTokenSource pendingRequestsCts, CancellationToken originalCancellationToken) at Microsoft.AspNetCore.Http.Connections.Client.HttpConnection.NegotiateAsync(Uri url, HttpClient httpClient, ILogger logger, CancellationToken cancellationToken) at Microsoft.AspNetCore.Http.Connections.Client.HttpConnection.GetNegotiationResponseAsync(Uri uri, CancellationToken cancellationToken) at Microsoft.AspNetCore.Http.Connections.Client.HttpConnection.SelectAndStartTransport(TransferFormat transferFormat, CancellationToken cancellationToken) at Microsoft.AspNetCore.Http.Connections.Client.HttpConnection.StartAsyncCore(TransferFormat transferFormat, CancellationToken cancellationToken) at Microsoft.AspNetCore.Http.Connections.Client.HttpConnection.StartAsync(TransferFormat transferFormat, CancellationToken cancellationToken) at Microsoft.AspNetCore.Http.Connections.Client.HttpConnectionFactory.ConnectAsync(EndPoint endPoint, CancellationToken cancellationToken) at Microsoft.AspNetCore.Http.Connections.Client.HttpConnectionFactory.ConnectAsync(EndPoint endPoint, CancellationToken cancellationToken) at Microsoft.AspNetCore.SignalR.Client.HubConnection.StartAsyncCore(CancellationToken cancellationToken) at Microsoft.AspNetCore.SignalR.Client.HubConnection.StartAsyncInner(CancellationToken cancellationToken) at Microsoft.AspNetCore.SignalR.Client.HubConnection.StartAsync(CancellationToken cancellationToken) at HammertimeApp.Pages.TelerikLayout.GetConnection()
Since I am using SignalR to refresh user data in a large portion of my app, I'm currently at a standstill with debugging any new errors.
Any help would be greatly appreciated!
-Dustin
I am trying to create a break time control using the Telerik Grid and Timepicker controls. I set the break start values Min is the schedule series start time. and Max is the schedule series end time. So setting the break start timepicker Min and Max properties correlate to this schedule time frame to keep the break time within the bounds of the schedule.
When I set break end I want the range in the timepicker to reflect break start to schedule end. For example:
I have a schedule that starts at 0600 and ends at 1430.
My first break I choose the start time 0800 from the range of 0600 to 1430. I want to set the break end time to be chosen from a range of 0800 to 0900. In the image the Break End shows the time range of 0600 to 1430... So basically I want to have the break end range be from the break start time set.
in short
I have tried using the events for the Timepicker to help with this, but I can never get it to update. Is there a way to achieve this?
Razor code:
<TelerikGrid Data="@Appointment.Breaks"
EditMode="GridEditMode.Inline"
OnCreate="@CreateHandler"
OnDelete="@DeleteHandler"
OnUpdate="@UpdateHandler"
>
<GridToolBar>
<GridCommandButton Command="Add" Icon="add">Add</GridCommandButton>
</GridToolBar>
<GridColumns>
<GridColumn Field="Description" Title="Description" FieldType="@typeof(string)" Width="50%" />
<GridColumn Field="BreakStart" Title="Break Start" FieldType="@typeof(DateTime)" DisplayFormat="{0:hh:mm:ss tt}" Width="150px">
<EditorTemplate>
@{
var BreakToEdit = context as Break;
<TelerikTimePicker Format="hh:mm:ss tt"
@bind-Value="@BreakToEdit.BreakStart"
Id="timepickerstart"
DebounceDelay="@DebounceDelay"
Min="@Min"
Max="@Max">
<TimePickerSteps Minute="5"/>
</TelerikTimePicker>
}
</EditorTemplate>
</GridColumn>
<GridColumn Field="BreakEnd" Title="Break End" FieldType="@typeof(DateTime)" DisplayFormat="{0:hh:mm:ss tt}" Width="150px" >
<EditorTemplate>
@{
var BreakToEdit = context as Break;
<TelerikTimePicker Format="hh:mm:ss tt"
@bind-Value="@BreakToEdit.BreakEnd"
Id="timepickerend"
DebounceDelay="@DebounceDelay"
Min="@Min"
Max="@Max" >
<TimePickerSteps Minute="5"/>
</TelerikTimePicker>
}
</EditorTemplate>
</GridColumn>
<GridCommandColumn Width="100px">
<GridCommandButton Command="Edit" Icon="edit"></GridCommandButton>
<GridCommandButton Command="Save" Icon="save" ShowInEdit="true" ></GridCommandButton>
<GridCommandButton Command="Delete" Icon="delete"></GridCommandButton>
<GridCommandButton Command="Cancel" Icon="cancel" ShowInEdit="true"></GridCommandButton>
</GridCommandColumn>
</GridColumns>
</TelerikGrid>
Hello,
We have a Blazor Telerik Grid with DetailTemplate. One of the columns in Master/Parent is an editable column. The grid is set with "Incell" for property 'EditMode'.
Issue:-
When the editable column is clicked for editing, the entire grid row(with detail) is collapsed if the row is in expanded mode. Once editing is completed, the grid goes back to its previous state(expanded).
Editing parent column in collapsed mode, works without any issues.
Would like to know if I can keep the grid row in expanded mode while editing(ie. keep the original state) if its in expanded state.
If not, is it the default behavior of hierarchy grid and how can it be overridden?
Note - Tried with OnEdit and OnRowClick events, but the collapse happens before the respective event handler call.
Thanks in advance !
Sreeni
Is there a way to force adaptive rendering ?
We have a blazor app inside a maui build, and when built for windows app, it does not trigger adaptive rendering at the size we need.
Is there a way to force adaptive rendering on, or configure when it will switch ?