I have a Blazor server app which I am using to upload photos. I am attempting to use the Window and Upload components to have a modal dialog.
It is unclear to me from the examples WHEN does the Upload component attempt to call the API Controller. Also, I need to specify exactly where to place the uploaded picture. I have a special folder off the root for photos and folders within that to "group" the photos.
How do I pass the "group" to the controller from the Upload component?
Eventually, this app will be used on tablets and phones and I will want to upload from the device storage OR from the camera. I don't see anything related to that.
I have the need to display certain grid values bold as to highlight them to the user.
I have created a template like so:
<GridColumn Field="@(nameof(ManufacturerSettingsInfo.Region1))" Width="80px" Filterable="false" Groupable="false">
<Template>
@{
var row = context as ManufacturerSettingsInfo;
if (true)
{
<span style="font-weight:bold;">@(Converter.ConvertToBlankOrFormattedDecimal(row.Region1))</span>
}
else
{
<span>@(Converter.ConvertToBlankOrFormattedDecimal(row.Region1))</span>
}
}
</Template>
</GridColumn>
However the cells with the font-weight bold styling do not show up as bold and look the same as the other cells.
N.B. I am able to change the font-size but I can't seem to change the font-weight.
Do you know how I can achieve this?
UPDATE: This is working as expected, it was an issue with my CSS not using the correct font-family for a bold font face.
Hi,
in https://docs.telerik.com/blazor-ui/knowledge-base/tilelayout-rendering-contents is written, that StateHasChanged must called to Update the HeaderText. But with a TelerikCalendar in Content the HeaderText is one click to late:
@page "/test"
<TelerikTileLayout>
<TileLayoutItems>
<TileLayoutItem HeaderText="@date.ToShortDateString()">
<Content>
<TelerikCalendar Value="@date" ValueChanged="@CalendarValueChangedHandler" />
</Content>
</TileLayoutItem>
</TileLayoutItems>
</TelerikTileLayout>
@code {
DateTime date { get; set; } = DateTime.Today;
public async void CalendarValueChangedHandler(DateTime newDate)
{
date = newDate;
StateHasChanged();
// await Task.Delay(50).ContinueWith(o => { InvokeAsync(StateHasChanged); });
}
}
I have to add a second call to StateHasChanged with a minimal Delay of 50 ms.
It works with the line:
await Task.Delay(50).ContinueWith(o => { InvokeAsync(StateHasChanged); });
But this behavior is not normal?
Regards,
Peter
I've got a hierarchical grid structure and I want to use the OnStateChanged event in the (0...N) child grids and do things with the state of the grid that has changed, but it seems impossible because there doesn't appear to be a way to work out which child grid is firing the event.
Within OnStateChangedHandler(GridStateEventArgs<T> args), args doesn't contain a reference back to the grid that's changed.
Obviously the top-level parent grid is easy enough, but I'm completely stumped with the children...
Has anyone succeeded in doing this?
I'm having a problem changing the filename on upload. The control reports the file was uploaded with the new name, but the controller's file.ContentDisposition looks like this:
form-data; name="file"; filename="Original.png"
Here's my OnSelectHandler:
private void OnSelectHandler(UploadSelectEventArgs e)
{
if (e.Files.Count > 1)
{
e.IsCancelled = true;
}
foreach (var file in e.Files)
{
file.Name = "New.png";
}
}
I've also tried modifying the method to be private Task OnSelectHandler which returned Task.CompletedTask,
I used the "ShowInEdit" function for two buttons. But press the add button and see all four buttons.
The same problem appears when I use not only my source but also the sample source of telerik demo.
I will attach my code, sample code of telerik demo, and execution screen.
Please give me some advice on which part there was a mistake.
=============================== my code ===============================
<div class="form-field-row" style="display:table;height:185px;vertical-align:text-top;">
<TelerikGrid Data="@WspanlList" EditMode="@GridEditMode.Inline"
Pageable="false"
FilterMode="@GridFilterMode.None"
Class="no-scroll"
Reorderable="true"
OnUpdate="@WspanlUpdate" OnDelete="@WspanlDelete" OnCreate="@WspanlCreate">
<GridToolBar>
<GridCommandButton Command="Add" Icon="add">품목 추가</GridCommandButton>
</GridToolBar>
<GridColumns>
<GridColumn Field="@nameof(Wspanl.panl)" Width="135px" OnCellRender="@((e) => e.Class = "center-align")">
<HeaderTemplate>
<div style="text-align:center;">품명</div>
</HeaderTemplate>
</GridColumn>
<GridColumn Field="@nameof(Wspanl.spec)" Width="120px">
<HeaderTemplate>
<div style="text-align:center;">규격</div>
</HeaderTemplate>
</GridColumn>
<GridColumn Field="@nameof(Wspanl.qtty)" Width="50px">
<HeaderTemplate>
<div style="text-align:center;">수량</div>
</HeaderTemplate>
</GridColumn>
<GridColumn Field="@nameof(Wspanl.comment)" Title="ë¹„ê³ " Width="100px"></GridColumn>
<GridCheckboxColumn SelectAll="false" Title="현재작업" Width="68px" CheckBoxOnlySelection="true"></GridCheckboxColumn>
<GridCommandColumn Width="200px">
<GridCommandButton Command="Edit" Icon="edit" Class="grid-btn-cmd">ìˆ˜ì •</GridCommandButton>
<GridCommandButton Command="Delete" Icon="delete" Class="grid-btn-cmd">ì‚ì œ</GridCommandButton>
<GridCommandButton Command="Save" Icon="save" Class="grid-btn-cmd" ShowInEdit="true">ì €ìž¥</GridCommandButton>
<GridCommandButton Command="Cancel" Icon="cancel" Class="grid-btn-cmd" ShowInEdit="true">취소</GridCommandButton>
</GridCommandColumn>
</GridColumns>
</TelerikGrid>
</div>
=============================== telerik sample code ===============================
@* This sample showcases custom command handling for:How can I set the title on the Popup window that appears when we use GridEditMode.Popup?
For editing existing data, the title is "Edit".
For adding new data the title is "Add New Record".
Also, the alignment of validation messages seems a bit wonky:
I have a treeview. And there is too much white space between the nodes. How can I control this?
I have included a screenshot so you see what I mean.