Telerik Forums
UI for Blazor Forum
1 answer
445 views

     Hi. For the life of me, I can't figure out how to programmatically check checkboxes on a treeview loaded with hiearchical data.

I've even tried setting the CheckedItems = StoreageItems, using your example. I must be missing some magic sauce. The treeview comes up just fine. I just can't precheck items.

Help!!!!

  <TelerikTreeView Data="@tvData" CheckBoxMode="TreeViewCheckBoxMode.Multiple"
@bind-CheckedItems="@CheckedItems"
                                             CheckParents="true" CheckChildren="true" OnExpand="@OnExpand">
                                <TreeViewBindings>
                                    <TreeViewBinding IdField="CategoryId" ParentIdField="ParentItemId" ItemsField="Items"
                                                      HasChildrenField="HasChildren"
                                                     TextField="CategoryName" IconField="Icon">
 
                                    </TreeViewBinding>
                                    <TreeViewBinding Level="1" TextField="CategoryName" />
                                </TreeViewBindings>
                            </TelerikTreeView>
  public IEnumerable<object> CheckedItems { get; set; }
 
        public TreeViewCheckBoxMode CheckBoxMode { get; set; } = TreeViewCheckBoxMode.Multiple;
 
public void LoadtvRootData()
        {
            List<CategoryItem> lst = new List<CategoryItem>();
            // data requested and received for a certain node
            var q = from a in db.Categories
                    where a.IsActive == true && a.SubscriberId == appData.AppUser.Id && a.ParentCategoryId == null
                    orderby a.CategoryName
                    select a;
 
           var lst1 = q.ToList();
            foreach(var item in lst1)
            {
                CategoryItem ci = new CategoryItem(item);
                var q1 = from a in db.Categories
                        where a.ParentCategoryId == item.Id
                        select new CategoryItem(a)
                        {
                            Category = a,
                            HasChildren = ATDBContext.udfCategoryHasChildren(a.Id),
                        };
                ci.Items = q1.ToList();
                ci.HasChildren = ci.Items.Count > 0;
                ci.Category = item;
                lst.Add(ci);
            }
            tvData = new List<CategoryItem>(lst);
            CheckedItems = tvData;
}
Svetoslav Dimitrov
Telerik team
 answered on 13 Apr 2021
1 answer
456 views
Basically anything with a drop down container does not show on Telerik Window. This is nothing fancy and really is weird. If I type something into the combo-box the drop down filtering does not show, but if I press the arrow it shows the data. On Multiselect there is nothing available to click like an arrow so the container never comes to the forefront. I test on a non windowed view and both perform correctly.
Marin Bratanov
Telerik team
 answered on 13 Apr 2021
1 answer
283 views

Can NumericTextBox Format Be Updatedat run time?  In other words, if numerictextbox is being used for dimensions and the user changes the preferred dimensional unit from "centimeters" to "inches" can the Format be changed from "0.## cm" to "0.## in" at runtime?

 

If so, are there any examples of it?

 

Thanks,

Tim

Marin Bratanov
Telerik team
 answered on 12 Apr 2021
2 answers
281 views

When I try to use the filtering on a combox box that is inside of a Modal Window, the drop down opens behind the modal window and is un-usable?

I have attached a screen shot of what is happening?

Can this not be used inside a modal window?

 

 

Bob
Top achievements
Rank 1
Iron
Veteran
Iron
 answered on 12 Apr 2021
4 answers
1.6K+ views
Hello,
I had a problem with percentage format. whenever i use percentage and input 1 to the numeric text box it shows 100% when i input 0.10 it shows 10%
is there a way to fix this ?
like inputing 1 will show 1% and inputing 10 will show 10%
 
BlueOcean
Top achievements
Rank 2
 answered on 12 Apr 2021
1 answer
744 views

Hi, 

 

I recently just starting playing around with TelerikTooltip for blazor. 

Is it possible if I can add a custom tooltip to the items when mouseover? 

 

Hristian Stefanov
Telerik team
 answered on 09 Apr 2021
1 answer
889 views

I have a Telerik Blazor Grid and one of the columns is displaying values from an enum, the enum is defined as:

01.[Serializable]
02.public enum ClientType
03.{
04.    [EnumOrder(1)]
05.    [Description("Fleet")]
06.    Fleet = 1,
07. 
08.    [EnumOrder(2)]
09.    [Description("Manufacturer")]
10.    Manufacturer = 2,
11. 
12.    [EnumOrder(3)]
13.    [Description("Manufacturer (Restricted)")]
14.    ManufacturerRestricted = 3,
15. 
16.    [EnumOrder(4)]
17.    [Description("Other")]
18.    Other = 4
19.}

 

I wanted to be able to display the value stored in the Description attribute of the enum rather than the enum value as the Description attribute value is more readable.  I was able to do this by using an enum extension method and calling that in a GridColumn template like so:

1.<GridColumn Field="@(nameof(ClientInfo.ClientType))" Width="100px" Filterable="true" Groupable="false">
2.    <Template>
3.        @((context as ClientInfo)?.ClientType.ToDescription())
4.    </Template>
5.</GridColumn>

 

I then looked at adding a checkbox filter to this column so that all the possible enum values would be shown as checkboxes.  I have managed to do this by adding a FilterMenuTemplate with a TelerikCheckBoxListFilter to the GridColumn like so:

01.<GridColumn Field="@(nameof(ClientInfo.ClientType))" Width="100px" Filterable="true" Groupable="false">
02.    <FilterMenuTemplate Context="context">
03.        <TelerikCheckBoxListFilter Data="@GridFilterOptionsService.ClientTypeList"
04.                                   Field="@(nameof(ClientTypeFilterOption.ClientType))"
05.                                   @bind-FilterDescriptor="@context.FilterDescriptor">
06.        </TelerikCheckBoxListFilter>
07.    </FilterMenuTemplate>
08.    <Template>
09.        @((context as ClientInfo)?.ClientType.ToDescription())
10.    </Template>
11.</GridColumn>

 

This functions and correctly filters the grid based on the filter values checked.  Unfortunately I'm not able to apply the same enum extension method as to display the Description attribute value from the enum for the checkboxlist items Text item.

The attached picture shows the checkboxlist rendering the enum values and not the Description attribute values.

I have tried the following but it doesn't work:

01.<GridColumn Field="@(nameof(ClientInfo.ClientType))" Width="100px" Filterable="true" Groupable="false">
02.    <FilterMenuTemplate Context="context">
03.        <TelerikCheckBoxListFilter Data="@GridFilterOptionsService.ClientTypeList"
04.                                   Field="@(nameof(ClientTypeFilterOption.ClientType))"
05.                                   @bind-FilterDescriptor="@context.FilterDescriptor">
06.            <Template>
07.                @((context as ClientTypeFilterOption)?.ClientType.ToDescription())
08.            </Template>
09.        </TelerikCheckBoxListFilter>
10.    </FilterMenuTemplate>
11.    <Template>
12.        @((context as ClientInfo)?.ClientType.ToDescription())
13.    </Template>
14.</GridColumn>

 

Is there a way I can achieve displaying the enum Description attribute values in the TelerikCheckBoxListFilter like I can in the GridColumn Template ?

 

 

 

Nadezhda Tacheva
Telerik team
 answered on 09 Apr 2021
1 answer
169 views

Hello, Is it possible to define a view (razor-class) as the content of a TabStripTab, as is possible in the Telerik WPF TabItem? Something like this:

<Tabcontrol>

    <TabItem>

         <TabItem.Content>

                  <view:AnotherProjectView x:Name="AnotherProjectView "/>

         </TabItem.Content>

    </TabItem>

</Tabcontrol>

Mario
Top achievements
Rank 1
Iron
Iron
 answered on 09 Apr 2021
1 answer
205 views
I have a wide grid and need to write custom filters for two of the columns. I've implemented this in OnRead but is there a way to do that while allowing the default filter to run for all the other columns or do I need to write custom filters for all columns?
Marin Bratanov
Telerik team
 answered on 09 Apr 2021
1 answer
259 views

Is it possible to use both Auto Generation (https://demos.telerik.com/blazor-ui/form/auto-generated) and Templates (https://demos.telerik.com/blazor-ui/form/templates)?

 

In other words, specify the template for a couple of items and let it autogenerate the rest?

 

This would be incredibly useful for handling situations like dropdown that need external data.

Marin Bratanov
Telerik team
 answered on 09 Apr 2021
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?