Telerik Forums
UI for Blazor Forum
1 answer
175 views

Between the Signature Component and the PDF Processing component I'm having a hard time figuring out how to present a pdf file on a Blazor page for the user to read. Then have a user provide their signature and save that file with the signature imbedded.

I feel like I'm missing and or confusing steps here.. Can someone help me out?

Dimo
Telerik team
 answered on 27 Oct 2023
1 answer
390 views
On all my <TelerikGrid> tags I am getting the error: Unexpected use of an unbound generic name on most of the values I pass into this grid except for FilterMode. The error does not prevent a build but I can't figure out how to get it to go away. The same thing is showing on all my grids and has always been there. Restarting visual studio does not fix it. See the code snippet below for the grid and my attachment shows a screenshot of the grid declaration code with the error lines. The [***] is just a stand in to anonymize the code. Can anyone explain what is causing the error?
@using [***].Common.Dtos;
@using [***].Common.Enumerations;
@using [***].Features.EmployeeInfoAndTravelRequestLists.TravelRequestListingTab

@if (ViewModel is not null)
{
    <!-- Render loader until grid initial data load is complete -->
    @if(!ShouldRenderGrid)
    {
        {
            <div style="height:500px">
                <TelerikLoaderContainer></TelerikLoaderContainer>
            </div>
        }
    } else
    {
        <TelerikGrid OnRead="@TravelRequestGridOnReadAsync"
                        Class="grid-no-scroll"
                        TItem="@TravelRequestFullDto"
                        EnableLoaderContainer="true"
                        Pageable="true"
                        Sortable="true"
                        SortMode="SortMode.Multiple"
                        PageSize="10"
                        SelectionMode="@GridSelectionMode.Single"
                        FilterMode="GridFilterMode.FilterMenu">
            <!-- dropdown, search box and new request button above grid -->
            <GridToolBarTemplate>
                <div class="dropdown-list-container">
                    <TelerikDropDownList Width="100px" Data="@ViewModel.EmployeeStatuses" @bind-Value="ViewModel.EmployeeStatusDDLSelectedValue">
                        <DropDownListSettings>
                            <DropDownListPopupSettings Height="58px" />
                        </DropDownListSettings>
                    </TelerikDropDownList>
                </div>
                <GridSearchBox Placeholder="Name/SAP/Personal ID..."
                                Width="280px" />
                <button class="new-request-button"><span class="k-icon k-i-plus"></span>New Request</button>
            </GridToolBarTemplate>
            <GridColumns>
                <GridCheckboxColumn SelectAll="false" Width="40px" />
                <GridColumn Title="SAP Number" Width="195px">
                    <Template>
                        @{
                            var SAPNumber = ((TravelRequestFullDto)context).SAPNumber;
                            var RequestStatus = ((TravelRequestFullDto)context).Status;
                            // render a chip in travel request number column if record has a request status
                            <span>
                                @SAPNumber
                                <span class="cell-padding" />
                                <TelerikChip Class="travel-request-status-chip"
                                                Text=@TravelRequestStatusExtensions.ToDisplayValue(RequestStatus)
                                                Disabled=true
                                                Rounded="full"
                                                ThemeColor=@GetChipColorClass(RequestStatus) />
                            </span>
                        }
                    </Template>
                </GridColumn>
                <GridColumn Title="Workday Number" Field="@(nameof(TravelRequestFullDto.WorkdayNumber))" Width="140px" />
               <!-- other grid columns here.... -->
            </GridColumns>
        </TelerikGrid>
    }
}

Noah
Top achievements
Rank 1
Iron
 answered on 26 Oct 2023
1 answer
321 views

I am starting a new project and went to download the latest version of Blazor from nuget and I get the following error:

  GET https://nuget.telerik.com/v3/package/telerik.fonticons/index.json
  GET https://nuget.telerik.com/v3/package/telerik.svgicons/index.json
  OK https://nuget.telerik.com/v3/package/telerik.fonticons/index.json 6039ms
  OK https://nuget.telerik.com/v3/package/telerik.svgicons/index.json 6037ms
NU1101: Unable to find package Telerik.FontIcons.
NU1101: Unable to find package Telerik.SvgIcons.

Package restore failed.

The last version I can successfully download is Telerik.UI.for.Blazor 4.4.0.  Everything after that seems to have an issue with the icon dependencies. 

Anyone have any thoughts on what I might be missing, has anyone else been able to successfully start a new project with 4.5.0 or higher?

Rick
Top achievements
Rank 2
Iron
Iron
 answered on 26 Oct 2023
1 answer
531 views

Some important background first.  There is a lot to share but its important because you'll have a lot of question about why I'm doing some things. 

My model is a single, self-referencing table holding hierarchical data.  I have three fields: "TaxonomyId", "Name", "ParentId". Taxonomy Id is my ValueField and Name is the TextField. Currently the hierarchy is limited to 5 levels.  The previous dropdown filters the next based on the selection.  Names are unique in a single hierarchy but not across hierarchies.  Clear as mud?  LOL

I have separate Lists I use as models for each of the dropdown lists to be cascading through the single hierarchy.  I can't use a single table model because each dropdown uses the same model.  It appears to overwrite the previous selection and I need to keep track of all the selections. Those lists are bound to each ddl to display the list of Names.

So, to make the dropdowns cascade, I call my GetNextLevel() method for the OnChange() event.  I tried ValueChange() but firing on every keystroke seemed to cause some UI performance issues.  May have just been my ignorance.  Anyway, I pass the level (1-5) and the bound value (Name) to get the next ddl values.  All this works perfect.

Now to the ask.  I'm trying to get the ValueField (TaxonomyId) and pass it to GetNextLevel().  I can pass the event args but that only gives me the selected value and I also need the level (which ddl was clicked).  If I could send level and the ValueField I would be "golden".

Now the code.  Here are my ddls

<div><TelerikFloatingLabel Text="Level 1"><TelerikComboBox Class="justification" AllowCustom="true" Data="@L1" ClearButton="false" TextField="Name" ValueField="TaxonomyId" @bind-Value=@L1Value OnChange="@(GetNextLevelTest)"></TelerikComboBox></TelerikFloatingLabel></div> @if (!String.IsNullOrEmpty(L1Value)) { <div><TelerikFloatingLabel Text="Level 2"><TelerikComboBox Class="justification" @ref="TestRef" id="L2" AllowCustom="true" Data="@L2" ClearButton="false" TextField="Name" ValueField="TaxonomyId" @bind-Value=@L2Value OnChange="@(() => GetNextLevel(L2Value, 2))"></TelerikComboBox></TelerikFloatingLabel></div> } @if (!String.IsNullOrEmpty(L2Value)) { <div><TelerikFloatingLabel Text="Level 3"><TelerikComboBox Class="justification" Data="@L3" AllowCustom="true" TextField="Name" ClearButton=false ValueField="TaxonomyId" @bind-Value="@L3Value" OnChange="@(() => GetNextLevel(L3Value, 3))"></TelerikComboBox></TelerikFloatingLabel></div> } @if (!String.IsNullOrEmpty(L3Value)) { <div><TelerikFloatingLabel Text="Level 4"><TelerikComboBox Class="justification" Data="@L4" AllowCustom="true" TextField="Name" ClearButton=false ValueField="TaxonomyId" @bind-Value="@L4Value" OnChange="@(() => GetNextLevel(L4Value, 4))"></TelerikComboBox></TelerikFloatingLabel></div> } @if (!String.IsNullOrEmpty(L4Value)) { <div><TelerikFloatingLabel Text="Level 5"><TelerikComboBox Class="justification" Data="@L5" AllowCustom="true" ClearButton="false" TextField="Name" ValueField="TaxonomyId" @bind-Value="@L5Value" OnChange="@(() => GetNextLevel(L5Value, 5))"></TelerikComboBox></TelerikFloatingLabel></div> }

 

Here is the GetNextLevel method.  This is more for your edification as I don't think it will impact the answer?  A lot of this code is validation if a user goes back up the list and chooses another value or selects the same value.

        /// <summary>
        /// Populates a change ddl based on the parent id of the previous ddl and adds the selection to a ChangeDetailDTO object.
        /// </summary>
        /// <param name="selectedValue">This has to be a string because of the ability to edit the selected value</param>
        /// <param name="level"></param>
        public async Task GetNextLevel(string selectedValue, int level)
        {
            //Get the appropriate Taxonomy List object
            var SelectedLevels = GetType().GetProperty(DDLGroup+"Levels"??"").GetValue(this,null) as List<TaxonomyDdlDTO>;

            //if this is replacing a level that is last in the index, remove the old value. 
            //further down I'm clearing a range if a new dd value is selected to remove all the child values

            if (string.IsNullOrEmpty(selectedValue))
                return;

            //if the selected value is not changed, do nothing.
            if (level <= SelectedLevels!.Count())
            {
                if (selectedValue == SelectedLevels[level-1].TaxonomyId)
                return;
            }

            int selectedId = 0;
            int.TryParse(selectedValue, out selectedId);

            //Parent int of 0 means its a top-level item
            if (selectedId != 0)
            {
                var currentLevel = TaxonomyList.Where(x => x.TaxonomyId == selectedValue).Single();
                if (!SelectedLevels.Contains(currentLevel))
                {
                    SelectedLevels.Add(currentLevel);
                };
            }
            else
            {
                if (SelectedLevels.Count <= level-1 && SelectedLevels[level - 2] != null)
                    SelectedLevels.RemoveAt(level - 2);

                    SelectedLevels.Add(new TaxonomyDdlDTO()
                {
                    TaxonomyId = selectedValue,
                    Name = selectedValue
                });
            }

            //Event passes the new selection object to the parent page
            if(DDLGroup == "Current")
                await CurrentLevelSelectedEvent.InvokeAsync(SelectedLevels);
            else
                await NewLevelSelectedEvent.InvokeAsync(SelectedLevels);

            //populates the next dropdown list based on the selection justmade
            var nextLevelTaxonomy = TaxonomyList.Where(x => x.ParentId == selectedId).ToList();

            //Level5 has no children.
            if (level <= 4)
                GetType().GetProperty(string.Concat("L", level + 1)).SetValue(this, nextLevelTaxonomy);

            if (SelectedLevels.Count > level)
                SelectedLevels.RemoveRange(level-1, SelectedLevels.Count-1);
        }

 

I appreciate any suggestions you have.

Chris
Top achievements
Rank 2
Iron
Iron
Iron
 updated answer on 26 Oct 2023
1 answer
782 views

I need to disable the browser's autofill option on our Blazor Autocomplete. How can I accomplish this?

THanks

Billy

Georgi
Telerik team
 answered on 26 Oct 2023
1 answer
237 views

Is there a way to increase the height/size of the suggestion list for the TelerikMultiSelect control? There does not appear to be a Height property on the control. Thanks.

 

Mark
Top achievements
Rank 3
Iron
Iron
Iron
 answered on 26 Oct 2023
1 answer
188 views
Good day.
I would like to inquire if it is possible to create a chart similar to "RadCartesianChart" from "Telerik for WPF", in "Telerik for Blazor".
Below is an example of the desired chart result.
Mark
Top achievements
Rank 3
Iron
Iron
Iron
 answered on 25 Oct 2023
1 answer
148 views
We have a design where bar chart labels are on top. See the attached image.
Mark
Top achievements
Rank 3
Iron
Iron
Iron
 answered on 25 Oct 2023
1 answer
340 views

Hello I have a stacked chart: https://blazorrepl.telerik.com/mdapkbvq40X63oHt59

 

Is it possible to remove the strokes on the colored boxes in the chart so it looks more like the image attached?

 

I can remove them with a css selector, but it looks like this and obviously isn't a great selector

svg g > g > g > g > g > g > g path {
    stroke: none;
}

 

Also, is it possible to put a border-radius around the whole column?

 

Mark
Top achievements
Rank 3
Iron
Iron
Iron
 answered on 25 Oct 2023
1 answer
150 views

When clearing a nullable DateTime-bound TimePicker control (by highlighting the value and hitting delete), why does the control leave the "AM" and also border itself in red?

Is there a way configure the TimePicker control so it doesn't do this?

 

Hristian Stefanov
Telerik team
 answered on 24 Oct 2023
Narrow your results
Selected tags
Tags
+? more
Top users last month
Simon
Top achievements
Rank 2
Iron
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Marco
Top achievements
Rank 4
Iron
Iron
Iron
Grant
Top achievements
Rank 3
Iron
Iron
Iron
Kao Hung
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Simon
Top achievements
Rank 2
Iron
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Marco
Top achievements
Rank 4
Iron
Iron
Iron
Grant
Top achievements
Rank 3
Iron
Iron
Iron
Kao Hung
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?