Telerik Forums
UI for Blazor Forum
0 answers
522 views

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?

 

 

Eric
Top achievements
Rank 2
Iron
Iron
 asked on 18 Apr 2023
1 answer
566 views

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

 

Dustin
Top achievements
Rank 2
Iron
Iron
 answered on 18 Apr 2023
1 answer
128 views

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

  • When adding a new Break, the START time should pre-populate with the Scheduled Events actual starting time.  Example: First Shift is from 7:00 AM to 2:30 PM.  When adding a new Break, the start time should pre-populate as 7:00 AM.
  • When you add a new Break and change the START time, it should automatically adjust the END time to at least the same START time + 15 or 30 or xxx minutes.

 

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>

Tsvetomir
Telerik team
 answered on 17 Apr 2023
1 answer
304 views

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

Radko
Telerik team
 answered on 17 Apr 2023
0 answers
112 views

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 ?

 

Richard
Top achievements
Rank 1
 asked on 16 Apr 2023
0 answers
186 views

Is there any way to alter/customize the TelerikFilter FilterFields to be able to set a Visible attribute or add a filter template to add your own code to be filtered by?

I have a grid that has a few dropdown list columns that need those values to be in the filter and I have some filterfields that i want to hide under certain conditions. From the documentation, I could not see a way that this is possible.

With grid columns I am able to set them visible true/false as well as add a FilterTemplate. I just want to know if its possible on a FilterField of a TelerikFilter? I only seem to be able to set the attributes Name, Label, and Type.

Thank you!

William
Top achievements
Rank 1
 asked on 14 Apr 2023
0 answers
109 views

When I have a page with a fixed width sidebar, and the pager is in the content area of the page, the adaptive rendering of the pager does not work correctly.   I would expect that as the screen size gets smaller, that the pager will start to drop off the page info and the page size dropdown.  However, it doesn't do this, and it creates a horizontal scrollbar across the page.  Here is a repl illustrating the issue:

https://blazorrepl.telerik.com/wxOIPSvd41wFZsZO20

In my troubleshooting, it looks like the adaptive code to drop off the page info and page size is done somewhere in javascript, and I can't find what logic is being used to set a display: none Style on those items.

What can be done to get this functionality to work when there is a sidebar layout?

 

Mike
Top achievements
Rank 1
Iron
Iron
 asked on 14 Apr 2023
1 answer
516 views

Is it possible to enable or disable the drag & drop feature per row?

I have two or more grids that display products with a quantity field. Dragging from the master grid will move the product and quantity from one grid to an other. When this happens, the secondary grid will get the total quantity from the master grid, leaving the original row with 0 quantity. When the quantity is 0, I want to disable the dragging feature for this particular row. When part or all of the quantity is returned to the original master row, the dragging feature should once again be enabled. I also want to disable drag & drop on the same grid.

It seems to me that there is no drag start event to trigger a possible cancel of drag drop or a drag over event to disable droping an item.

Tsvetomir
Telerik team
 answered on 14 Apr 2023
1 answer
520 views
Dear Team,

I am looking into the possibility to show a dialog via a capsulated service (DialogService.Show<DialogType>(...) ) but because the dialogs are only made visible they have to be in place. I managed to do this via a DynamicComponent, but I would like to inject the dialog dynamically into the dom. I have no idea how to do that though. In WPF f.e. I can add a new object into the tree at any given place. Is this not possible in Blazor?
Would love to get some support on putting such a service for showing a dialog just by a given type from an injected "Service".

Thanks for your help and best regards

Gerrit Puddig
Svetoslav Dimitrov
Telerik team
 answered on 14 Apr 2023
1 answer
329 views

Hi,

I am using telerikgrid control to present my data on the page. 

I am using a header GridCheckboxColumn to select the rows. I want to put a condition so that some rows cannot be selected (disabled for selection).

Please can someone provide some solution for this requirement.

 

Thanks,

 

Afreen

Hristian Stefanov
Telerik team
 answered on 13 Apr 2023
Narrow your results
Selected tags
Tags
+? more
Top users last month
Rob
Top achievements
Rank 3
Bronze
Iron
Iron
Sergii
Top achievements
Rank 1
Iron
Iron
Dedalus
Top achievements
Rank 1
Iron
Iron
Lan
Top achievements
Rank 1
Iron
Doug
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Top users last month
Rob
Top achievements
Rank 3
Bronze
Iron
Iron
Sergii
Top achievements
Rank 1
Iron
Iron
Dedalus
Top achievements
Rank 1
Iron
Iron
Lan
Top achievements
Rank 1
Iron
Doug
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?