This is a migrated thread and some comments may be shown as answers.

Canceling SelectionChanging event and expanding item causes a crash

1 Answer 36 Views
TreeListView
This is a migrated thread and some comments may be shown as answers.
Paweł Polaczyk
Top achievements
Rank 1
Paweł Polaczyk asked on 17 Jan 2014, 01:49 PM
I just want to let you know about a bug that I found and I do not really see how to report a bug (and not a feature suggestion) in the issue tracker.

I have a RadTreeListView.
I want to click on an item on the list to expand it.
So that I implemented the following:

<t:RadTreeListView x:Name="radTreeListView" AutoGenerateColumns="False" SelectionChanging="radTreeListView_SelectionChanging">
 
    <t:RadTreeListView.ChildTableDefinitions>
        <t:TreeListViewTableDefinition ItemsSource="{Binding Children}" />
    </t:RadTreeListView.ChildTableDefinitions>
 
    <t:RadTreeListView.Columns>
        <t:GridViewDataColumn DataMemberBinding="{Binding Name}" Header="Name" IsReadOnly="True" >
            <t:GridViewDataColumn.CellTemplate>
                <DataTemplate>
                    <Label Content="{Binding Name}"></Label>
                </DataTemplate>
            </t:GridViewDataColumn.CellTemplate>
        </t:GridViewDataColumn>
    </t:RadTreeListView.Columns>
 
</t:RadTreeListView>

and a handler:

private void radTreeListView_SelectionChanging(object sender, SelectionChangingEventArgs e)
{
    var selectedItem = e.AddedItems.FirstOrDefault();
 
    e.Cancel = true;
 
    this.radTreeListView.ExpandHierarchyItem(selectedItem);
}

This causes an exception when I start the application (basically, when the selection is changing).

Removing e.Cancel = true line solves the issue, but well... if I want to cancel this event, then the app crashes.

1 Answer, 1 is accepted

Sort by
0
Vera
Telerik team
answered on 20 Jan 2014, 10:53 AM
Hello Paweł,

Thank you for the provided details. We were able to reproduce the problem and will investigate it further. We cannot commit to any specific date or release where the issue will be resolved since it turned out to be not a trivial one and just a check for null will not resolve it.

Please excuse us for the inconvenience caused. Your Telerik points have been updated accordingly.

Regards,
Vera
Telerik
TRY TELERIK'S NEWEST PRODUCT - EQATEC APPLICATION ANALYTICS for WPF.
Learn what features your users use (or don't use) in your application. Know your audience. Target it better. Develop wisely.
Sign up for Free application insights >>
Tags
TreeListView
Asked by
Paweł Polaczyk
Top achievements
Rank 1
Answers by
Vera
Telerik team
Share this question
or