Telerik Forums
UI for WPF Forum
1 answer
99 views
Hey again guys, i have another query regarding the TreeView control, at present i use the Tree View to display a list of people, but i have a custom control that displays its contents, but i use the drag and drop functionality of the Tree View, I also have a Contextual RIbbon Bar that is activated when an Item in the RadTreeView is Clicked...

The Problem i have is the control is only selected when a user clicks on the white space between button / Combo box's, clicking on the actual combo boxes, buttons doesnt actually select the TreeViewItem,

Is there any functionality to allow this to happen? as i would really love to keep using the TreeView.

See Below for my Code, Thanks in advance and look forward to your response!!
Kev.

Definition of my Tree View :
<telerikNavigation:RadTreeView HorizontalContentAlignment="Stretch" x:Name="uiActionersList" IsDragDropEnabled="True" DragEnded="uiActionersList_DragEnded"
                                                HorizontalAlignment="Stretch" SelectionMode="Multiple" ScrollViewer.HorizontalScrollBarVisibility="Hidden" dragDrop:RadDragAndDropManager.AllowDrop="True"
                                                                               IsDragPreviewEnabled="True"  IsDragTooltipEnabled="True" SelectionChanged="uiActionersList_SelectionChanged"
                                                ItemsSource="{Binding ActionerModelViewCollection, NotifyOnSourceUpdated=True, NotifyOnTargetUpdated=True,Mode=TwoWay}" Margin="0,0,-5,0" >
                                            <telerikNavigation:RadTreeView.ItemTemplate>
                                                <DataTemplate>
                                                    <pmControls:ActionerControl x:Name="ItemsHost" />
                                                </DataTemplate>
                                            </telerikNavigation:RadTreeView.ItemTemplate>
                                        </telerikNavigation:RadTreeView>


Definition of Actioner Control :

<Grid Background="White">
        <StackPanel>
            <Grid>
                <StackPanel Orientation="Horizontal" HorizontalAlignment="Left" Height="25" Margin="0">
                <telerikControls:RadButton Name="dragHandle" Height="24" Width="11" VerticalAlignment="Center" HorizontalAlignment="Left" Margin="0,0,3,0">
                    <telerikControls:RadButton.Content>
                        <Grid>
                            <Line X1="0" Y1="0" X2="3" Y2="0" Stroke="Black" StrokeThickness="1"></Line>
                                <Line X1="0" Y1="5" X2="3" Y2="5" Stroke="Black" StrokeThickness="1"></Line>
                                <Line X1="0" Y1="10" X2="3" Y2="10" Stroke="Black" StrokeThickness="1"></Line>
                        </Grid>
                    </telerikControls:RadButton.Content>
                </telerikControls:RadButton>
                    <Image Width="25" Height="25" Source="{Binding SelectedActioner, Converter={StaticResource ReturnImageBasedOnTypeConverter}, Mode=OneWay, UpdateSourceTrigger=PropertyChanged, NotifyOnTargetUpdated=True}">
                         
                    </Image>
                    <DockPanel Width="300" LastChildFill="True" Margin="3,1,0,0">
                        <StackPanel DockPanel.Dock="Right" Orientation="Horizontal" Name="uiCreationButtons" Visibility="{Binding HasGotThisJobOrGroup, Converter={StaticResource CollapsedOnTrueConverter}}">
                            <telerikControls:RadButton Content="New Group" Width="70" Margin="0,0,3,0" Padding="0" HorizontalAlignment="Right" Click="ActionerGroupButton_Click" />
                            <telerikControls:RadButton Content="New Job" Width="70" Margin="0" Padding="0" HorizontalAlignment="Right" Click="ActionerJobButton_Click"/>
                        </StackPanel>
                        <telerikControls:RadComboBox Name="uiActionerNamesComboBox" IsEditable="True"
                        IsReadOnly="False" Margin="0,0,3,0" ItemsSource="{Binding AllAgilityJobDocs}" SelectedValue="{Binding SelectedActioner, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged, NotifyOnTargetUpdated=True}"
                        KeyUp="uiActionerNamesComboBox_KeyUp"  telerikControls:TextSearch.TextPath="Title" HorizontalAlignment="Stretch" EmptyText="{Binding ThisActioner.Position, Converter={StaticResource EmptyActionerTextConverter}}">
                            <telerikControls:RadComboBox.FontWeight>
                                <MultiBinding Converter="{StaticResource ActionerBoldTextMultiBindingConverter}" Mode="OneWay">
                                    <Binding Path="SelectedActioner"/>
                                    <Binding Path="NewAgilityJobDocs"/>
                                </MultiBinding>
                            </telerikControls:RadComboBox.FontWeight>
                            <telerikControls:RadComboBox.ItemTemplate>
                                <DataTemplate>
                                    <StackPanel Orientation="Horizontal">
                                        <Image Height="16" Width="16">
                                            <Image.Style>
                                                <Style TargetType="Image">
                                                    <Style.Triggers>
                                                        <DataTrigger  Binding="{Binding ItemType}" Value="Job" >
                                                            <Setter Property="Source" Value="{StaticResource JobDocImage}"/>
                                                        </DataTrigger>
                                                        <DataTrigger Binding="{Binding ItemType}" Value="Group" >
                                                            <Setter Property="Source"  Value="{StaticResource GroupImage}"/>
                                                        </DataTrigger>
                                                    </Style.Triggers>
                                                </Style>
                                            </Image.Style>
                                        </Image>
                                        <TextBlock Text="{Binding Title}" FontWeight="Normal" VerticalAlignment="Center" Margin="5,0,0,0"/>
                                    </StackPanel>
                                </DataTemplate>
                            </telerikControls:RadComboBox.ItemTemplate>
 
                        </telerikControls:RadComboBox>
                    </DockPanel>
                    <Canvas Margin="4,0,0,0" Height="23" Width="23" Visibility="{Binding ActionerCount, Converter={StaticResource HiddenIfActionerDoesntExistConverter}, ConverterParameter=11}">
                        <Image Source="{StaticResource PMActionerRectangle}" Height="23" Width="23" Panel.ZIndex="100"/>
                        <Rectangle Height="21" Width="21" Margin="1,1,0,0" RadiusX="3" RadiusY="3" Panel.ZIndex="99">
                            <Rectangle.Fill>
                                <SolidColorBrush Color="{Binding SelectedColor, UpdateSourceTrigger=PropertyChanged,  Converter={StaticResource ColourConverter}}" />
                            </Rectangle.Fill>
                        </Rectangle>
                    </Canvas>
 
 
                </StackPanel>
            </Grid>
        </StackPanel>
    </Grid>

Petar Mladenov
Telerik team
 answered on 09 May 2011
2 answers
324 views
How can I disable the auto scroll feature of the RadGridView?

I'm using drag and drop between two gridviews that are stacked vertically. The user will NOT drag and drop rows within the gridviews (to reorder or something) so I do not want the gridviews to auto scroll when I'm dragging rows. It seems to be a built in feature though so I would like to disable it. Otherwise, whenever I drag a row from my upper gridview to the lower the upper one will scroll to the bottom.
haagel
Top achievements
Rank 1
 answered on 09 May 2011
8 answers
1.1K+ views
Hi

Is it possible to place the expander icon to the right of the header content?
And is it possible to make it expand only when you click on the icon?
I'm using it inside a treeview, and it overrides the double click of my treeview.

Oh and it looks likes it having problems when used together with a treeview.
When you expand the treeview node for the first time, it moves the child node to far down for a 1 sec, just to be moved back to its correct place.
I can make a small example of this, if you wish. 


EDIT

Spend some more time with it, and I figured out how to place the expander to the right and fixed the overriding problem.
Just used a StackPanel and placed my expander to the right of the rest of the content and made the expander header empty.
Though this solves some problemes, it introduces a new.

How I want it to look

What it look like now

What do I need to do, for the expanded context to be places under all my content, like shown in the first image?
Anders
Top achievements
Rank 2
 answered on 09 May 2011
3 answers
133 views
Hello.

I have a treeview like this:
A
    A1
    A2
    A3
B
    B1
    ...

Now I want to drag A2 before A1 but unfortunately I am not able to use drag & drop inside the same hierarchy level?!?!?
I always get that little red sign indicating that it is not allowed to drop something at this location. On the other hand I am able to drag B1 below A. I don't want this but that's a different story... :)  If I understood it right it should be possible by default to move all the elements around as one like to... Has anyone experienced the same problem? How can that happen? I am using the latest version of the RadTreeView.

Any help?
Thanks a lot!!!
Tim.
Tim Tos
Top achievements
Rank 1
 answered on 09 May 2011
1 answer
189 views
Hi,
Is there any way to make the datagrid behave like excel with regards the arrow keys (they are okay, except when I'm editing a cell) in edit mode if I press the down arrow it does not move to the same cell in next row.

Maya
Telerik team
 answered on 09 May 2011
1 answer
112 views
Hi All,

i am using Wpf 4.0 and PRISM for my dot net application (Visual Studio 2010).

I have one requirement that I have to open a new screen (View) on the click of one of the items of context menu.
I have written the following code for it in my XAML :
<framework:RTPOGridView Grid.Row="1"
         x:Name="orderList" Margin="7,0,7,0"
         VerticalAlignment="Stretch" ItemsSource="{Binding dailyload}" >
                 <telerik:RadContextMenu.ContextMenu>
  
                    <telerik:RadContextMenu x:Name="ViewErrorsContextMenu" IsEnabled="True" >
                        <telerik:RadContextMenu.Items>
                        <telerik:RadMenuItem Header="View Errors" x:Name="itemViewErrors" IsEnabled="True" Command="{Binding Path=ViewErrorsCommand}" >
                                  
                            </telerik:RadMenuItem>
                       </telerik:RadContextMenu.Items>
                    </telerik:RadContextMenu>
  
  
                </telerik:RadContextMenu.ContextMenu>
  
  
            <framework:RTPOGridView.Columns>
                <telerik:GridViewDataColumn  Header="Customer" DataMemberBinding="{Binding CustomerPerson}" Width="*" />
                <telerik:GridViewDataColumn  Header="Product" DataMemberBinding="{Binding Product}" Width="*" />
                        </framework:RTPOGridView>

 

 

and the code which i wrote for it in View Model is as follows.

public void OnViewErrorsCommand(object sender, RoutedEventArgs e)
        {
            _dialogController.ShowDialog(_moduleController, ApplicationConstants.OrdersViewNames.ViewErrors);         
  
        }
Where "ViewErrors" is my new screen need to be opened on the click of the context menu.

kindly let me know the solution.

Thanks in advance !!!!!!!
George
Telerik team
 answered on 09 May 2011
1 answer
348 views
Hi,

I seem to have a small problem when data binding a RadGridView Control with a Data Table via a Boolean Converter. The scenario is as follows .... I have  a DataTable of which one of the columns is of type Boolean. I would like to convert the True value to YES and False to NO. When I bind the DataColumn of the grid via a Converter class, no value is displayed. However, when I click on the filter icon of the column I can filter by YES and NO. I have gone through the forums and documentation and applied the solutions to similar problems with no success.

Converter Class
    [ValueConversion(typeof(Boolean), typeof(String))]
   class IsWhiteAreaConverter : IValueConverter
   {
       public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
       {
           return (bool)value ? "Yes" : "No";
       }
 
       public object ConvertBack(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
       {
           if ((string)value == "Yes")
           {
               return true;
           }
           else
           {
               return false;
           }
       }
   }

XAML
  <Grid.Resources>
            <my:IsWhiteAreaConverter x:Key="isWhiteAreaConverter" />
        </Grid.Resources>
 
 
 
 <telerik:RadGridView Grid.Column="0" Grid.Row="0" Grid.ColumnSpan="2" Name="rgvPlan" ItemsSource="{Binding}" AutoGenerateColumns="False">

      <telerik:GridViewDataColumn Header="HalfLevel" DataMemberBinding="{Binding HalfLevelName}" />
<telerik:GridViewDataColumn Header="Is White Area" DataMemberBinding="{Binding IsWhiteArea, Converter={StaticResource isWhiteAreaConverter}}">
      <telerik:GridViewDataColumn.CellTemplate>
             <DataTemplate>
                      <TextBlock Text="{Binding IsWhiteArea, Converter={StaticResource isWhiteAreaConverter}, Mode=Default}" Foreground="AliceBlue" />
             </DataTemplate>
      </telerik:GridViewDataColumn.CellTemplate>
      <telerik:GridViewDataColumn.CellEditTemplate>
              <DataTemplate>
                     <TextBox Text="{Binding IsWhiteArea, Converter={StaticResource isWhiteAreaConverter}}" />
              </DataTemplate>
      </telerik:GridViewDataColumn.CellEditTemplate>
</telerik:GridViewDataColumn>
Ivan Ivanov
Telerik team
 answered on 09 May 2011
6 answers
266 views
When NumbricUpDown is on focus or button be clicked, the border colour will change to organe by default. Is there anyway I can turn the colour changing off?

Thanks

Jing
Jing
Top achievements
Rank 1
 answered on 09 May 2011
10 answers
167 views

Hi,

    We are using Prism, MVVM and rad docking.  I have two Panes (Pane1 and Pane2) as modules injected at application startup ... each Pane displays some client information.  In a seperate Pane I have a tree view listing all clients.  When a client is selected the information in the Panes (Pane1 and Pane2) are updated.  The Panes, Pane1 and Pane2, are bound to seperate view models.  The view models implement the IPropertyChangedNotification interface.  The information on the Pane1 and Pane2 are updated until you change panes (ie.  the UI is updated with the new client information on Pane1 ... and continues to be updated on Pane2 as you scroll through the list of clients but when you switch back to Pane1 the UI no longer updates ... similarly if you revisit Pane 2 ... the UI is no longer updating.)

Stepping through the debugger we noticed that in the FirePropertyChanged event below PropertyChanged was now null (it wasn't originally when the UI was being updated).  Am I doing something incorrectly here or is this a problem with the control.


 

 

 

    public class SelectedClientViewModel : PropertyChangedImplementation
    {
  
        public SelectedClientViewModel(IClientService clientService, IEventAggregator eventAggregator)
        {
            this._clientService = clientService;
  
            SelectedClientChangedEvent evt = eventAggregator.GetEvent<SelectedClientChangedEvent>();
            evt.Subscribe(OnSelectedClientChangedEvent);
        }
  
        public void OnSelectedClientChangedEvent(Client newClient)
        {
            _currentClient = newClient;
  
            FirePropertyChanged("name");
            FirePropertyChanged("address");
            FirePropertyChanged("city");
            FirePropertyChanged("country");
            FirePropertyChanged("telephone");
            FirePropertyChanged("province");
        }
  
...
  
  public class PropertyChangedImplementation : INotifyPropertyChanged
  {
    public event PropertyChangedEventHandler PropertyChanged;
  
    protected void FirePropertyChanged(string property)
    {
      if (PropertyChanged != null)
      {
        PropertyChanged(this, new PropertyChangedEventArgs(property));
      }
    }
  }

Thanks,
Randy

If you need additional info please let me know.

 

 

jagmohan
Top achievements
Rank 2
 answered on 08 May 2011
1 answer
138 views
I'm trying to store the values of the headers of dragged items into a generic list. It appears to be happening twice.

tvDirectoryDragStarted(object sender, RadTreeViewDragEndedEventArgs e)
{
     for(int i = 0;i<e.DraggedItems.Count;i++)
     {
            RadTreeViewItem item = (RadTreeViewItem)e.DraggedItems[i];
            _fileQueue.Items.Add(item.Header.ToString());
             
     }
 
}

_fileQueue is just a generic list I instantiate at runtime. The method is iterating through the dragged items twice though. I set a breakpoint and stepped through it, and it looks like the method is just firing twice. What could be the cause of this? I'm dragging the items into another RadTreeView, but I haven't wired any event handlers to it if that helps. 
Tina Stancheva
Telerik team
 answered on 06 May 2011
Narrow your results
Selected tags
Tags
+? more
Top users last month
Jay
Top achievements
Rank 3
Iron
Iron
Iron
Benjamin
Top achievements
Rank 3
Bronze
Iron
Veteran
Radek
Top achievements
Rank 2
Iron
Iron
Iron
Bohdan
Top achievements
Rank 2
Iron
Iron
Richard
Top achievements
Rank 4
Bronze
Bronze
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Jay
Top achievements
Rank 3
Iron
Iron
Iron
Benjamin
Top achievements
Rank 3
Bronze
Iron
Veteran
Radek
Top achievements
Rank 2
Iron
Iron
Iron
Bohdan
Top achievements
Rank 2
Iron
Iron
Richard
Top achievements
Rank 4
Bronze
Bronze
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?