Hi,
Given a RadTreeViewItem, I want to expand all if it's descendants. I receive the first RadTreeViewItem via an attached behavior:
private void OnLoaded(object sender, RoutedEventArgs e)
{
RadTreeViewItem tvi = AssociatedObject;
after doing some checks I call tvi.IsExpanded = True and tvi.IsSelected = True;
This gets my tree opened up to the desired node. Now I want to expand all of it's children so the user doesn't have to open up each branch by hand.
01.
private void ExpandChildren(RadTreeViewItem tvItem)
02.
{
03.
04.
//var container = tvItem.ItemContainerGenerator.IndexFromContainer();
05.
var tvi = tvItem;
06.
foreach (RadTreeViewItem item in tvi.Items)
07.
{
08.
var kid = tvi.ParentTreeView.ContainerFromItemRecursive(item);
09.
kid.IsExpanded = true;
10.
if (kid.HasItems)
11.
ExpandChildren(kid);
12.
}
13.
}
However, this function blows up on line 6 complaining that the item cannot be converted from the value (in my case an app specific class) type to a RadTreeViewItem. I tried using ContainerFromItemRecursive, but it always seems to return null. How to convert a tvi.Items[n] to a RadTreeViewItem that I can mark IsExpanded = true?
This seems like this shouldn't be that hard.
Can someone please point me in the right direction?
Thanks ... Ed
Hi,
I am trying to implement a button in RadGridView column but when clicking the cutton, nothing happens. Here is the actual code:
<telerik:GridViewColumn
Width="Auto">
<telerik:GridViewColumn.CellTemplate>
<DataTemplate>
<telerik:RadButton Content="Content"
Command="{Binding myCommand}">
<telerik:RadButton.Style>
<Style TargetType="{x:Type telerik:RadButton}">
<Style.Setters>
<Setter Property="Visibility" Value="Hidden"/>
</Style.Setters>
<Style.Triggers>
<DataTrigger Binding="{Binding Flag_ID}" Value="FlagStatus">
<Setter Property="Visibility" Value="Visible"/>
</DataTrigger>
</Style.Triggers>
</Style>
</telerik:RadButton.Style>
</telerik:RadButton>
</DataTemplate>
</telerik:GridViewColumn.CellTemplate>
</telerik:GridViewColumn>
Hi,
We want to use the RadMap as an instrument to display large images from hard disk by using a custom tiled map provider. Data and tile access works (using GetCachedTile and a Stream), but we have problems to adapt the coordinates.
We'd like to have a clean way (without using code behind), adhering to the MVVM pattern, to somehow extract map coordinates at Mouse Move events.
How can we bind or access locations?
Do you have some ideas how to translate geo coordinates to 2D coordinates (best would be in pixels X/Y from map boarder / tile 0/0)?
Could we avoid geo coordinates in general?
The most important feature for us is a smooth display of tiled image data - is there a different rad control which would facilitate this?
Whenever I save a docked out (floating) Dock Window using SaveToXml(), and then load it back.
After loading using LoadFromXml() my docked out (floating) dock Window gets converted into a Tool window.
Kindly suggest a solution for this problem.
Hello
do you have a Textbox with clear button (like the search textbox in ShowSearchPanel)?
I can build my own, but for me it is a basic control, so i'm suprise that i find nothing by Telerik.
Thank you
Hello
The ItemSource of my RadGridView is binded to a QueryableCollectionView in my ViewModel.
<
telerik:RadGridView
x:Name
=
"radGridView"
GroupRenderMode
=
"Nested"
ItemsSource
=
"{Binding MyView, UpdateSourceTrigger=PropertyChanged}"
AutoGenerateColumns
=
"False"
ShowGroupPanel
=
"True"
RowIndicatorVisibility
=
"Collapsed"
IsReadOnly
=
"True"
ShowSearchPanel
=
"True"
>
<
telerik:RadGridView.Columns
>
...
</
telerik:RadGridView.Columns
>
</
telerik:RadGridView
>
I use Items.ItemCount to show the Count of Items in the RadGridView. It works great, also when I filter the GridView. However when I use grouping, it works not correctly. It counts the groups instead of Items.
<
TextBlock
Grid.Row
=
"0"
Grid.Column
=
"1"
Text
=
"{Binding Items.ItemCount, ElementName=radGridView}"
TextAlignment
=
"Right"
/>
How can I get around this problem? I do not want to use the AggregateFunctions.
Thank you.
Hello Telerik,
I have to implement an application which basically works in the same way of your ScheduleView demo called "ScheduleView and TimeBar" (TimeBar minimap for ScheduleView). So: I want a grouped timeline view with appointments, a larger range of this data previewed in the TimeBar above, and I also need the ability to add, edit, delete and drag-and-drop appointments as well.
The only thing is that I want my timeview to work scaled to seconds. This means I need to be able to create and manage appointments with a duration of some second (e.g. 5 or 10 seconds) and to keep the view "zoomed" to see these small details (e.g. I must be able to have the view set to see 1 minute in the planner, split into 60 seconds). Unfortunately I am not succeeding in this because I'm experiencing some difficulty working with TimelineViewDefinition's VisibleDays, MinTimeRulerExtent, MinorTickLength and MajorTickLength.
Can you please suggest a valid approach to achieve my implementation? And if ScheduleView is not the best option, can you suggest me a valid one (I tried RadTimeline and it seems effective, but there are no add, edit, delete and drag-and-drop behaviors at all)?
Thank you
Hi,
I am investigating a behavior where my client reports being in MouseTool.PanTool, and seeing links being created out of nothing towards an existing box.
The only way I have been able to reproduce this was to explicitly switch to the Connector tool; however, our application does not normally expose this tool.
Is there a mouse of keyboard shortcut, or a sequence of operations that would allow creating source-less connectors while the active tool is Pan ?
Regards,
-Raphaël