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 |
} |
"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(); |
}); |
} |
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?
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)
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);
}
}
}
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
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,
CalebHello 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
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.
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.