Telerik Forums
UI for Blazor Forum
1 answer
153 views

I would like to know if it's possible to read the "Title" from code, a database table versus it being in the razor text. If it is possible, any example would be great to share. I'd like this title to be more flexible and user-defined.


<TabStripTab Title="PowerBI Dashboard #1">
        <div class="h_iframe">
            <iframe src=@TargetUrl frameborder="0" allowfullscreen />
        </div>
    </TabStripTab>
    <TabStripTab Title="PowerBI Dashboard #2">
        <div class="h_iframe">
            <iframe src=@TargetUrl2 frameborder="0" allowfullscreen />
        </div>
    </TabStripTab>

Thanks!

Yanislav
Telerik team
 answered on 03 Feb 2023
1 answer
163 views

Ok I use a gridlayout for the page.

I would like to put a border around some of the rows, for different logical sections.

See the blue areas, thats where I would like to setup a border for each section. Not seeing a way to do that.

Any ideas?

Thanks

See image:

Dimo
Telerik team
 answered on 02 Feb 2023
1 answer
325 views

After I select a product I tab to get to the Trade date field. The cursor get's there, but then move back to the product field, why?


@page "/ManualCertificateTrade"
@attribute [Authorize]
@using Ibex.Shared.Domain
<h3>Manual Certificate Trade</h3>

<TelerikForm Model="@TradeModel" OnValidSubmit="TradeModelValidSubmit" Columns="1" ColumnSpacing="15px" Width="800px">
    <FormValidation>
        <FluentValidationValidator/>
    </FormValidation>
    <FormItems>
        <FormGroup LabelText="Product" Columns="2" ColumnSpacing="15px">
            <FormItem>
                <Template>
                    <label for="Products">Product</label>
                    <TelerikDropDownList
                        TValue="int"
                        TItem="Product"
                        Id="Products"
                        Data="@Products"
                        TextField="Name"
                        ValueField="Id"
                        OnChange="@ProductChangedEvent"
                        Value="@SelectedProductId"
                        ValueExpression="@(() => SelectedProductId)"
                        Filterable="true"
                        DefaultText="Select a product"
                        FilterOperator="StringFilterOperator.Contains"/>
                    @* <TelerikValidationMessage For="@(() => TradeModel.ProductId)"/> *@
                </Template>
            </FormItem>
            <FormItem LabelText="Nav" Field="@nameof(TradeModel.NavSellPrice)" Enabled="false"/>
            <FormItem LabelText="Issue price" Field="@nameof(TradeModel.StandardBuyPrice)" Enabled="false"/>
            <FormItem LabelText="Redemption price" Field="@nameof(TradeModel.StandardSellPrice)" Enabled="false"/>
            <FormItem LabelText="Other Issue price" Field="@nameof(TradeModel.OtherBuyPrice)" Enabled="false"/>
            <FormItem LabelText="Other Redemption price" Field="@nameof(TradeModel.OtherSellPrice)" Enabled="false"/>
        </FormGroup>
        <FormGroup LabelText="Dates" Columns="2" ColumnSpacing="15px">
            <FormItem>
                <Template>
                    <label for="TradeDate">Trade date</label>
                    <TelerikDatePicker Id="TradeDate" @bind-Value="TradeModel.TradeDate" Format="dd-MM-yyyy"/>
                    <TelerikValidationMessage For="@(() => TradeModel.TradeDate)"/>
                </Template>
            </FormItem>
            <FormItem>
                <Template>
                    <label for="SettlementDate">Settle date</label>
                    <TelerikDatePicker Id="SettlementDate" @bind-Value="TradeModel.SettlementDate" Format="dd-MM-yyyy"/>
                    <TelerikValidationMessage For="@(() => TradeModel.SettlementDate)"/>
                </Template>
            </FormItem>
        </FormGroup>
        <FormGroup LabelText="Price" Columns="2" ColumnSpacing="15px">
            <FormItem Hint="Negative quantity is client sell (redemption)">
                <Template>
                    <label for="Quantity">Quantity</label>
                    <TelerikNumericTextBox Id="Quantity" @bind-Value="TradeModel.Quantity"/>
                    <div class="k-form-hint">Negative quantity is client sell (redemption)</div>
                    <TelerikValidationMessage For="@(() => TradeModel.Quantity)"/>
                </Template>
            </FormItem>
            @* <FormItem LabelText="Quantity" Field="@nameof(ManualTrade.Quantity)" Hint="Negative quantity is client sell (redemption)"/> *@
            <FormItem LabelText="Nav override (Invision)" Field="@nameof(TradeModel.NavOverride)"/>
            <FormItem LabelText="Buy price" Field="@nameof(TradeModel.ManualBuyPrice)" Enabled="@(TradeModel.Quantity > 0)"/>
            <FormItem LabelText="Other Buy Cost %" Field="@nameof(TradeModel.OtherBuyCost)" Enabled="@(TradeModel.Quantity > 0)"/>
            <FormItem LabelText="Sell price" Field="@nameof(TradeModel.ManualSellPrice)" Enabled="@(TradeModel.Quantity < 0)"/>
            <FormItem LabelText="Other Sell Cost %" Field="@nameof(TradeModel.OtherSellCost)" Enabled="@(TradeModel.Quantity < 0)"/>
        </FormGroup>
        <FormGroup LabelText="Customer information for account-holding fund" Columns="2" ColumnSpacing="15px">
            <FormItem LabelText="Customer" Field="@nameof(TradeModel.Customer)" Hint="Ask FundAccounting"/>
            <FormItem LabelText="Customer account" Field="@nameof(TradeModel.CustomerAccount)" Hint="Ask FundAccounting"/>
        </FormGroup>
    </FormItems>
</TelerikForm>

using Blazored.LocalStorage;
using Ibex.Client.Services;
using Ibex.Shared.Domain;
using Ibex.Shared.DTO;
using Microsoft.AspNetCore.Components;

namespace Ibex.Client.Pages;

public partial class ManualCertificateTrade
{
    [Inject] public IManualCertificateTradeService TradeService { get; set; }
    [Inject] public ILocalStorageService LocalStorageService { get; set; }

    private ManualTradeModel TradeModel { get; set; } = new();
    private List<Product> Products { get; set; } = new();
    private int SelectedProductId { get; set; }
    private string SelectedProductName { get; set; }
    private bool IsModalVisible { get; set; }
    private decimal OtherBuyCost { get; set; }
    private decimal OtherSellCost { get; set; }

    protected override async Task OnInitializedAsync()
    {
        Products = await TradeService.GetProducts();
    }

    private async Task ProductChangedEvent(object id)
    {
        if (id is int productId)
        {
            SelectedProductId = productId;
            SelectedProductName = Products.FirstOrDefault(x => x.Id == productId)?.Name;
            TradeModel = await TradeService.GetNewManualTrade(productId);
            OtherBuyCost = TradeModel.OtherBuyCost;
            OtherSellCost = TradeModel.OtherSellCost;
        }
    }

    private void TradeModelValidSubmit()
    {
        IsModalVisible = true;
    }

    private async Task CreateTrade()
    {
        var success = await TradeService.CreateManualTrade(TradeModel);
        Console.WriteLine($"Trade Created {success}");
    }
    
}


Yanislav
Telerik team
 answered on 02 Feb 2023
1 answer
225 views

Hi,

I am using the Telerik FileManager with the built in Upload. I can't find the mutliple variable in the Upload settings so I guess it is not possible to drag&drop or select mulitple files with this component? 

It is a major setback for us using this because we need to be able to quicken the process of uploading a large number of files.

Did anyone manage to do that? 

Thank you !

Yanislav
Telerik team
 answered on 02 Feb 2023
0 answers
363 views

For over a year I've been saving GridState changes to local storage and then re-applying them when a user returns to that grid. Been working with no issues. I use FilterMode="GridFilterMode.FilterRow" in my grids.

Upon upgrading to 4.0 this no longer works, the grid thinks there are filters but they are not applied correctly. I'm thinking this is due to this breaking change. It would be good to get some more details of this change and why it was made? Cant find any details for it.

  • FilterRow uses CompositeFilterDescriptor instead of FilterDescriptor.

The odd thing now is FilterDescriptors always use a logical AND and seem to include an additional filter, ie: on a string contains filter, where the field needs to include a null. Below is an example of a contains filter on an example first and last name fields. The additional clauses expecting them to contain a null are not added by me but rather automatically by the grid.

[
  {
    "LogicalOperator": 0,
    "FilterDescriptors": [
      {
        "Member": "FirstName",
        "Operator": 8,
        "Value": "d"
      },
      {
        "Member": "FirstName",
        "Operator": 8,
        "Value": null
      }
    ]
  },
  {
    "LogicalOperator": 0,
    "FilterDescriptors": [
      {
        "Member": "LastName",
        "Operator": 8,
        "Value": "b"
      },
      {
        "Member": "LastName",
        "Operator": 8,
        "Value": null
      }
    ]
  }
]

 

This state is saved as is in local storage, when a user leaves this screen and returns and the state is re-applied (again this has been working for a year prior to 4.0) the state gets re-applied like the bottom json with 2 filters to blank member names. It seems like to me theres a bug in the re-apply of filters where the grid is not expecting composite filters now?? If I can provide any further details please let me know.

[
  {
    "Member": "",
    "Operator": 2,
    "Value": null
  },
  {
    "Member": "",
    "Operator": 2,
    "Value": null
  }
]
Greg
Top achievements
Rank 1
Iron
 asked on 01 Feb 2023
1 answer
282 views

Hello

I set Multiple="true" and I wonder if it's possible to "see" in OnSuccess event the last success upload.  Or another event.  I need to do something after ALL files are uploaded succefully.

 


<TelerikUpload SaveUrl="@ImageSaveApiURL"
            AllowedExtensions="@AllowedFileTypes"
            MaxFileSize="@MaxFileSize"
            Multiple="true" 
            @ref="uploadAlbumPhotosRef"
            OnSuccess="OnUploadSuccessHandler"
            OnUpload="OnFileUploadHandler" >
</TelerikUpload>


    async Task uploadAlbumPhotosRef(UploadSuccessEventArgs e)
    {
        if (e.Request.Status == 201)
        {
            var infos = new trelAlbumPhotoViewModel();

            infos.Id = (Guid)Id;
            infos.NomFichier = e.Request.ResponseText;

            FicheEspaceClosDataService.AjouterPhotosAsync(infos);
            await AfficherPhotos();
            //albumPhotosRef.Rebind();
        }
    }
Thank a lot
Dimo
Telerik team
 answered on 01 Feb 2023
1 answer
345 views

How does one move the text msg & animation higher up the page?

It seems to default to the center of the page.

Example:

I would like that animation and the text message up near the top of the page.

Code:

@* LoaderContainer with transparent panel *@
<TelerikLoaderContainer Class="no-panel"
                        ThemeColor="@ThemeConstants.Loader.ThemeColor.Dark" />
<style>
    .no-panel .k-loader-container-panel {
        background-color: transparent;
        border-width: 0;
    }
</style>
<TelerikGridLayout>  
    <GridLayoutColumns>
        <GridLayoutColumn Width="6%"></GridLayoutColumn>    
        <GridLayoutColumn Width="6%"></GridLayoutColumn>
        <GridLayoutColumn Width="6%"></GridLayoutColumn>
        <GridLayoutColumn Width="6%"></GridLayoutColumn>
        <GridLayoutColumn Width="6%"></GridLayoutColumn>
        <GridLayoutColumn Width="6%"></GridLayoutColumn>
        <GridLayoutColumn Width="6%"></GridLayoutColumn>
        <GridLayoutColumn Width="6%"></GridLayoutColumn>
        <GridLayoutColumn Width="6%"></GridLayoutColumn>
        <GridLayoutColumn Width="6%"></GridLayoutColumn>
        <GridLayoutColumn Width="6%"></GridLayoutColumn>
        <GridLayoutColumn Width="7%"></GridLayoutColumn>
    </GridLayoutColumns>
    <GridLayoutRows>        
        <GridLayoutRow Height="100px"></GridLayoutRow>        
        <GridLayoutRow Height="100px"></GridLayoutRow>     
        <GridLayoutRow Height="100px"></GridLayoutRow>           
        <GridLayoutRow Height="100px"></GridLayoutRow>        
        <GridLayoutRow Height="100px"></GridLayoutRow>          
        <GridLayoutRow Height="100px"></GridLayoutRow>          
        <GridLayoutRow Height="100px"></GridLayoutRow>           
        <GridLayoutRow Height="100px"></GridLayoutRow>          
        <GridLayoutRow Height="100px"></GridLayoutRow>          
        <GridLayoutRow Height="100px"></GridLayoutRow>         
        <GridLayoutRow Height="400px"></GridLayoutRow>               
    </GridLayoutRows>

</TelerikGridLayout>

Those heights are to simulate my long page :).

 

Dimo
Telerik team
 answered on 01 Feb 2023
1 answer
199 views
Since 4.0.0 version, the proposed CSS customization is not working with custom Saas Theme Buider again.
Progress color does't rendering.

Please update ThemeBuilder.
Nadezhda Tacheva
Telerik team
 answered on 01 Feb 2023
2 answers
128 views

My form has a DropDownList with products.

I would like to have the last 10 used products on top. I will store the 10 last used products in localstorage and then sort the list, so the MRU items are on top.

Has anyone implemented something similar?

Can I rearrange the items in the DDL without triggering any events. Also can I add a divider between the MRU items and the rest of the products? 


Martin Herløv
Top achievements
Rank 2
Bronze
Iron
Iron
 updated answer on 31 Jan 2023
1 answer
613 views

I have a dropdownlist on my form, to select products from.

When I load a new product I get the following error:

Cannot validate instances of type 'ManualCertificateTrade'. This validator can only validate instances of type 'ManualTradeModel'

ManualCertificateTrade is my razor view and ManualTradeModel is the model I load from my API.

This is my code behind class.

publicpartialclassManualCertificateTrade { [Inject] public IManualCertificateTradeService TradeService { get; set; } private EditContext EditContext { get; set; } private ManualTradeModel ManualTradeModel { get; set; } = new(); private ManualTradeValidator TradeValidator { get; set; } = new(); private List<Product> Products { get; set; } = new(); privateint SelectedProductId { get; set; } protected override async Task OnInitializedAsync() { EditContext = new EditContext(ManualTradeModel); Products = await TradeService.GetProducts(); } private async Task ProductChangedEvent(object id) { if (id isint productId) { TradeValidator = null; SelectedProductId = productId; ManualTradeModel = await TradeService.GetNewManualTrade(productId); EditContext = new EditContext(ManualTradeModel); TradeValidator = new(); } } }

Martin Herløv
Top achievements
Rank 2
Bronze
Iron
Iron
 answered on 31 Jan 2023
Narrow your results
Selected tags
Tags
+? more
Top users last month
Miljana
Top achievements
Rank 2
Iron
Iron
Joel
Top achievements
Rank 3
Bronze
Bronze
Bronze
Cynthia
Top achievements
Rank 1
John
Top achievements
Rank 1
Iron
Mozart
Top achievements
Rank 1
Iron
Veteran
Want to show your ninja superpower to fellow developers?
Top users last month
Miljana
Top achievements
Rank 2
Iron
Iron
Joel
Top achievements
Rank 3
Bronze
Bronze
Bronze
Cynthia
Top achievements
Rank 1
John
Top achievements
Rank 1
Iron
Mozart
Top achievements
Rank 1
Iron
Veteran
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?