Telerik Forums
UI for Blazor Forum
2 answers
1.7K+ views

With a Blazor razor page, is there any way of having a FormItem Field conditionally visible in a TelerikForm dependant upon another field?

Use case is where details about person are filled in by the person in question OR a second person.

The second person details are only required if the submiiter isn't the person in question. 

The only ways I can think of doing this thus far are:

  • Have two versions of the page, with a third directing page
  • Have two versions of the form with only one visible depending upon the state of the condition.

Both are not scalable if in the model there are several conditional fields. :(

Hristian Stefanov
Telerik team
 answered on 23 Jun 2022
1 answer
727 views

Situation: I have an EF table being displayed in a Telerik Grid.

There is a command field which when clicked goes to a page to an action page that consumes the the record for that row.

I want the button to display in rows that meet a condition in that row's data.

Status (an enum) is the field that will if a certain value the condition is true.

So I guess I need access to row's context. ???


                <GridColumn Field="@(nameof(RecordResult.Status))" Title="Status" Width="80px" />
                <GridCommandColumn Title="Update" Width="80px">
                    <GridCommandButton Command="MyOwnCommand" Icon="Information" OnClick="@MyCustomCommandHandler">
                    Claim
                    </GridCommandButton>
                </GridCommandColumn>
            </GridColumns>
        </TelerikGrid>

David
Top achievements
Rank 2
Iron
Iron
Iron
 answered on 23 Jun 2022
1 answer
117 views
Trying to wire up a pager for a grid. If I set the pagesize options as 5, 10, and 20 with 100 records available and choose a pagesize of 20, I get 5 available pages. If I choose page 4, the pagesize resets to 5 and I get 20 pages. How can I keep the pagesize of 20 when changing pages?
Kenn.
Top achievements
Rank 1
Iron
 answered on 23 Jun 2022
0 answers
420 views

 

I am unable to get the Scheduler grouping to work in Timeline view., and have many hours attempting to get it to work.    

I've followed this demo pretty closely, and MANY different attempts at getting grouping to work. 

https://demos.telerik.com/blazor-ui/scheduler/grouping

Is there some property I'm missing that "turns grouping on"?  I temporarily added the orientation so I could switch between Horz/Vert.  

I've got hours and hours into this.  I wish by default if you're configuring a control for something "special" like this, that it would error out and tell you through an exception that you're "missing x or y " or the mapping of a field is invalid or something!   In this case, I've got the grouping setup with mapped fields, etc. (If I have invalid fields I get a dictionary error), etc.  But no grouping. and NO errors.  Very, very frustrating. 

My theory is that I'm missing one simple little thing that "turns grouping on", but I'm not seeing it.

Any help, or further questions on my configuration, please feel free to ask. 

Thanks in advance,

Curt

 

 

Here is my Scheduler Setup below.  I will be removing Week view, it's there just to try different things. 

 <TelerikScheduler Data="@Shifts" Height="100%" Width="100%"
                              @bind-View="@CurrView"
                              TitleField="@(nameof(ShiftCalendarBindingModel.ProductionLineName))"
                              DescriptionField="@(nameof(ShiftCalendarBindingModel.LineTypeName))"
                              StartField="@(nameof(ShiftCalendarBindingModel.Start))"
                              EndField="@(nameof(ShiftCalendarBindingModel.End))"
                              IsAllDayField="@(nameof(ShiftCalendarBindingModel.IsAllDayApt))"
                              IdField="@(nameof(ShiftCalendarBindingModel.Id))"
                              Date="@CurrentDate"
                              DateChanged="@SchedulerDateChangedHandler">
                <SchedulerSettings>
                    <SchedulerGroupSettings Resources="@GroupingResources" Orientation="@GroupingOrientation"></SchedulerGroupSettings>
                </SchedulerSettings>
                <SchedulerResources>
                    <SchedulerResource Field="LineTypeId" TextField="LineTypeName" ValueField="Id" Data="@LineTypes"></SchedulerResource>"
                </SchedulerResources>
                <ItemTemplate>
                    @{
                        var appointment = context as ShiftCalendarBindingModel;
                    }
                    <div style="height: 100%; width:100%; background-color:@(new MarkupString(appointment.BackGroundColor))">
                        <p><strong>@appointment.ProductionLineName</strong>&nbsp;Shift: @appointment.ShiftNumber </p>
                    </div>
                </ItemTemplate>
                <SchedulerViews>
                    <SchedulerTimelineView StartTime="@DayStart" EndTime="@DayEnd"ColumnWidth="50" SlotDuration="60" NumberOfDays="1" />
                    <SchedulerWeekView StartTime="@DayStart" EndTime="@DayEnd" SlotDivisions="2" SlotDuration="60" />
                </SchedulerViews>

            </TelerikScheduler>

 

This is what I'm considering "Important" properties:

   List<SchedulerGroupOrientation> GroupingOrientationOptions = new List<SchedulerGroupOrientation> { SchedulerGroupOrientation.Horizontal, SchedulerGroupOrientation.Vertical };

     private Telerik.Blazor.Components.TelerikScheduler<ShiftCalendarBindingModel> SchedulerRef { get; set; }
    List<string> GroupingResources = new List<string> { "LineTypeId" };

    public List<LineTypeModel> LineTypes { get; set; } = new List<LineTypeModel>();

    public class LineTypeModel
    {
        public int? Id { get; set; }
        public string LineTypeName { get; set; }
    }

 

A few properties from my scheduler model, showing the "LineTypeId":

 

       public class ShiftCalendarBindingModel
    {
        public long Id { get; set; }
        public int? LineTypeId { get; set; }

}

 

Curt
Top achievements
Rank 1
 asked on 22 Jun 2022
1 answer
160 views

Is there a way to leverage the Grid with normalized data?

I've tried looping through the fields to generate the columns, that's fine. But when it comes to editing them, I can't specify the field in the column as the model doesn't have those properties. This then leads to the field never having a value in the OnEdit callback.

I know I can work around it using OnBlur of all of the input fields, but that's really annoying. Any suggestions?

I've added sample JSON of what it sort of looks like at the bottom.

    "lineItems": [
        {
            "id": 5,
            "sortOrder": 2,
            "columns": [
                {
                    "id": 77,
                    "fieldId": 1,
                    "value": "Test 1",
                    "lineItemId": 5
                },
                {
                    "id": 78,
                    "fieldId": 7,
                    "value": "Centerspread",
                    "lineItemId": 5
                },
                {
                    "id": 79,
                    "fieldId": 8,
                    "value": "02/02/2022",
                    "lineItemId": 5
                },
                {
                    "id": 80,
                    "fieldId": 9,
                    "value": "28/02/2022",
                    "lineItemId": 5
                },
                {
                    "id": 81,
                    "fieldId": 11,
                    "value": "4/C",
                    "lineItemId": 5
                },
                {
                    "id": 82,
                    "fieldId": 13,
                    "value": "600",
                    "lineItemId": 5
                },
                {
                    "id": 83,
                    "fieldId": 24,
                    "value": "01/10/2022",
                    "lineItemId": 5
                },
                {
                    "id": 84,
                    "fieldId": 26,
                    "value": "Magazine",
                    "lineItemId": 5
                },
                {
                    "id": 85,
                    "fieldId": 27,
                    "value": "Test 1",
                    "lineItemId": 5
                },
                {
                    "id": 86,
                    "fieldId": 37,
                    "value": "Internal notes, they are a thing!",
                    "lineItemId": 5
                }
        ]

Dimo
Telerik team
 answered on 22 Jun 2022
2 answers
897 views

I need to add custom text to the delete message.  Is there a way to do this?

https://docs.telerik.com/blazor-ui/components/grid/editing/built-in-dialogs/delete-confirmation

Nadezhda Tacheva
Telerik team
 answered on 22 Jun 2022
1 answer
341 views

Hello

 

For a recent project I have to display around 100 000 rows in a grid, I have to be able to sort/filter and select certain rows/select all rows in a filter.
Because it's quite a lot of data I've decided to use the OnRead event on the TelerikGrid, this all seems to work fine except for the ability to select all rows (only the rows on the current page are selected). The grid looks something like this: 

The code looks something like this:

<TelerikGrid AutoGenerateColumns=true
             OnRead="@ReadItems"
             TItem=ProductDto
             Pageable=true
             PageSize=10
             Sortable
             SelectionMode=@GridSelectionMode.Multiple
             FilterMenuType=@FilterMenuType.Menu
             FilterMode="GridFilterMode.FilterMenu"
             Resizable="true"
             ScrollMode="@GridScrollMode.Scrollable"
             SelectedItemsChanged="@((IEnumerable<ProductDto> newSelection) => onSelect(newSelection))"
             Reorderable="true"
             SelectedItems="@selectedProducts"
             >
    <GridColumns>
        <GridCheckboxColumn  CheckBoxOnlySelection="true" Reorderable=false SelectAllMode=@GridSelectAllMode.All Width="100px" SelectAll="true" Locked="true" />
        <GridColumn Field="@nameof(ProductDto.Id)" Title="@_localizer[nameof(Translations.Id)]" Width="100px" Locked="true" />
        <GridColumn Field="@nameof(ProductDto.Code)" Title="@_localizer[nameof(Translations.Code)]" Width="200px" Locked="true" />
        <GridColumn Field="@nameof(ProductDto.ExternalReference)" Title="@_localizer[nameof(Translations.ExternalReference)]" Width="200px" Locked="true" Lockable="true" />
        <GridColumn Field="@nameof(ProductDto.Description)" Title="@_localizer[nameof(Translations.Description)]" Width="200px" Lockable="true" />
        <GridColumn Field="@nameof(ProductDto.BrandCode)" Title="@_localizer[nameof(Translations.BrandCode)]" Width="200px" Lockable="true" />
        <GridAutoGeneratedColumns ColumnWidth="200px" />
    </GridColumns>
</TelerikGrid>

Since I use the OnRead event, only a small amount of data is available client side, when I click the header checkbox of the GridCheckboxColumn all the items that are available client-side get selected BUT, I would like to be able to tell whether a user clicked the checkbox in the header (=select everything in the grid), or if the user just manually selected all the visible rows of a certain page.

TLDR: How to determine whether a user clicked the header checkbox (= select everything) vs a user manually clicked all items on a certain page. (The selectedItems result is both the same)

Kind regards

Thomas

 

Dimo
Telerik team
 answered on 22 Jun 2022
0 answers
246 views

Hello,

I'm trying to comply with accessibility standards and I'm unable to get the Loader text to be read by screen readers.

I've tried wrapping the Loader component in an aria-live element, using templates, and even loaded up your GitHub loader examples to no avail. 

Can you shed some light on what may potentially be happening and how to get it picked up by the screen readers?

Thanks

Rick
Top achievements
Rank 1
 asked on 21 Jun 2022
1 answer
215 views

Is there a way to position a dialog/window next to the button that opened it?

 

 

Dimo
Telerik team
 answered on 21 Jun 2022
1 answer
572 views

I need to to apply a different color scheme.  By default, I am seeing the following.  I use bootstrap for theming.

<link href="_content/Telerik.UI.for.Blazor/css/kendo-theme-bootstrap/all.css" rel="stylesheet" />

 

https://docs.telerik.com/blazor-ui/components/dialog/predefined

 

Marin Bratanov
Telerik team
 answered on 19 Jun 2022
Narrow your results
Selected tags
Tags
+? more
Top users last month
Jay
Top achievements
Rank 3
Bronze
Iron
Iron
yw
Top achievements
Rank 2
Iron
Iron
Stefan
Top achievements
Rank 2
Iron
Iron
Iron
Kao Hung
Top achievements
Rank 1
Iron
Bohdan
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Jay
Top achievements
Rank 3
Bronze
Iron
Iron
yw
Top achievements
Rank 2
Iron
Iron
Stefan
Top achievements
Rank 2
Iron
Iron
Iron
Kao Hung
Top achievements
Rank 1
Iron
Bohdan
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?