Hi,
I try to use Telerik.UI.for.Blazor in Docker.
I have added a nuget.config file and also add the corresponding line as explained here
https://docs.telerik.com/aspnet-core/knowledge-base/docker-build-nuget
But when running the docker build command there is this error
"error NU1301: Unable to load the service index for source https://nuget.telerik.com/v3/index.json."
What is wrong ?
Best regards.
Hello!
i use Entity Framework and my class has over 150 attibutes. So i use AutogenerateColums.
I want overwrite the value with template for example: Inventory.IsFragmented is boolean.
So in the Grid i dont want show true or false. i want text: Ja / Nein.
But my code show only true or false. Have someone an idea how can i do it. Thank you :)
<TelerikGrid
Data="@GridData"
@ref="@Grid"
Sortable="true"
Reorderable="true"
Resizable="true"
Pageable="@true"
AutoGenerateColumns ="true"
ShowColumnMenu="true"
FilterMode="@GridFilterMode.FilterMenu"
OnRowDoubleClick="@OnRowDoubleClickHandler"
SelectionMode="GridSelectionMode.Multiple" >
<GridToolBarTemplate>
<GridCommandButton OnClick="@AutoFitAllColumns" Icon="@FontIcon.ColResize" Title="Spalten-Autoanpassung" Class="tooltip-target"></GridCommandButton>
<GridCommandButton Command="ExcelExport" Icon="@SvgIcon.FileExcel">Export to Excel</GridCommandButton>
<GridCommandButton Command="CsvExport" Icon="@SvgIcon.FileCsv">Export to CSV</GridCommandButton>
<label class="k-checkbox-label"><TelerikCheckBox @bind-Value="@ExportAllPages" />Alle Seiten exportieren</label>
</GridToolBarTemplate>
<GridColumns>
<GridCheckboxColumn></GridCheckboxColumn>
<GridAutoGeneratedColumns ColumnWidth="200px" />
</GridColumn>
<GridColumn Field=@nameof(Inventory.IsFragmented)>
<Template >
@{
var x = context as Inventory;
var b = x.IsFragmented == true ? "Ja" : "Nein";
}
<p> @(x.IsFragmented ? "Ja" : "Nein")</p>
</Template>
</GridColumn>
<GridColumn Field=@nameof(Inventory.Immobile) Visible="true">
<Template>
@{
var x = context as Inventory;
if (x.Immobile == true) {
<p>Ja</p>
}
else {
<p>Nein</p>
}
}
<p>NEIN</p>
</Template>
</GridColumn>
</GridColumns>
<GridExport>
<GridExcelExport FileName="ve-excel-export" AllPages="@ExportAllPages" />
<GridCsvExport FileName="ve-csv-export" AllPages="@ExportAllPages" />
</GridExport>
</TelerikGrid>
Is there a way to load a popover when the component loads?
I want to use it as a notification on new features in the app.
I have some Grids which are fully managed by the TelerikGrid control (as far as sorting, filtering, and pagination goes). These grids use the Data property on the Grid. These TelerikGrids are using the <GridSearchBox />.
I am now building some API-driven grids, which are using the OnRead property. For the API-driven Grids I'm using a TelerikTextBox for searching, instead. I would like this grid to look the same as the managed grids.
Is there any way to make the TelerikTextBox look identical to the GridSearchBox?
I have followed this example to replace the GridSearchBox with a TelerikTextBox, but the appearance is very different.
Blazor Search Grid on Button Click - Telerik UI for Blazor
Thank you
-Adam
In many cases the header text of columns gets truncated to an ellipses if the columns aren't wide enough. It would be nice if there was a global way to display a tooltip for each column header that is made up of the header text. I know that I can do this using the column header template, but that will require that I create a template for every column in all of my grids. I'm looking for a way to have it work globally.
Thanks,
Mike
Hi,
In the Kendo grid we could drag the cursor over several rows to select them. This is sometimes more convenient that using Ctrl and Shift keys for multiple row selection. Is this possible in the Blazor Grid?
Thanks
A DropDownList receives a List of Items and then displays the field I select via Reflection. In the example below that would be the "Text" field. How would I create a localized text in an easy way. I already inject the IStringLocalizer into this component but I cannot pass a method call to the dropdownlist as far as I know. Is there a way to tell Telerik globally to use my Localizer to translate all strings that would be rendered or sth like that? I have several ideas how I could add Localizations but they all seem rather complicated and I would like to know the intended way.
<TelerikDropDownList Data="@Data"
@bind-Value="@SelectedValue"
TextField="@nameof(MyType.Text)"/>
using (var stream = Assembly.GetExecutingAssembly().GetManifestResourceStream($"ClaimForms.Server.Shared.Images.{logoFile}.png")) { ImageSource imageSource = new ImageSource(stream, ImageQuality.High); CurrentEditor.DrawImage(imageSource, new Size(162, 42)); }
I'm using a collection of tabs to display PDF files. For example, I have two tabs open and the current document is scrolled to about mid document. Now I add a new document in a new tab. The new document and all others will scroll to the same spot as the previously active tab. I'd like to retain the position of documents in any open tabs while having the document in the new tab open to the top of the first page.
If I have multiple tabs open and documents scrolled to various positions they do not change simply switching from tab to tab. The change only occurs when adding a new tab.
I have a Blazor server solution with separate projects for the UI and API. When the Upload component is configured to use a controller in the API project to handle the save function I get the error seen in the attached file 'Screenshot 2025-02-26 132709' but the file is successfully uploaded. If I copy the same controller to the UI project the error goes away see 'Screenshot 2025-02-26 132538'.
to get the save function to work with the API at all I had to add the below HTTP options section to the API program.cs
app.Use(async (context, next) => { if (context.Request.Method == HttpMethods.Options) { context.Response.Headers.Add("Allow", "GET, POST, PUT, OPTIONS"); context.Response.Headers.Add("Access-Control-Allow-Origin", "https://localhost:7053"); context.Response.StatusCode = (int)HttpStatusCode.OK; return; } await next.Invoke(); });
Upload component:
<TelerikUpload SaveUrl="@saveURL"
RemoveUrl="https://localhost:7121/api/DocumentUpload/remove"
MaxFileSize="@MaxFileSize"
/>
Controller:
using DocumentFormat.OpenXml.Drawing;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
namespace API.Controllers
{
[Route("api/[controller]")]
[ApiController]
public class DocumentUploadController : ControllerBase
{
public IWebHostEnvironment HostingEnvironment { get; set; }
public DocumentUploadController(IWebHostEnvironment hostingEnvironment)
{
HostingEnvironment = hostingEnvironment;
}
[HttpPost("save")]
public async Task<IActionResult> Save(IFormFile files) // "files" matches the Upload SaveField value
{
if (files != null)
{
try
{
// save to wwwroot - Blazor Server only
//var rootPath = HostingEnvironment.WebRootPath;
// save to Server project root - Blazor Server or WebAssembly
var rootPath = HostingEnvironment.ContentRootPath;
var newFolder = Guid.NewGuid().ToString();
System.IO.Directory.CreateDirectory(rootPath + newFolder);
var saveLocation = System.IO.Path.Combine(rootPath + newFolder, files.FileName);
using (var fileStream = new FileStream(saveLocation, FileMode.Create))
{
await files.CopyToAsync(fileStream);
}
}
catch (Exception ex)
{
Response.StatusCode = 500;
await Response.WriteAsync($"Upload failed.");
}
}
return new OkResult();
}
[HttpPost("remove")]
public async Task<IActionResult> Remove([FromForm] string files) // "files" matches the Upload RemoveField value
{
if (files != null)
{
try
{
// delete from wwwroot - Blazor Server only
var rootPath = HostingEnvironment.WebRootPath;
// delete from Server project root - Blazor Server or WebAssembly
//var rootPath = HostingEnvironment.ContentRootPath;
var fileLocation = System.IO.Path.Combine(rootPath, files);
if (System.IO.File.Exists(fileLocation))
{
System.IO.File.Delete(fileLocation);
}
}
catch (Exception ex)
{
Response.StatusCode = 500;
await Response.WriteAsync($"Delete failed.");
}
}
return new EmptyResult();
}
}
}
Any ideas? Have I missed something I need to setup in the API program.cs?