Telerik Forums
UI for Blazor Forum
0 answers
94 views

Hi,

I had to update to .net 6.0.3. The Fileuploader don't work anymore. I can choose a file from the OS-Select Popup, but then nothing happens. The popup closes, no preview (the row with icon, filename, progress) and no error-message and no upload. The same in Firefox and Edge.

Holger
Top achievements
Rank 1
Iron
Iron
 asked on 24 Mar 2022
1 answer
831 views

Attached is the screen shot which shows both Color palette and Color picker in the cell template of the grid. How can I set the Color picker width similar to the Color palette. I have tried setting the class of the Color picker to be width 100 % or fit-content or stretch. But none of them seem to be working.

Attached image file marks the color picker in red and color palette in blue. The color picker should have width similiar to the palatte.

Below is the code and css style.

<GridColumn Field="Color" Title="Color" Width="100px" TextAlign="ColumnTextAlign.Center" FieldType="@(typeof(string))" >              
                        <Template>
                                @{
                                     @colorUpdate.ColorCode;                                        
<TelerikColorPicker @bind-Value="colorUpdate.ColorCode" ValueFormat="ColorFormat.Hex" Class="k-colorpicker" > 
                                            <ColorPickerViews>
                                                <ColorPickerGradientView ShowOpacityEditor="false" Format="ColorFormat.Hex">
                                                </ColorPickerGradientView>                                                
                                            </ColorPickerViews>                       
                                        </TelerikColorPicker>     
 <TelerikColorPalette Colors="@ColorList" TileHeight="25px" TileWidth="25px"  >                                            
                                        </TelerikColorPalette>                      
                                }                
</Template>
</GridColumn>



.k-colorpicker {
    width: stretch;  /*tried using 100% or fit-content */
}

.k-colorpicker .k-selected-color {
    width: stretch; /*tried using 100% or fit-content */
}

span.k-colorpicker{
 width: stretch; /*tried using 100% or fit-content */
}

Thank you for your help.

Beena.

Dimo
Telerik team
 answered on 24 Mar 2022
1 answer
444 views

Hi I would like to build a dark mode toggle like the one on use on  Dark Mode - Tailwind CSS

Have been looking at the documentation for the content menu and the "normal" menu.
I can see that you can use a template but can I build a template that's accept svg?

Any plans on implementing headless-ui for blazor? I really like the concept.

Could use Bootstrap dropdown, but again why use another framework?

Dropdowns ยท Bootstrap v5.1 (getbootstrap.com)

Svetoslav Dimitrov
Telerik team
 answered on 23 Mar 2022
1 answer
748 views

Hi, I am trying to modify the existing code for the Hierarchical Drawer so I can have a nested nav menu in the drawer. Right now, when I add a level 2 child to a level 1 child, the level 2 child is not aligned properly; it is in line with the first original level when it should be indented. How can I fix this?

 

 


@inject IFacilityService FacilityService
@inject ILocationService LocationService


 
 <div class="custom-toolbar">
    <TelerikButton OnClick="@ToggleDrawer" Icon="menu" FillMode="@(ThemeConstants.Button.FillMode.Flat)"></TelerikButton>
    <span style="margin-left: 20px; font-weight: bold; font-size: 17px;">Wilder Fields Sensor Dashboard</span>
</div>

<TelerikDrawer @ref="@Drawer" Data="Data" MiniMode="false" Mode="@DrawerMode.Push" TItem="DrawerItem" SelectedItemChanged="@OnItemSelect" @bind-Expanded="@Expanded">
    <Template>
        <div class="k-drawer-items" role="menubar" aria-orientation="vertical">
             <LoginDisplay />
            <ul>
                @foreach (var item in context)
                {
                    var selectedClass = item == SelectedItem ? "k-state-selected" : string.Empty;
                    <li @onclick="@(() => OnItemSelect(item))" class="k-drawer-item @selectedClass">
                        <div class="k-level-@(item.Level)">
                            <TelerikIcon Icon="@item.Icon"></TelerikIcon>
                            <span class="k-item-text">@item.Text</span>
                        </div>

                        @if (item.Expanded && (item.Children?.Any() ?? false))
                        {
                            <span class="k-icon k-i-arrow-chevron-down" style="position:absolute; right:0; line-height: inherit; margin: 0 8px"></span>
                        }
                        else if (!item.Expanded && (item.Children?.Any() ?? false))
                        {
                            <span class="k-icon k-i-arrow-chevron-right" style="position:absolute; right:0; line-height: inherit; margin: 0 8px"></span>
                        }
                    </li>
                }
                
            </ul>
        </div>        
    </Template>
    <DrawerContent>
        @SelectedItem?.Description
    </DrawerContent>
</TelerikDrawer>







   

   <!--- <NotAuthorized>
        <a href="authentication/login">Log in</a>
    </NotAuthorized>-->



@code {
   
  

    

    protected override async Task OnParametersSetAsync()
    {
        await base.OnParametersSetAsync();

       
    }
    public TelerikDrawer<DrawerItem> Drawer { get; set; }
    public DrawerItem SelectedItem { get; set; }
    public bool Expanded { get; set; } = true;
    public IEnumerable<DrawerItem> Data { get; set; } =
    new List<DrawerItem>
    {
            new DrawerItem { Text = "R2D2", Icon = "question",
             Children = new List<DrawerItem>()
                {
                    new DrawerItem { Text = "Room 1", Icon = "grid", Level = 1,
                    Children = new List<DrawerItem>()
                {
                    new DrawerItem { Text = "Room 1", Icon = "grid", Level = 2 },
                    new DrawerItem { Text = "Calendar", Icon = "calendar-date", Level = 2, Description = "The Calendar component allows the user to scroll through a calendar and select one or more dates. " },
                    new DrawerItem { Text = "Menu", Icon = "menu", Level = 2, Description = "The Menu component displays data (flat or hierarchical) in a traditional menu-like structure." },
                }
                    
                    
                    
                    },
                   
                }
            
            
            
            
            
            },

            new DrawerItem {
                Text = "Components",
                Icon = "categorize",
                Description = "Blazor is still a new technology and the component suite is young. We are constantly working on adding new features and components. Tell us which components you want implemented and how you intend to use them, and Blazor, at our feedback portal.",
                Children = new List<DrawerItem>()
                {
                    new DrawerItem { Text = "Room 1", Icon = "grid", Level = 1, Description = "The Telerik Blazor Data Grid provides a comprehensive set of ready-to-use features covering everything from paging, sorting, filtering, editing, and grouping to row virtualization, optimized data reading, keyboard navigation and accessibility support." },
                    new DrawerItem { Text = "Calendar", Icon = "calendar-date", Level = 1, Description = "The Calendar component allows the user to scroll through a calendar and select one or more dates. " },
                    new DrawerItem { Text = "Menu", Icon = "menu", Level = 1, Description = "The Menu component displays data (flat or hierarchical) in a traditional menu-like structure." },
                }
            },
            new DrawerItem { Text = "Browser Support", Icon = "calendar", Description = "Browsers supported by Telerik UI for Blazor: Chrome (including Android and iOS), Edge, Firefox, Safari (including iOS)" }
        };

    public async Task ToggleDrawer() => await Drawer.ToggleAsync();

    protected override void OnInitialized()
    {
        SelectedItem = Data.First();
    }

    public void OnItemSelect(DrawerItem selectedItem)
    {
        SelectedItem = selectedItem;

        selectedItem.Expanded = !selectedItem.Expanded;
        var newData = new List<DrawerItem>();

        foreach (var item in Data.Where(x => x.Level <= selectedItem.Level))
        {
            newData.Add(item);
            if (item == selectedItem && selectedItem.Expanded && (item.Children?.Any() ?? false))
            {
                foreach (var child in item.Children)
                {
                    newData.Add(child);
                }
            }

            if (item != selectedItem && !(item.Children?.Contains(selectedItem) ?? false))
            {
                item.Expanded = false;
            }
        }

        Data = newData;
    }

    public class DrawerItem
    {
        public string Text { get; set; }

        public string Icon { get; set; }

        public bool Expanded { get; set; }

        public int Level { get; set; }

        public string Description { get; set; }

        public IEnumerable<DrawerItem> Children { get; set; }
    }


     


   
}


<style>
    #demo-runner {
        height: 600px;
    }

    .k-drawer-content {
        padding: 25px;
        font-size: 18px;
    }

    .k-drawer-container {
        position: relative;
        width: 100%;
        height: 95%;
    }

    .k-drawer .k-drawer-item {
        white-space: nowrap;
        overflow: hidden;
    }

    .k-level-1 {
        padding-left: 20px;
    }

    .custom-toolbar {
        width: 100%;
        background-color: #f6f6f6;
        line-height: 10px;
        border-bottom: inset;
        border-bottom-width: 1px;
        padding: 3px 8px;
        color: #656565;
    }
</style>

Svetoslav Dimitrov
Telerik team
 answered on 23 Mar 2022
0 answers
171 views

Hello everyone,

Is there an event that is fired when the column changes it's position by reordering it?

Thank you,
Cipri

Ciprian Daniel
Top achievements
Rank 1
Iron
Iron
Iron
 asked on 23 Mar 2022
0 answers
365 views

I use blazor chart component and it works quite fine. The problem starts when printing the current html page (CTRL+P) then the chart gets cut off on the right side and does not scale correctly. As you can see in my screenshot the table above the chart is scaled ok but the chart is cut off.

What can I do to print the chart in a correct way?

Regards
Heiko

Heiko
Top achievements
Rank 1
Iron
Veteran
 asked on 22 Mar 2022
0 answers
880 views

I have experience with Linq Expressions and like to implement my own. 

The gridState.FilterDescriptors.Add method accepts anything of interface IFilterDescriptor.

However, when I give it my own implementation of IFilterDescriptor, it compiles fine but then throws an error during runtime:

System.InvalidCastException: 'Unable to cast object of type 'MyFilterDescriptor' to type 'Telerik.DataSource.FilterDescriptor'.'

I thought to inherit Telerik.DataSource.FilterDescriptor and Telerik.DataSource.CompositeFilterDescriptor and override the CreateFilterExpression method, but that didn't work either, as it always ends up calling the method in the base FilterDescriptor.

Is this by design, or is there a way now or in the future to implement my own IFilterDescriptor?

Thanks.

Alex
Top achievements
Rank 1
Iron
Iron
 updated question on 22 Mar 2022
0 answers
100 views

Hello everyone,

Is there a possibility to set some properties regarding the design of the grid for example:
- header background color
- rounded corners
- interlaced, flat design for the rows, now it's interlaced by default, I mean, a row white, a row grey, by flat I mean all rows in the same color, white for example

I know that this changes can be done from CSS but if I do them I don't want to influence the design for the active row for example, so I'm interested if there can be a much nicer solution.

Thank you,
Cipri

Ciprian Daniel
Top achievements
Rank 1
Iron
Iron
Iron
 updated question on 21 Mar 2022
1 answer
133 views

I am using TreeList and a custom template on a column to display user avatar. I also need to sort and filter on this column. However when combine all of these features (sort and filter) on a template column, it doesn't work. There are 2 scenarios:

- When enable sort, the filtering works

- When disable sort, the filtering doesnt work

Is there any work around solution for this? I am using UI for Blazor 3.0.1

 

My snippet

https://blazorrepl.telerik.com/mQuxlWkD32B5eGay33

Radko
Telerik team
 updated answer on 21 Mar 2022
0 answers
117 views

Hi,

We're new to Teleric UI control and we plan to build a one page on Blazer client and use Blazor server in the Server side. 

The server contains business logic to connect to a Azure DB.  On client side, we provide a simple textbox to input search parameter and trigger a DB search. The result will be returned by several stored procedure kind of functions. 

On the client side, we hope to display a tree.  When user click the root node, it'll expand with 3 child nodes. We hope to do data binding to a data table in the node. 

Does TreeList  or TreeView control support that functionality?

Thanks,

Ellen

Ellen
Top achievements
Rank 1
 asked on 21 Mar 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?