Telerik Forums
UI for Blazor Forum
2 answers
25 views

I discovered an issue with auto-sizing grid columns with a DetailTemplate, but it depends on if the DetailTemplate is displayed or not. It seems that when the DetailTemplate is not shown, the AutoSize works as expected, but when the DetailTemplate is shown the AutoSIze seems to size to the column header only. 

In addition, the top table has a column with an unspecified width so it will fill the space to get the table to 100%. I noticed that on AutoSize the total table width and the other column kept their original width. When columns resized larger than they were, this made the overall table too long and scrollable. So after the resize, I used the table state and set the table and column with to null.

await grid.AutoFitColumnAsync("colProjectDetailModuleAmbTemp");
await grid.AutoFitColumnAsync("colProjectDetailModuleTitle");

var st = grid.GetState();
st.ColumnStates.Where(c => c.Id == "colProjectDetailModuleDesignTypes").First().Width = null;
st.TableWidth = null;

await grid.SetStateAsync(st);

I have attached images for your reference.

Is it a bug that the AutoSize is only using the column headers when the DetailTemplate is shown or am I missing something to get it to resize correctly?

Johnathan
Top achievements
Rank 1
Iron
Iron
 answered on 04 Apr 2025
2 answers
59 views
Hi folks,

I am trying to upload a file to a state container using the FileSelect component.

private async Task OnFileSelected(FileSelectEventArgs e)
{
try
{
foreach (var file in e.Files)
{

using var memoryStream = new MemoryStream();

byte[] buffer = new byte[81920]; // 80 KB buffer size
int bytesRead;

while ((bytesRead = await file.Stream.ReadAsync(buffer, 0, buffer.Length)) > 0)
{
await memoryStream.WriteAsync(buffer, 0, bytesRead);
}

byte[] fileBytes = memoryStream.ToArray();

// Store file in state container
await FileState.AddFileContentAsync(file.Name, fileBytes);

}

}
catch(Exception ex)
{
Console.WriteLine("Error uploading files " + ex.Message);

}

StateHasChanged();
}
Here file.Stream.ReadAsync is not working. 
In Visual studio for the file.Steam property I am getting the following error message.

SYNCHRONOUS_FILESTREAM_READ_ERROR property
Synchronous actions on the file stream is not supported by the Blazor framework in Blazor Server-side apps due to the SignalR communication between the client and the host. Use the 'ReadAsync' method instead.

and the code does not continue to execute after the line  while ((bytesRead = await file.Stream.ReadAsync(buffer, 0, buffer.Length)) > 0) 
bimal
Top achievements
Rank 1
Iron
 answered on 03 Apr 2025
1 answer
47 views

I have a blazor hybrid app with a basic FileSelect component. When I start the Windows Native MAUI app, the drag-and-drop feature of the component does not work at all. The drag of any file into the MAUI window shows a stop/not possible sign as the mouse pointer. In the Web version everything works as expected.

There was also no note here that this might not work due to some restriction

Tsvetomir
Telerik team
 answered on 03 Apr 2025
1 answer
68 views

Hello,

I have a 2 date pickers. I have a button that clears all fields in my form which works when the dates are fully filled, but not if they are partially filled. I want to clear them with my button and not have to use the ShowClearButton (x button) that is built into the date picker. Not sure if there is already a solution for this, but I could not find one.

Anislav
Top achievements
Rank 6
Silver
Bronze
Bronze
 answered on 02 Apr 2025
2 answers
26 views

I see a similar question asked and answered at the link below but couldn't find anything similar in the Blazor forums. I would like to rename the last button from Done to Submit.

Rad wizard next button text in UI for ASP.NET AJAX | Telerik Forums

Dimo
Telerik team
 answered on 02 Apr 2025
2 answers
34 views

I have several grids in my app, but I've noticed that when I set a height on a grid (to show the scroll bar and make the grid vertically fill its container), the header row seems offset.

Here's a grid with no height;

 

And with Height="70vh" set on the same grid;

 

The headers are slightly offset - on other grids, it also appears that the more rows, the more offset the headers become.

Anyone have any ideas what might be causing this? Ive not found anything that even plausibly could be causing it in my code.

 

Richard
Top achievements
Rank 1
Iron
Iron
 answered on 01 Apr 2025
1 answer
39 views

Hello Telerik team,

I'm new in Blazor environment, and I would like to use a mix of controls in order to display data. The goal is to have several columns and rows (like DataGrid control),:

  • columns represent calendar days (like Scheduler control);
  • rows representing "stations" [tasks] (like Gantt control);
  • core of the control (crossing between rows and columns) represented as chipset (my data).

In fact, I think the best control could be the Gantt control because of its structure and content, but I have one issue with that: I won't be able to put an item (chipset) over 2 rows.

Unfortunely, I can't provide you any picture of what I want because of my company restrictions.

Are you able to help me and provide me some advices?

Many thanks,

Valentin M.

Anislav
Top achievements
Rank 6
Silver
Bronze
Bronze
 updated answer on 31 Mar 2025
2 answers
45 views
I would like to use Telerik PDFViewer along with other blazor components librarly but when I incorporate PDF Viewer into my page I have problem with missing buttons and format of PDF viewer toolbar. Viewer display PDF document but toolbar does not work.
What to do to activate PDF Toolbar? Obviously I missed something.
Dimo
Telerik team
 answered on 28 Mar 2025
1 answer
59 views

I have a Blazor DataGrid with three Locked columns. Those locked columns are coming with alternative background  colour on hover. How can I remove that?

I removed background colours as follows

/*Remove alternative row background color for sticky columns on Rows*/
.tgrid-remove-alt-color-sticky-columns-rows .k-master-row.k-table-alt-row .k-grid-content-sticky,
.tgrid-remove-alt-color-sticky-columns-rows .k-master-row.k-table-alt-row.k-grid-row-sticky > .k-table-td,
.tgrid-remove-alt-color-sticky-columns-rows .k-master-row.k-table-alt-row .k-grid-row-sticky {
    background-color: white !important;
}

Tried following to remove the hover background colour, but not luck.

 

.tgrid-remove-alt-color-sticky-columns-rows .k-master-row.k-table-alt-row .k-grid-content-sticky,
.tgrid-remove-alt-color-sticky-columns-rows .k-master-row.k-table-alt-row.k-grid-row-sticky > .k-table-td,
.tgrid-remove-alt-color-sticky-columns-rows .k-master-row.k-table-alt-row .k-grid-row-sticky,
.tgrid-remove-alt-color-sticky-columns-rows .k-master-row.k-table-alt-row .k-grid-content-sticky:hover,
.tgrid-remove-alt-color-sticky-columns-rows .k-master-row.k-table-alt-row.k-grid-row-sticky > .k-table-td:hover,
.tgrid-remove-alt-color-sticky-columns-rows .k-master-row.k-table-alt-row .k-grid-row-sticky:hover {
    background-color: white !important;
}
Anislav
Top achievements
Rank 6
Silver
Bronze
Bronze
 answered on 27 Mar 2025
1 answer
61 views

Hello Telerik,

Thank you for the recently released DockManager component. It really helps,

However, I am trying to use the DockManager's persistent state (GetState(), SetState(), OnStateInit, OnStateChanged), and it seems that the DockManagerState object provided by GetState() and the events is simply wrong:

  • Panel sizes are a mix of their current values, old values and the initial Size settings;
  • When restoring a saved state, sizes are applied inconsistently;
  • SetState(null) does literally nothing.

My goal is to save the DockManager's layout in an external string, then restart the application and restore the DockManager's layout from that string.

From a quick stepthrough, one of the problem places is DockManagerContentPane.SetUnpinned(). It  forces a refresh on the same pane that is being configured from the saved state, and its size reverts to the default. Possibly, it happens more often for panes with a constant Id property.

Update. If I remove Id properties from all content panes, then the layout has the right size, but all panes are empty. No content. If I put Id properties back, I get the content, but the pane size is lost.

 

Can you please confirm that you are aware of the problem? To create a reproducible example app may be too hard.

Anislav
Top achievements
Rank 6
Silver
Bronze
Bronze
 answered on 27 Mar 2025
Top users last month
Will
Top achievements
Rank 2
Iron
Motti
Top achievements
Rank 1
Iron
Hester
Top achievements
Rank 1
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Thomas
Top achievements
Rank 2
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?