I have just started with Telerik UI for Blazor, using the CoffeHouse demo app.
There is an example using the grid for creating a product and on an existing product upload a document.
I would like to create the product and also upload a file when adding a new product.
The code should first create the product, then upload the filestream.
I have a data structure where a user can have many documents. There is a table for the user, the document metadata and a table for the BLOB data.
I have the CRUD working but unable to find a good way to use the grid pop-up together with the upload component
I am opening the dialog from a modal window is there a way to have the dialog disable/turn grey the modal window as well as the page. With the way it works now you can keep entering data on the modal window.
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;
}
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
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?
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?
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 ?