When a user makes a selection in a dropdown in the first row of a Blazor Grid I want to be able to hide the same column in all the remaining rows to prevent them from making selections in those dropdowns. Is this possible?
If I want to restrict the number of selected rows to just three, can I do this with a configuration or a property? I am looking at the following demo. Thanks!
hi,
C:\SQ_AzureDevOps\BlazorApp1\BlazorApp1>dotnet nuget remove source telerik.com
La source de package nommée telerik.com a été correctement supprimée.
C:\SQ_AzureDevOps\BlazorApp1\BlazorApp1>dotnet nuget add source "https://nuget.telerik.com/v3/index.json" --name telerik.com --username "...@..." --password "....." --store-password-in-clear-text
La source de package nommée telerik.com a été correctement ajoutée.
C:\SQ_AzureDevOps\BlazorApp1\BlazorApp1>dotnet add package Telerik.UI.for.Blazor
Générer a réussi dans 0,7s
info : La validation de la chaîne de certificats X.509 utilisera le magasin de confiance par défaut sélectionné par .NET pour le code de signature.
info : La validation de la chaîne de certificats X.509 utilisera le magasin de confiance par défaut sélectionné par .NET pour le timestamp.
info : Ajout de PackageReference pour le package 'Telerik.UI.for.Blazor' dans le projet 'C:\SQ_AzureDevOps\BlazorApp1\BlazorApp1\BlazorApp1.csproj'.
error: Impossible de charger l'index de service pour la source https://nuget.telerik.com/v3/index.json.
error: Response status code does not indicate success: 401 (Unauthorized).
So, its a Trial account nothing wrog with th API-KEY being visible here, but I dont fink I do something wrong, do I?
I am using the TelerikUpload component.
Telerik.UI.for.Blazor version 9.0.0
Extra security checks (anti-virus etc.) are triggered in the Controller and depending on what caused an issue, I would like to change the default "File failed to upload" error message. Ideally this message would be set in the OnError handler, or maybe a ChildTemplate exists I am not aware of?
This post talks about changing the message through localization, but that does not allow me to change it at runtime:
public static List<AggregateFunctionsGroup>? DeserializeGroups<TGroupItem>(this List<AggregateFunctionsGroup> groups)
{
if (groups is null) return null;
for (int i = 0; i < groups.Count; i++)
{
var group = groups[i];
// Workaround for JsonElement -> string
if (group.Key is JsonElement elem && elem.ValueKind == JsonValueKind.String)
{
group.Key = elem.GetString();
}
if (group.HasSubgroups)
{
var subGroups = group.Items
.Cast<JsonElement>()
.Select(x => x.Deserialize<AggregateFunctionsGroup>())
.ToList();
group.Items = DeserializeGroups<TGroupItem>(subGroups);
}
else
{
var items = group.Items
.Cast<JsonElement>()
.Select(x => x.Deserialize<TGroupItem>())
.ToList();
group.Items = items;
}
}
return groups;
}
public async Task ReadItems(GridReadEventArgs args)
{
if (!ModelIsReady) return;
if (_readItemsPending) return;
if (string.IsNullOrWhiteSpace(PreparedQuery.Id)) return;
_readItemsPending = true;
try
{
var result = await ApiService.QueryDataSourceAsync<UniversalDSModel>(PreparedQuery.QueryId, args.Request, CancellationToken.None);
if (result is null) return;
if (args.Request.Groups.Count > 0)
{
args.Data = result?.GroupedData.DeserializeGroups<UniversalDSModel>();
}
else
{
args.Data = result?.CurrentPageData.Cast<object>().ToList();
}
if (result?.AggregateResults != null)
{
args.AggregateResults = result.AggregateResults;
}
if (result != null) { args.Total = result.TotalItemCount; }
}
catch (Exception ex)
{
Console.WriteLine($"Error loading data: {ex.Message}");
ApiRequestFailed = true;
}
finally
{
_readItemsPending = false;
LoaderContainerVisible = false;
}
}
so issue was when i uploading file that still in upload phase if i click the cancel button next upload progress bar the file is removes from ui but somewhere is still present
so i have used OnSelectHandler event to handle to duplicate uploading and some extra validation added in OnSelectHandler event but my issue is
when i am uploading file and immediately click [ Before upload process is done ] cancel then it remove from ui but somewhere is present after that remove click again try to add show my validation error that is duplicate message
Clicking Cancel should stop the upload process entirely, and no file should be uploaded or stored.
Please Refer Below Attachment
Step 1 => Select file eg. dummy.pdf and select Note : AutoUpload is true and check below screenshot and i click cancel button
Step 2 => The file removed from UI see below screenshot
Step 3 => If i try to add again same file i.e dummy.pdf the my custom validation msg show that is file is already present see below screenshot
Below is My Code :
I am using the TelerikUpload component with UploadChunkSettings defined.
Telerik.UI.for.Blazor version 9.0.0
When not using a chunked upload I can return a response body a read it in the success handler, however when code was changed to use chunks the response body is always empty.
Is this a bug when using chunked upload, or do I need to return a different response in the Controller?
Code from the save method in Api Controller:
string chunkMetaData = formData["chunkMetaData"].ToString();
ChunkMetaData chunkData = JsonConvert.DeserializeObject<ChunkMetaData>(chunkMetaData);
// Append chunks to file
// ...
if (chunkData.TotalChunks - 1 == chunkData.ChunkIndex)
{
uploadComplete = true;
fs.Flush();
}
// More code omitted ...
if (uploadComplete)
{
Response.StatusCode = StatusCodes.Status200OK;
await Response.WriteAsync(result.ResultId.ToString());
return new EmptyResult();
}
else
{
Response.StatusCode = StatusCodes.Status201Created;
await Response.WriteAsync("Chunk upload successful.");
return new EmptyResult();
}
OnSuccess handler:
protected async Task SuccessHandler(UploadSuccessEventArgs args)
{
int resultid = 0;
if (int.TryParse(args.Request.ResponseText, out resultid))
{
// do something with the resultid
// ...
// args.Request.ResponseText is always empty when using chunked upload
}
}
Documentation says to reset the layout by calling: dockManager.SetState(null);
Doing this via code doesn't seem to do anything. I've tried all combinations of the commented out code below.
<TelerikDockManager Height="100vh" OnStateChanged="OnStateChanged" OnStateInit="OnStateInit" @ref="dockManager">
...
</TelerikDockManager>
<TelerikButton Icon="SvgIcon.ArrowRotateCcw" OnClick="ResetState">Reset page layout</TelerikButton>
@code{
public TelerikDockManager dockManager { get; set; }
public async Task ResetState()
{
dockManager.SetState(null);
//dockManager.GetState();
//dockManager.Refresh();
//StateHasChanged();
await InvokeAsync(() => StateHasChanged());
}
}
public partial class TelerikTest
{
[Inject] public IJSRuntime JsRuntime { get; set; }
[Inject] public NavigationManager Navigation { get; set; }
private TelerikNotification NotificationReference { get; set; }
protected override void OnAfterRender(bool firstRender)
{
if (firstRender && Navigation.Uri.StartsWith("https"))
{
StateHasChanged();
ShowErrorNotification();
}
}
protected override async Task OnAfterRenderAsync(bool firstRender)
{
if (firstRender && Navigation.Uri.StartsWith("https"))
{
await JsRuntime.InvokeVoidAsync("console.log", "Component rendered!");
StateHasChanged();
}
}
private void ShowErrorNotification()
{
NotificationReference.Show(new NotificationModel
{
Text = "An error has occurred!",
ThemeColor = ThemeConstants.Notification.ThemeColor.Error,
Closable = true,
CloseAfter = 20000
});
}
}