Telerik Forums
UI for Silverlight Forum
5 answers
168 views
When I only have 1 row under certain conditions, I want to expand the row and show second level load on demand items (not 3rd or deeper).

I have populated my child collection in the ViewModel and have TwoWay binding set, but there must be another trick to getting the TreeListView to expand the row.

Any suggestions are appreciated.

-Rob
Martin Ivanov
Telerik team
 answered on 18 Jun 2019
10 answers
244 views
Hi, I saw this thread in WPF forum, I have the same problem with RadTreeListView in Silverlight.

"Hi. I'm generating a RadTreeView and its items through Silverlight data binding using a HierarchicalDataTemplate. So when I add a new item to the collection the RadTreeView is looking at, and I set the selected item to that newly added object, I try to get the selected container, but it's null. This is my code:

private void OnAddFolderClicked(object sender, RoutedEventArgs e) 
        { 
            IFolderContainer container = (sender as MenuItem).DataContext as IFolderContainer ?? null

            Folder folder = new Folder() { Name = "Folder" }; 
 
            container.AddFolder(folder); 
 
            treeViewExplorer.SelectedItem = folder; 
 
            folder.IsNodeInEditMode = true
 
            RadTreeViewItem selectedItem = treeViewExplorer.SelectedContainer; // this is null even though I set the SelectedItem = folder
        } 

What I want to do is to set focus on it, so if the user clicks F2 right away after creating it, it can go into edit mode, right now the object looks selected, but hitting F2 doesn't do anything unless deselect it, and select it again."

Here is your suggestions:

"The problem is that when you want to get the SelectedContainer the container is still not generated, because of the async nature of process when you add new item.

You need to put the code for getting the selected container in a 
Dispatcher call, so that the container is already generated when you try to get it."

I have tried to put my BeginEdit in a Dispatcher call, but the container is still null. SelectedItem is bound to an object in my ViewModel which is not null.   

private void NewValueAdded(object sender, EventArgs e)  
{  
   Dispatcher.BeginInvoke(()=>  
   {  
      TreeList.SelectedContainer.BeginEdit();  
   });  

 


Thanks,
VH
Vladimir Stoyanov
Telerik team
 answered on 18 Dec 2018
9 answers
164 views

How can I Groupby in TreeListView?

I got a collection with items and want to group it by column propertyName in a TreeListView.

How can I achieve this? 

Dinko | Tech Support Engineer
Telerik team
 answered on 05 Dec 2018
1 answer
34 views

We have a problem when we resize columns in GridViewHeaderCell. . I paste the stack trace below. I see that IsValidResizableCell method is throwing exception under OnColumnHeaderResize method. Is there a way to handle this error?

We are using telerik version 2016 (Q2 version)

SilverlightError:  Unhandled Error in Silverlight Application 
   
Category: ManagedRuntimeError       
Message: System.NullReferenceException: Object reference not set to an instance of an object. 
   at Telerik.Windows.Controls.GridView.GridViewHeaderCell.IsValidResizableCell(Object gripper) 
   at Telerik.Windows.Controls.GridView.GridViewHeaderCell.OnColumnHeaderResize(Object sender, DragDeltaEventArgs e) 
   at System.Windows.Controls.Primitives.Thumb.OnMouseMove(MouseEventArgs e) 
   at System.Windows.Controls.Control.OnMouseMove(Control ctrl, EventArgs e) 
   at MS.Internal.JoltHelper.FireEvent(IntPtr unmanagedObj, IntPtr unmanagedObjArgs, Int32 argsTypeIndex, Int32 actualArgsTypeIndex, String eventName, UInt32 flags)

We started getting this error after modifying the control template for GridViewHeaderRow. We had a business requirement to apply different border colour and different border thickness to Grid Headers. i am attaching the file for your reference.

Refer to style 'GridViewHeaderCell_RightAlignWithPrintMarginIndicator'  and 'GridViewHeaderCell_LeftAlignWithPrintMarginIndicator' . The changes done to control template is replace the border defined under PART_HeaderCellGrid.

Rename the attached file (remove the Jpeg extension)

 

 

 

Dilyan Traykov
Telerik team
 answered on 26 Jun 2017
6 answers
148 views

TreeListView set selected child item mvvm

SelectedItem="{Binding}" work only for a first level(parent nodes), not for a child.

I am familiar with "SelectionChanged" event, but I want to not use. Can you provaid information for MVVM Selected Item for ChildTableDefinitions.

If select first level SelectedService property work, if select some of child setter of property not work.

XAML:

<telerik:RadTreeListView ItemsSource="{Binding Services, Mode=TwoWay}" SelectedItem="{Binding Path=SelectedService, Mode=TwoWay}" SelectionMode="Single" >
<telerik:RadTreeListView.ChildTableDefinitions>
<telerik:TreeListViewTableDefinition ItemsSource="{Binding Details}" />
</telerik:RadTreeListView.ChildTableDefinitions>
<telerik:RadTreeListView.Columns>
<telerik:GridViewDataColumn Header="Status" Width="Auto" IsReadOnly="True">
<telerik:GridViewDataColumn.CellTemplate>
<DataTemplate>
<StackPanel Orientation="Horizontal">
<Ellipse Fill="{Binding StrokeHex, Converter={StaticResource HexToSolidColorBrushConverter}, Mode=TwoWay}" Stroke="Black" Width="24" Height="24" />
</StackPanel>
</DataTemplate>
</telerik:GridViewDataColumn.CellTemplate>
</telerik:GridViewDataColumn>
</telerik:RadTreeListView.Columns>
</telerik:RadTreeListView>

VIEWMODEL:

[Display(AutoGenerateField = false)]
public ObservaryModel SelectedService
{
get { return _selectedService; }
set
{
if (_selectedService != value)
{
_selectedService = value;
RaisePropertyChanged(() => SelectedService);
}
}
}
See Attach image - have two node and x2 childs.

---MODEL--
public class ObservaryModel : ServiceModel
    {
        private IList<ServiceModel> _details = new List<ServiceModel>();
         
        [Display(AutoGenerateField = false)]
        public IList<ServiceModel> Details
        {
            get { return _details; }
            set { _details = value; }
        }
 
        public ObservaryModel(){}
    }

 

 

 

--IMAGE attached--

 

http://www.telerik.com/ClientsFiles/436900_selected-child.PNG


Stefan
Telerik team
 answered on 06 Mar 2017
8 answers
90 views

Hello there,

 

I've got the Telerik Silverlight UI tools version 2016.2.613.1050 - I've got a problem with the results of a drag and drop event for a RadTreeListView control.  The drag and drop works correctly, the various observable collections have an entity removed and added as needed.  The problem is the indent level of the dropped row.  The indent level is not updating when the entity is moving between folders.  So if I move an entity that as an indent level of 0 to a folder that has an indent level of 3 the result is the row is correctly displayed in the folder with the incorrect indent level.  The indent level is correctly drawn when the folder is collapsed and expanded again or scrolling causes the screen to redraw the row.  How can I get the indent level to set correctly here?  I'm adding the row by updating the appropriate observable collection.  So I'm not doing anything with the visual layer.

Cheers,

Caleb
caleb
Top achievements
Rank 1
 answered on 29 Nov 2016
3 answers
99 views

Hello there,

I've got version 2016.2.613.1050 of the Telerik Silverlight controls.  I've got a RadTreeListView

<telerik:RadTreeListView
    x:Name="GridView"
    DataLoadMode="Asynchronous"
    IsExpandableBinding="{Binding IsFolder}"
    AutoExpandItems="False"
    AutoExpandGroups="False"
    AutoLoadHierarchy="False"
    RowIsExpandedChanged="GridView_OnRowIsExpandedChanged"
    BorderThickness="0"
    VerticalAlignment="Top"
    ScrollViewer.VerticalScrollBarVisibility="Visible"
    ScrollViewer.HorizontalScrollBarVisibility="Disabled"
    Sorted="GridView_OnSorted"
    Width="{Binding Source={StaticResource VAR}, Path=ViewAreaWidthInside}"
    Height="{Binding Source={StaticResource VAR}, Path=ViewAreaHeightWithOffset}"
    CanUserFreezeColumns="False"
    IsReadOnly="False"
    RowIndicatorVisibility="Collapsed"
    Background="{Binding Source={StaticResource VAR-New},Path=VAR}"
    VirtualizingStackPanel.VirtualizationMode="Recycling"
    AutoGenerateColumns="False"
    engine:TreeViewDragDropBehavior.IsEnabled="True"
    IsDragDropEnabled="True"
    IsDragTooltipEnabled="False"
    CanUserDeleteRows="False"
    DragCueItemTemplate="{StaticResource FirstColumnCellTemplate}"
    Style="{StaticResource RadTreeListViewStyle1}"
    CellEditEnded="GridView_OnCellEditEnded"
    EnableColumnVirtualization="True"
    EnableRowVirtualization="True"
    MouseRightButtonDown="GridView_OnMouseRightButtonDown"
    Loaded="GridView_OnLoaded"
    Unloaded="GridView_OnUnLoaded"
>
<telerik:RadTreeListView.ChildTableDefinitions>
    <telerik:TreeListViewTableDefinition
    ItemsSource="{Binding Items}"
/>
</telerik:RadTreeListView.ChildTableDefinitions>
</telerik:RadTreeListView>

So I would assume that the expander rows would not auto expand.  However when I run this code that's exactly what happens.  The auto expanders appear to be ignoring the false property and expanding. 

How do I get this to work?  What I want to happen is each expander row to stay closed and expand as the user selects them.  I reviewed the .xaml.cs and there's no code there that is setting the expander property.

Cheers,

 

Caleb

caleb
Top achievements
Rank 1
 answered on 05 Oct 2016
1 answer
118 views

Hi,

I am new to silver-light and Telerik Rad controls, i have a scenario to display data in the form of tree hierarchy, this data hierarchy contains only two levels(Parents and Child's), but i want to display Parents and Child's in different style(see below sample or attachment), please help me to achieve this.

Data Hierarchy

Name     Option 1     Option 2      Option 3
Parent-1
   Child-1     1                  2                 3
   Child-2     1                  2                 3 
   Child-3     1                  2                 3 
   Child-4     1                  2                 3 
   Child-5     1                  2                 3 
Parent-2
   Child-6     1                  2                 3  
   Child-7     1                  2                 3  
   Child-8     1                  2                 3  
   Child-9     1                  2                 3  
   Child-10   1                  2                 3  

My advance thanks for your responses.

Thanks,
Kalaivanan.

Dilyan Traykov
Telerik team
 answered on 06 Apr 2016
14 answers
128 views
Howdy,

Is there any way to change the horizontal white space (indent) for nested rows? It's a little to "wide" for my tastes; I'd like indentation of about half the width of the default for the control.

Cheers
Phil
james
Top achievements
Rank 1
 answered on 08 Mar 2016
2 answers
77 views

We are using Telerik Silverlight controls v2013.2.724.1050

When we navigate to the page first time control (RadTreeListView) load with column groups without any problem. Check Image attached.

After we navigate to another view and cause some action that should re-load grid data, this time data loads properly but without column groups.

What can we do to fix this issue?

We are loading group columns using code behind. Code snippet here ...

01.foreach (var headerColumn in gColumns)
02.        {
03.            _treeListView.ColumnGroups.Add(new GridViewColumnGroup()
04.            {
05.                Name = headerColumn.GroupName,
06.                Header = headerColumn.GroupHeader,
07.                HeaderTemplate = App.Current.Resources["GridViewColumnGroupHeaderTemplate"] as DataTemplate
08.            });
09.        }

I read this issue on forum and it mentioned that disabling EnableColumnGroupsVirtualization = false do the trick but I cant find that property anywhere even after including name space.

1.using Telerik.Windows.Controls.GridView;

Can someone look at this and suggest some solution ... If you need more info on this please let me know.

Ivan Ivanov
Telerik team
 answered on 22 Feb 2016
Top users last month
horváth
Top achievements
Rank 2
Iron
Iron
Steve
Top achievements
Rank 2
Iron
Erkki
Top achievements
Rank 1
Iron
Mark
Top achievements
Rank 2
Iron
Iron
Veteran
Jakub
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?