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.
Hello,
When I add the tag Filterable="true" to my DropDownList I get the following exception when I try to click on the dropdown:
" Could not find 'TelerikBlazor.initDropDownListFilter' ('initDropDownListFilter' was undefined)."
The project build without a problem but the error occurs when I click the dropdown. Am I missing a using statement or what could be the problem?
Hello!
It is possible to hide or reduce width for grid's hierarchy cells?
On mobile devices, this place is very valuable and is not used effectively.
var result = await dialog.Show().Result;
bool isVisible, dialogResult;
CancellationTokenSource tokenSource;
public async Task<bool> Show() {
isVisible = true;
await InvokeAsync(StateHasChanged);
return await Task.Run(WaitForResult); }
// Waiting for action
private async Task<bool> WaitForResult() {
tokenSource = new();
while (!tokenSource.Token.IsCancellationRequested) ;
isVisible = false;
await InvokeAsync(StateHasChanged);
return dialogResult; }
private async void Submit(bool result) {
dialogResult = result;
tokenSource.Cancel(); }
The Telerik Blazor Grid documentation on column widths mentions that:
To allow the users to auto-fit the column widths to the content, enable column resizing - a double click on the border between the headers will have the grid adjust the column width according to the size of the data, headers and footers content.
Is it possible to generate the grid so that all the columns are set to auto-fit the data by default, rather than it being something that the user has to trigger themselves?