Bug Report T822277
Visible to All Users

Blazor TreeView - It's not possible to expand a parent node that contains the NavigateUrl field

created 5 years ago (modified 5 years ago)

This issue can be reproduced with the following code:

Razor
<DxTreeView Data="@model" TextExpression="@(dataItem => ((TestModel)dataItem).Text)" NavigateUrlExpression="@(dataItem => ((TestModel)dataItem).Url)" ChildrenExpression="@(dataItem => ((TestModel)dataItem).ChildNodes)"> </DxTreeView> @code { List<TestModel> model = new List<TestModel>(); protected override void OnInitialized() { List<TestModel> child1 = new List<TestModel>(); child1.Add(new TestModel() { ID = 1, Text = "Test1Child1", Url = "/Test1Child1" }); child1.Add(new TestModel() { ID = 2, Text = "Test1Child2", Url = "/Test1Child2" }); model.Add(new TestModel() { ID = 0, Text = "Test1", Url = "/Test1", ChildNodes = child1 }); List<TestModel> child2 = new List<TestModel>(); child2.Add(new TestModel() { ID = 4, Text = "Test2Child1", Url = "/Test2Child1" }); child2.Add(new TestModel() { ID = 5, Text = "Test2Child2", Url = "/Test2Child2" }); model.Add(new TestModel() { ID = 3, Text = "Test2", Url = "/Test2", ChildNodes = child2 }); } }

If the "Test1" parent node is clicked, it's expanded but at the same time the current page is changed.

Workaround:

Use TreeView templates to prevent navigation as demonstrated in the TreeView for Blazor - Allow to expand/collapse a parent node without navigating if you click on the caret ticket.

Answers approved by DevExpress Support

created 5 years ago (modified 5 years ago)

We have fixed the issue described in this ticket and will include the fix in our next update. The update will be available via the DevExpress NuGet server. Refer to this page to obtain your personal NuGet feed URL.

    Disclaimer: The information provided on DevExpress.com and affiliated web properties (including the DevExpress Support Center) is provided "as is" without warranty of any kind. Developer Express Inc disclaims all warranties, either express or implied, including the warranties of merchantability and fitness for a particular purpose. Please refer to the DevExpress.com Website Terms of Use for more information in this regard.

    Confidential Information: Developer Express Inc does not wish to receive, will not act to procure, nor will it solicit, confidential or proprietary materials and information from you through the DevExpress Support Center or its web properties. Any and all materials or information divulged during chats, email communications, online discussions, Support Center tickets, or made available to Developer Express Inc in any manner will be deemed NOT to be confidential by Developer Express Inc. Please refer to the DevExpress.com Website Terms of Use for more information in this regard.