Telerik Forums
UI for Blazor Forum
0 answers
1.0K+ views

Hello Support Team,

I have a Item Template for my Treeview. I want to make the background color different for my selected item and let it stick. When the user selects another item, it should highlight that selected item and other items should look normal.


<TelerikTreeView Data="@DefectTreeView" @bind-ExpandedItems="@ExpandedItems"  SelectionMode="TreeViewSelectionMode.Single" >                    
                            <TreeViewBindings>                    
                                <TreeViewBinding IdField="DefectCategoryID" ParentIdField="ParentID" TextField="DefectCategoryName" HasChildrenField="HasChildren" IconField="folder-open" >
                                    <ItemTemplate>
                                        @{
                                            var item = context as DefectDefectCategory_TreeViewResultModel;
                                            var chkenabled = false;
                                            var chkvalue = false;
                                            if (item.HasChildren == false && item.ChildrenCount == 0)
                                            {
                                                chkenabled = true;
                                                <div style="padding-right: 4px;">
                                                    <TelerikCheckBox Enabled="chkenabled" Id="chkDelete" Title="Check to Delete Category" ValueChanged="@((bool value) => GetSelectedTreeItemsDelete(value,item.DefectCategoryID))" > 
                                                    </TelerikCheckBox>
                                                </div>
                                            }                                            
                                            var itemname = item.DefectCategoryName.ToString() + " (" + item.ChildrenCount.ToString() + ")";                                           
                                           @itemname;
                                        }
                                    </ItemTemplate>                                    
                                </TreeViewBinding>
                            </TreeViewBindings>                            
                        </TelerikTreeView>

How do I set the css style to show the selected item.

Thank you.

Beena
Top achievements
Rank 1
Iron
Iron
 asked on 28 Feb 2022
1 answer
361 views

I'm developing an application where accessibility is very high priority, and I'm finding that every time I try to use one of your controls within the application, there is some sort of issue with its usability, mostly with screen readers.  While I know that you are working on trying to make the controls more accessible, this appears to be slow going. 

Further, I'm not seeing any options for workarounds.  For example, most of the controls are missing certain aria labels that would make them viable to use with screen readers, but because you have deciding not to implement allowing arbitrary attributes / attribute splatting within your controls I can't do anything to get these controls working for screen reader users. As a result, I keep having to roll my own controls instead of using yours, even though in most cases your control is 90% there.

Take the Multi-select control.  It has keyboard support, which is great, and it does read the options when navigating through the dropdown, but once you have selected an option, there is no way to get a screen reader to read any of the selected tags.

Another example is with your checkbox control. I need a way to set an aria-invalid attribute on the control, but I can't do so because your controls don't support attribute splatting: http://https://feedback.telerik.com/blazor/1416978-support-arbitrary-attributes?_ga=2.192430378.1005614243.1645625246-1187442152.1626202564

Other examples include:

https://www.telerik.com/forums/how-to-alter-aria-attributes-on-menu-and-panelbar

https://www.telerik.com/forums/how-to-add-html-aria-attributes-to-telerik-components

https://www.telerik.com/forums/ignore-forward-slash-allow-various-formats-when-using-date-input

I know that you are working on some of these things, but this is not something that I can wait months for to be released.  So I'm asking are there any work arounds for some of these issues?  If you had chosen to support arbitrary attributes, it would ease the frustration of waiting for a fix because we could have used that method as a workaround.  Is there anything that I can do now to mitigate my issues short of writing the controls from scratch?  

Hristian Stefanov
Telerik team
 answered on 28 Feb 2022
1 answer
318 views

Is there any way to turn off grouping before exporting to excel and then turn it back on.  I have tried utilizing the before and after export events but it does not seem to work.


	private async Task OnExcelAfterExportAsync(GridAfterExcelExportEventArgs args)
	{
		await ticketGrid.SetState(currentGridState);
	}

	private async Task OnExcelBeforeExportAsync(GridBeforeExcelExportEventArgs args)
	{
		currentGridState = ticketGrid.GetState();

		GridState<TicketListModel> tempState = new()
			{
				SortDescriptors = currentGridState.SortDescriptors,
				FilterDescriptors = currentGridState.FilterDescriptors,
				GroupDescriptors = new List<GroupDescriptor>()
			};

		await ticketGrid.SetState(tempState);

		args.Columns = args.Columns.Except(args.Columns.Where(c => c.Field == "HasAttachments")).ToList();

		var statusColumn = args.Columns.First(c => c.Field == "StatusId");
		statusColumn.Field = "Status";

		var priorityColumn = args.Columns.First(c => c.Field == "PriorityId");
		priorityColumn.Field = "Priority";

		var areaColumn = args.Columns.First(c => c.Field == "Area");
		areaColumn.Width = "150px";

		args.IsCancelled = false;
	}

Svetoslav Dimitrov
Telerik team
 answered on 28 Feb 2022
1 answer
791 views

I have a handler for OnSelect, where I take the files and store them on the server. However, after this is done, the FileSelector still shows the files to the user, for no reason.

I couldn't find anyway in the code to clear the list of files or to indicate to the FileSelector that the uploading was done. It doesn't look right when I tell the user "Upload Done!", yet the files selected by the user are still listed visible in the FileSelector.

Apostolos
Telerik team
 answered on 28 Feb 2022
0 answers
715 views

The user wants to enter several values separated by a comma, but with AutoComplete, when the user selects a value, it always clears the previous values.

Is it possible to have an Append behavior, where the value gets appended rather than the current Overwrite behavior?

What I want to do is actually almost the same as the Tags textbox I used now to create this post. Thanks!

Edit: Never mind, I think Multiselect is what I should use. https://demos.telerik.com/blazor-ui/multiselect/overview

Alex
Top achievements
Rank 1
Iron
Iron
 updated question on 27 Feb 2022
1 answer
1.0K+ views
I am trying to set overflow:auto on the TabStripTab so that the scrollbar will be contained within each tab (I have some content as a header above the tabs so I do not want the scrollbars to be on the whole page).  I am having a lot of difficulty getting this to work.  Are there any suggestions for getting this to work?
Dimo
Telerik team
 answered on 25 Feb 2022
1 answer
459 views

Is it possible to catch all errors in Blazor Server like in MVC 5 in global.asax on Application_Error and send an email to application administrator?

thank you,

MAtej

Matthias
Top achievements
Rank 5
Bronze
Bronze
Iron
 updated answer on 25 Feb 2022
0 answers
204 views

Hello, per the documentation here:

https://docs.telerik.com/blazor-ui/components/grid/columns/command

Yet ChildContent doesn't appear to exist?  It doesn't come up in IntelliSense.  When I try using it anyhow, the text appears in red, or worse, ReSharper thinks it's a constant from some library that hasn't been imported:

Your examples don't show how to use ChildContent, so I'm making educated guesses.

I can get away from the "red text" by pointing it to a string:


<GridCommandButton Command="Test" ChildContent="@test"></GridCommandButton>

and

@code {
    private string test = "Test Content";
}

However I get compiler errors, so I don't think that's correct either.

It looks like the compiler is expected ChildContent to be a RenderFragment:


Error CS0030 Cannot convert type 'string' to 'Microsoft.AspNetCore.Components.RenderFragment' 

I can use the alternate method of putting the text between the tags:

<GridCommandButton Command="Test">Test</GridCommandButton>

I initially tried the ChildContent method because I can getting a warning I didn't initially understand when I tried using the text between the tags.  I now understand that was a ReSharper warning of no significance.

But I thought I'd point out docs for ChildContent appear to be incomplete?

Thanks.

Charles
Top achievements
Rank 1
Iron
Iron
Iron
 asked on 24 Feb 2022
1 answer
179 views

My scenario is: When the user starts making changes, I am showing a warning notification to the user to not forget to hit save. After the user presses save, I want to make that notification disappear if it is still visible and the user haven't closed it themselves yet.

Please let me know if its possible to do so.

Thanks,

Alex

Marin Bratanov
Telerik team
 answered on 24 Feb 2022
0 answers
140 views

I have a TreeView with checkboxes.

How can I hide a checkbox for a parent node?

 

also, is there CheckedChanged event ?

Ilan
Top achievements
Rank 1
Bronze
Iron
Veteran
 updated question on 24 Feb 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?