Telerik Forums
UI for WPF Forum
3 answers
120 views

  <telerik:RadTreeListView.ChildTableDefinitions>
                <telerik:TreeListViewTableDefinition ItemsSource="{Binding Children}" />
            </telerik:RadTreeListView.ChildTableDefinitions>
            <telerik:RadTreeListView.Columns>
                <telerik:GridViewDataColumn DataMemberBinding="{Binding Path=Item.Name}" Header="Name" SortMemberPath="Item.Name" DataType="{x:Type sys:String}"  />

            </telerik:RadTreeListView.Columns>

    public class Node
    { 
        public object Item { get; set; }

        //public WarehouseItem Item { get; set; } this line works fine

        public ObservableCollection<Node> Children { get; set; } = new ObservableCollection<Node>();
    }

 

If my Node.Item is object or dynamic type, sorting and filtering do not work, if it is a specific entity type like WarehouseItem they works fine.

The same thing happens to RadGridView.

Dilyan Traykov
Telerik team
 answered on 24 Feb 2021
3 answers
136 views

Hey

I'm trying to configure a TreeListView to select the full row of childless rows when I use the arrow keys for navigation, curiously I checked the demo and it has the behaviour I'm trying to achieve! However I have looked at the demo code and can't spot how it's achieving it, which makes me think it's the default behaviour?

When I use the arrow keys on our TreeListView, it selects the cell of childless nodes rather than the whole row, see attached gif

Many thanks

Dilyan Traykov
Telerik team
 answered on 30 Nov 2020
2 answers
410 views

When the user drags an item to the top or bottom of the TreeListView, I'd like to scroll automatically, to handle the case where the user wants to drag to an item that isn't currently in view. I have a small sample program I can provide you, and OnDragOver is shown below. Can you tell me how to detect that the drag has reached the top or bottom of the view and then scroll as needed?

Thanks,

Georg Hentsch

        private void OnDragOver(object sender, Telerik.Windows.DragDrop.DragEventArgs e) {
            var dropTarget = e.OriginalSource as TreeListViewRow ?? (e.OriginalSource as FrameworkElement).ParentOfType<TreeListViewRow>();
            var details = DragDropPayloadManager.GetDataFromObject(e.Data, "DropDetails") as DropIndicationDetails;

            if (dropTarget == null || details == null) {
                return;
            }

            details.CurrentDraggedOverItem = dropTarget.DataContext;

            if (details.CurrentDraggedItem == details.CurrentDraggedOverItem) {
                e.Effects = DragDropEffects.None;
                e.Handled = true;
                return;
            }

            details.CurrentDropPosition = GetDropPositionFromPoint(e.GetPosition(dropTarget), dropTarget);

            if (IsChildOf(dropTarget, sourceItem)) {
                e.Effects = DragDropEffects.None; // don't allow item to be dropped to one of its own children
            }

            e.Handled = true;
        }

 

Georg
Top achievements
Rank 1
Veteran
 answered on 12 Sep 2020
2 answers
47 views

Is it possible to change the background of the selected TreeListView HeaderCell? Customers complain that the solid background of the currently sorted column can be distracting.

We would prefer a white background with a thick underline as in the screenshot. We already tried changing the style of GridViewHeaderCell, but unfortunately, this doesn't apply to the sorted/selected column.

 

Is there a way to achieve this without duplicating the entire template?

 

Best Regards,

Martin

Dinko | Tech Support Engineer
Telerik team
 answered on 01 May 2020
9 answers
119 views

Hi,

I'm binding the ItemSource with ListCollectionView ....I noted that changing the selection on TreeListView the CurrentItem is not updated. Also the MoveCurrentTo method doesn't work. I use the some procedure with RadGridView and works fine!

How I can resolve this issue?

 

Dilyan Traykov
Telerik team
 answered on 20 Nov 2019
2 answers
186 views

Is possible add a custom sort for children? Or sort just parents?

Omar
Top achievements
Rank 1
 answered on 28 Oct 2019
12 answers
265 views

Hi Telerik,

 

I'm using the following RadTreeListView :

<telerik:RadTreeListView AutoGenerateColumns="False" ItemsSource="{Binding SelectionDetails}" CanUserResizeRows="True" CanUserDeleteRows="False" CanUserReorderColumns="True"ReorderColumnsMode="ReorderColumns" VerticalAlignment="Stretch" ColumnWidth="Auto" GroupRenderMode="Flat" GridLinesVisibility="Both" SelectionMode="Multiple" SelectionUnit="FullRow" FontSize="{StaticResource FontSizeText}" IsReadOnly="{Binding IsReadOnlyMode}" x:Name="rtlvDetails"
                                 AutoExpandItems="True" ValidatesOnDataErrors="InViewMode" ValidationType="None"
                                 SelectionChanged="rtlvDetails_SelectionChanged" EditTriggers="Default" ClipboardPasteMode="AllSelectedCells"
                                 CanUserSelect="False" FrozenColumnCount="3" CellValidating="rtlvDetails_CellValidating" Grid.Row="1" CanUserFreezeColumns="False" IsSynchronizedWithCurrentItem="False"/>

 

I try to implement the copy (from Excel) / paste (to the grid) like I've implemented in another RadGridView :

<telerik:RadGridView Margin="5" HorizontalAlignment="Stretch" AutoGenerateColumns="False" ShowGroupPanel="False" RowIndicatorVisibility="Collapsed"
                                         CanUserFreezeColumns="False" CanUserReorderColumns="False" ItemsSource="{Binding LocalGapTolerances}" IsFilteringAllowed="True"
                                         x:Name="rgvTolerances" Style="{StaticResource StyleRadGridView}" HeaderRowStyle="{StaticResource StyleHeaderRowRadGridView}" SelectionMode="Single"
                                         SelectionUnit="Cell" ClipboardPasteMode="AllSelectedCells" Grid.Row="1" VerticalAlignment="Stretch"/>

 

But what ever I do about the paste mode properties, the 'Ctrl+V' will never fires any event in my RadTreeListView.

I need to paste data from Excel in my grid respectings the Columns/Rows order.

 

Do you know why no event are fired ?

 

Thank you.

Valentin
Top achievements
Rank 1
Iron
Iron
 answered on 23 Oct 2019
1 answer
198 views

Hi Telerik,

 

I'mu using a base class with all proerties which are overridable :

Public Class SelectionDetailItemViewModel
        Inherits ViewModelBase
 
        Public Overridable Property Children As New ObservableCollection(Of SelectionDetailItemViewModel)
        Public Overridable Property Reference As String
        Public Overridable Property Name As String
 
        'Other properties .....

 

I have 2 classes A & B which inherit of SelectionDetailItemViewModelA class has children of type of A & B.

The ItemSource is bound to a ObservableCollection(Of SelectionDetailItemViewModel). For each column, the filter panel has all column values but select a value doesn't filter the RadTreeListView. There the following error :

System.Windows.Data Error: 8 : Cannot save value from target back to source. BindingExpression:Path=IsActive; DataItem='DistinctValueViewModel' (HashCode=63240628); target element is 'CheckBox' (Name=''); target property is 'IsChecked' (type 'Nullable`1') ArgumentException:'System.ArgumentException: La valeur "((Name IsEqualTo er 2d2 MC)) AND ((Name IsEqualTo <Unset>) AND (Name IsEqualTo <Unset>))" n'est pas de type "Telerik.Windows.Data.IFilterDescriptor" et ne peut pas être utilisée dans cette collection générique.
Nom du paramètre : value
   Ã  System.ThrowHelper.ThrowWrongValueTypeArgumentException(Object value, Type targetType)
   Ã  System.Collections.ObjectModel.Collection`1.System.Collections.IList.Insert(Int32 index, Object value)
   Ã  Telerik.Windows.Data.CollectionHelper.Insert(IList target, IEnumerable newItems, Int32 startingIndex, IEqualityComparer itemComparer)
   Ã  Telerik.Windows.Data.ObservableCollectionManager.HandleCollectionChanged(IList sender, NotifyCollectionChangedEventArgs args)
   Ã  Telerik.Windows.Data.ObservableCollectionManager.Telerik.Windows.Data.IWeakEventListener<System.Collections.Specialized.NotifyCollectionChangedEventArgs>.ReceiveWeakEvent(Object sender, NotifyCollectionChangedEventArgs args)
   Ã  Telerik.Windows.Data.WeakEvent.WeakListener`1.Handler(Object sender, TArgs args)
   Ã  System.Collections.Specialized.NotifyCollectionChangedEventHandler.Invoke(Object sender, NotifyCollectionChangedEventArgs e)
   Ã  System.Collections.ObjectModel.ObservableCollection`1.OnCollectionChanged(NotifyCollectionChangedEventArgs e)
   Ã  Telerik.Windows.Data.RadObservableCollection`1.OnCollectionChanged(NotifyCollectionChangedEventArgs e)
   Ã  Telerik.Windows.Data.ObservableItemCollection`1.OnCollectionChanged(NotifyCollectionChangedEventArgs e)
   Ã  System.Collections.ObjectModel.ObservableCollection`1.InsertItem(Int32 index, T item)
   Ã  Telerik.Windows.Data.RadObservableCollection`1.InsertItem(Int32 index, T item)
   Ã  Telerik.Windows.Data.FilterDescriptorCollection.InsertItem(Int32 index, IFilterDescriptor item)
   Ã  System.Collections.ObjectModel.Collection`1.Add(T item)
   Ã  Telerik.Windows.Controls.GridViewColumn.OnColumnFilterDescriptorPropertyChanged(Object sender, PropertyChangedEventArgs e)
   Ã  Telerik.Windows.Data.DescriptorBase.OnPropertyChanged(PropertyChangedEventArgs args)
   Ã  Telerik.Windows.Data.DescriptorBase.OnPropertyChanged(String propertyName)
   Ã  Telerik.Windows.Data.DescriptorBase.ResumeNotifications()
   Ã  Telerik.Windows.Controls.GridView.FilteringViewModel.ApplyFilters()
   Ã  Telerik.Windows.Controls.GridView.FilteringViewModel.OnDistinctValuesChanged()
   Ã  Telerik.Windows.Controls.GridView.FilteringViewModel.OnDistinctValuesItemChanged(Object sender, ItemChangedEventArgs`1 e)
   Ã  Telerik.Windows.Data.ObservableItemCollection`1.RaiseGenericItemChanged(ItemChangedEventArgs`1 e)
   Ã  Telerik.Windows.Data.ObservableItemCollection`1.OnItemChanged(ItemChangedEventArgs`1 e)
   Ã  Telerik.Windows.Data.ObservableItemCollection`1.Telerik.Windows.Data.IWeakEventListener<System.ComponentModel.PropertyChangedEventArgs>.ReceiveWeakEvent(Object sender, PropertyChangedEventArgs args)
   Ã  Telerik.Windows.Data.WeakEvent.WeakListener`1.Handler(Object sender, TArgs args)
   Ã  System.ComponentModel.PropertyChangedEventHandler.Invoke(Object sender, PropertyChangedEventArgs e)
   Ã  Telerik.Windows.Controls.ViewModelBase.OnPropertyChanged(String propertyName)
   Ã  Telerik.Windows.Controls.GridView.DistinctValueViewModel.set_IsActive(Boolean value)'

 

Have you got any idea ?

Thanky you.

Martin Ivanov
Telerik team
 answered on 04 Oct 2019
3 answers
404 views

Hello

We are facing the challenge, to present tasks to our customers.
Each task can consist out of n tasks, but can also stand alone. These child-tasks should be displayed in a hierarchical manner and must be searchable (down to the tree-leaves).

Now we have been wondering if it's easier to build a hierarchy in a GridView, where the Search is implemented, or use the TreeListView, which meets our hierarchical needs.
Since the hierarchical GridView creates new Grids for each hierarchy-level, it seems quiet challenging for me, too.

For the TreeView, you are providing an search-example:
https://docs.telerik.com/devtools/wpf/controls/radtreeview/how-to/implement-search-filter-sort
can this be adopted for the TreeListView?
I'm also wondering, if the search-box from GridView is accessible somehow in the TreeListView somehow.

So our main-concern is, which control is the way to go?

We are grateful for any advice you can give us.

Best Regards

Nico

Dinko | Tech Support Engineer
Telerik team
 answered on 18 Sep 2019
6 answers
434 views
Hello everyone,

We are having issues with vertical scroll when collapse/expand items in the TreeListView. Scroll starts to jump if we change style for GridViewCell:

<Style x:Key="CellStyle" TargetType="telerik:GridViewCell">
    <Setter Property="MinHeight" Value="50"/>
</Style>

XAML for TreeListView:
<telerik:RadTreeListView x:Name="radTreeListView2"
            AutoGenerateColumns="False"
            Height="450"
            Width="400"
            BorderBrush="Black"
            BorderThickness="5"
            AutoExpandItems="True"
            ScrollViewer.HorizontalScrollBarVisibility="Visible"
            ScrollViewer.VerticalScrollBarVisibility="Visible">
    <telerik:RadTreeListView.ChildTableDefinitions>
        <telerik:TreeListViewTableDefinition ItemsSource="{Binding Items}" />
    </telerik:RadTreeListView.ChildTableDefinitions>
  
    <telerik:RadTreeListView.Columns>
        <telerik:GridViewDataColumn Header="Name" DataMemberBinding="{Binding Name}"/>
        <telerik:GridViewDataColumn Header="Count" DataMemberBinding="{Binding Count}"/>
    </telerik:RadTreeListView.Columns>
</telerik:RadTreeListView>


Steps to reproduce:
 1. TreeListView should contain enough items, so scroll showed up
 2. Scroll down to the middle or to the end
 3.Collapse/Expand any item
    AR: Scroll jumps to top (or to the middle)
    ER: Scroll stays on the same place, so we can see collapsed/expanded item

Scroll is jumping even if we just put some content in CellTemplate:

<telerik:RadTreeListView.Columns>
    <telerik:GridViewDataColumn Header="Name" DataMemberBinding="{Binding Name}"/>
    <telerik:GridViewDataColumn Header="Count" DataMemberBinding="{Binding Count}">
        <telerik:GridViewDataColumn.CellTemplate>
            <DataTemplate>
                <Border Height="50" Width="200" Background="LightGreen"/>
            </DataTemplate>
        </telerik:GridViewDataColumn.CellTemplate>
    </telerik:GridViewDataColumn>
</telerik:RadTreeListView.Columns>


Please advice.
Dilyan Traykov
Telerik team
 answered on 27 Aug 2019
Narrow your results
Selected tags
Tags
+? more
Top users last month
Patrick
Top achievements
Rank 1
Iron
Iron
Iron
MIS
Top achievements
Rank 1
Ross
Top achievements
Rank 1
Marcin
Top achievements
Rank 1
Iron
Iron
Sean
Top achievements
Rank 2
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Patrick
Top achievements
Rank 1
Iron
Iron
Iron
MIS
Top achievements
Rank 1
Ross
Top achievements
Rank 1
Marcin
Top achievements
Rank 1
Iron
Iron
Sean
Top achievements
Rank 2
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?