Telerik Forums
UI for Blazor Forum
0 answers
148 views

Hello,

We need to let the user sort the tabs as they wish.

These tabs are generated at runtime in a loop, is it possible to change the tab order once they are generated at runtime?

 

Thanks


Fabio
Top achievements
Rank 1
Iron
 asked on 28 Jul 2022
2 answers
987 views

When using either Jaws or NVDA screen readers with the grid, and the column header is being sorted (it doesn't matter whether ascending or descending), that column name is no longer read by the screen reader. Instead it reads out "sorted ascending (or descending)".  I would expect that it should read out the column name and then the sort.  For example:  "Name sorted ascending".  When the column is not sorted, then the column name is read out correctly. 

 

It should also be noted that this happens whether the focus is on the header cell or a regular cell for that column.

Nadezhda Tacheva
Telerik team
 answered on 28 Jul 2022
1 answer
172 views

I am using a Pager and set the PageSizes to { null, 25, 50, 100 } where null means "All" according to documentation.

When the user sets a PageSize, I save that number in the local storage of the browser. When the user returns to that page later, I will get that stored value and set the PageSize parameter accordingly.

When the user sets the PageSize to "All", I save the total amount of entries to local storage, because that's what I get from the PageSizeChanged handler. When restoring that value later, of course the selected value in PageSize dropdown is empty, because I set the PageSize parameter to the total amount of entries. Since this number is not present in the dropdown list, it will simply show nothing.

I would like the PageSizes dropdown to show "All" when PageSize is equal to the total amount of items. Is there a way to do this? In fact, I can't even set PageSize to null, since it is not nullable.

Dimo
Telerik team
 answered on 28 Jul 2022
1 answer
206 views

Hey,

Is there any option to disable it, so view is in readonly mode?

Hristian Stefanov
Telerik team
 answered on 28 Jul 2022
1 answer
638 views

My goal is to load grid with a custom column order, in razor the grid is defined with a default column order:

<TelerikGrid @ref="Grid" Data="Data">

    <GridColumns>
        <GridColumn Field="UserName" />
        <GridColumn Field="Name" />
        <GridColumn Field="Surname" />
    </GridColumns>
</TelerikGrid>

but user can change it, and the change persist, so the next time it show the grid, it need to have the custom grid order saved from the user.

I don't want to persist all the grid state, only the column order, so i solved this task allow grid to be Reorderable and saving to db the column order.

To load the custom order i tried using the OnStateInit event, get the column state from GridState.ColumnStates and setting the Index property.

This approach is described in documentation:

https://docs.telerik.com/blazor-ui/knowledge-base/grid-column-in-custom-component-is-last?_ga=2.55826989.723302907.1658393190-1092710656.1653913029#solution

https://docs.telerik.com/blazor-ui/components/grid/state?_ga=2.260109709.1455456748.1658732515-1092710656.1653913029#information-in-the-grid-state

Unfortunally, in the OnStateInit event the property GridState.ColumnStates has no columns, so my solution is to change the column state in the OnAfterRenderAsync event, reading GridState.ColumnStates (this time column states are loaded) and setting the Index property.

This workaround work well but cause a graphic flicker, as when the event is fired, the grid is rendered with the original column order, then is changed based on code settings to ColumnState.Index property.

This is a sample code of this problem:

https://blazorrepl.telerik.com/GmaBwJYt15pTBs8J53

Now, how can i avoid this behaviour allow the grid to render directly with the custom column order? There is another event when i can change the ColumnState.Index property allow to render correctly?

Thanks

 

Dimo
Telerik team
 answered on 28 Jul 2022
1 answer
137 views
Is there a workaround for being able to execute code before rendering the edit template on a Grid when edit mode is Incell? I need to execute code just before editing starts.
Svetoslav Dimitrov
Telerik team
 answered on 27 Jul 2022
0 answers
231 views
Hello. 
I have a treelist whose nodes can be expanded or not. I would like that when a search is performed, the resulting nodes are all expanded. 
In the documentation I can't find events like OnSearch, BeforeSearch, AfterSearch... so that I can change the state of the nodes after a search is performed. 
Are these SearchBox events accessible. If not, any idea how to achieve my goal? 

Thank you very much. 
Blazorist
Top achievements
Rank 2
Bronze
Iron
Iron
 updated question on 26 Jul 2022
1 answer
178 views

I have added a templated column to my grid that contains hyperlinks.  However, I'm not able to navigate to it within the same context as navigating the grid with the arrow keys.  So, if I set focus in the grid, and then use the arrow keys to navigate to the cell with the link in it, I would expect that pressing the Enter Key will put the focus on the link so that I can press enter again to navigate to the link's destination.  This is functionality similar to how the GridCommandColumn works where pressing enter on the cell that has the focus, navigates into the cell and puts the focus on the first button in that cell. Then you can hit enter to activate the button or escape to exit back out to focus back on the cell.

Your documentation in the keyboard navigation demo even says that it should do this here:

  • Enter activates editing for the data cell when the grid is in InCell EditMode. In EditMode – saves changes and closes the editor. When a header cell is focused applies sorting. When a hierarchy cell is focused expands/collapses the detail template. When a template cell or a command cell is focused, focuses the first focusable element inside.
  • Is this a bug, or is there something that I need to do to make it work for a template column?  Here's a repl copied from your keyboard navigation demo that illustrates the issue:
  • https://blazorrepl.telerik.com/cQELQuvs25Rykh2B47
Svetoslav Dimitrov
Telerik team
 answered on 25 Jul 2022
1 answer
282 views

I checked the following example:

Treeview Data Binding to Hierarchical Data

Let's say ProductCategoryItem has a second list, e. g. "Orders".

public class ProductCategoryItem
{
    public string Category { get; set; }
    public List<ProductItem> Products { get; set; }
    public List<OrderItem> Orders {get; set; }
}

public class ProductItem
{
    public string ProductName { get; set; }
}

public class OrderItem
{
    public string OrderName { get; set; }
}

How can I display this second list "Orders" in TreeView?

<TelerikTreeView Data="@HierarchicalData" @bind-ExpandedItems="@ExpandedItems">
    <TreeViewBindings>
        <TreeViewBinding TextField="Category" ItemsField="Products" />
        <TreeViewBinding Level="1" TextField="ProductName" />
        ??? <TreeViewBinding TextField="Category" ItemsField="Orders" /> ???
    </TreeViewBindings>
</TelerikTreeView>
Regards
Heiko
Hristian Stefanov
Telerik team
 answered on 25 Jul 2022
2 answers
417 views

Scenario:

Want to save and restore the GridState between sessions to save the users columns being displayed, sort order and filter status.

Problem:

If the code to the TelerikGrid is changed between saving and restoring the GridState, the TelerikGrid will not display the data correctly at a minimum and at worst can crash Blazor circuit completely.

Solution:

Restoring a GridState from a previous version of the GridState should not crash the site on the restore.  It should realize the state isn't valid for this TelerikGrid and should do no harm.

Workaround:

Is there a coding pattern for saving and restoring GridState to local storage that would work around column changes between saving and restoring the GridState?

Repro:

  1. Save the GridState to local storage, so that user can come back later and the state is restored to provide the same view to the user.


  2. Change the code for the Telerik Grid Control to show completely different columns. 
  3. The user comes back to the UI and the code restored the GridState from the previous save before TelerikGrid was changed.



  4. Best case, the TelerikGrid format restored doesn't match what was saved previously and columns displayed are inconsistent to what was saved previously is the best case and need to reset the GridState.

    GridState<PackageRequest> desiredState = new GridState<PackageRequest>();

  5. Worst case, the TelerikGrid throws a unhandled System.ArgumentException exception and crashes the entire page.
    (see attached screen shot and the exception from Azure App Insights).

 

 

 

Jerdobi
Top achievements
Rank 1
Iron
Iron
 answered on 22 Jul 2022
Narrow your results
Selected tags
Tags
+? more
Top users last month
Rob
Top achievements
Rank 3
Iron
Iron
Iron
Atul
Top achievements
Rank 1
Iron
Iron
Iron
Alexander
Top achievements
Rank 1
Veteran
Iron
Serkan
Top achievements
Rank 1
Iron
Shawn
Top achievements
Rank 1
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Rob
Top achievements
Rank 3
Iron
Iron
Iron
Atul
Top achievements
Rank 1
Iron
Iron
Iron
Alexander
Top achievements
Rank 1
Veteran
Iron
Serkan
Top achievements
Rank 1
Iron
Shawn
Top achievements
Rank 1
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?