Telerik Forums
UI for WPF Forum
5 answers
104 views
Hi,

Can you give me and example of removing nodes from your RadTreeView as the code snippet below generates an error, at line 
  
Parent.Items.Remove(DirectCast(e.Source, TreeViewItem))   


 Private Sub trvListEvents_Edited(ByVal sender As ObjectByVal e As Telerik.Windows.Controls.RadTreeViewItemEditedEventArgs) Handles trvListEvents.Edited  
        If e.OldText <> e.NewText Then 
            ActionMenuRequest(DirectCast(e.Source, RadTreeViewItem))  
        Else 
            Dim Parent As RadTreeViewItem = Me.CurrentTreeViewItem.Parent  
            Parent.Items.Remove(DirectCast(e.Source, TreeViewItem))  
        End If 
 
    End Sub 

Requirements: After Editing a node, if it does not meet a certain criteria, then delete the node.

Note: I am using the RadTreeView with LoadOnDemand

Best

P

Dimitrina
Telerik team
 answered on 27 May 2009
3 answers
71 views

Hi,

I'm having a pre purchase test for RadGridView.

I try to develop a small test program with one grid on an xbap application.
Whenever I place a RadGridView control on my page (at design time), my visual studio 2008 start to work verry slow.
Every time I open a new file or trying to view a component properties, well, lets make it short, it happens no metter what i do, the window just gets stuck for 10-30 seconds and the cpu goas up to 100% until the command is performed.

Is there any way to make the conrol work faster at design time?

Thank you.

Vlad
Telerik team
 answered on 27 May 2009
2 answers
118 views
I'm using the Caramel theme and somehow, the last column is a little bit over on the right side and thus, making the horizontal scrollbar appears. If I changes the theme to Office_Black, everything is fine. Below is the code used and some screenshot to make it more clear:

<telerik:RadGridView Name="radGridView1" telerik:StyleManager.Theme="Caramel" 
                                     ShowGroupPanel="False" IsFilteringAllowed="True" 
                                     Foreground="Black" Margin="10,30,10,20" AutoGenerateColumns="False" 
                                     RowIndicatorVisibility="Collapsed" ColumnsWidthMode="Fill"
 
                    <telerik:RadGridView.Columns> 
                        <telerik:GridViewDataColumn UniqueName="Title" HeaderText="Title" IsFilterable="False" /> 
                        <telerik:GridViewDataColumn UniqueName="Artist" HeaderText="Artist" Width="Auto" /> 
                        <telerik:GridViewDataColumn UniqueName="Key" HeaderText="Key" Width="Auto"/> 
                    </telerik:RadGridView.Columns> 
                </telerik:RadGridView> 

You can see the filter icon got covered up for a small part on the last column (Key).

No horizontal scrollbar, and the icon shows up perfectly.

How do I fix this issue with the Caramel theme?

Thank you very much,
Kenny.
Kenny
Top achievements
Rank 1
 answered on 25 May 2009
1 answer
137 views
Hello,

I implemented a control containing a Rad GridView and a text box for instant filtering (similar to your sample examples). I noticed that the custom filtering overrides the filtering set by the drop-down filter (contained on the column headers) menus. From what I understood, the custom filter solution that you provide in the examples alters the GridViewDataControl.FilterDescription property which is used by the drop-down filters on the column headers. Is it possible to have both filters working together? Or is it at least possible to switch back and forth between these two filtering methods?

Thank you.
Milan
Telerik team
 answered on 25 May 2009
1 answer
80 views
Hi

given the code below is there any reason why my NewNode.Begin edit is causing an exception - object ref not set to an instance of an object. This works fine if I omit the BeginEdit

  Dim NewNode As New RadTreeViewItem  
 
        NewNode.Header = Now  
 
        Me.CurrentTreeViewItem.IsExpanded = True 
        Me.CurrentTreeViewItem.Items.Add(NewNode)  
 
        NewNode.IsSelected = True 
 
        NewNode.BringIntoView()  
        NewNode.BeginEdit() 
 
Thanks

P
Valentin.Stoychev
Telerik team
 answered on 25 May 2009
1 answer
101 views
Hi,

I need to bind  a self referencing entityobject to a master detail setup for 3 tiered hierarchy, what is the best way to do this?  Curently it seems to be failing to expand the 2nd layer let along the 3rd?

Cheers,
Marcus @ c9
Vlad
Telerik team
 answered on 25 May 2009
2 answers
212 views
Is there a way to recover the area that was being used by the expander when the expander is collapsed?  I have the event captured and I have the contents set to Collapsed but the space is still left on the screen rather than yielding it to the other row in the grid.

 

<Window x:Class="WpfApplication1.Window1" 
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" 
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" 
        xmlns:telerik="clr-namespace:Telerik.Windows.Controls;assembly=Telerik.Windows.Controls" 
        Title="Test" Height="350" Width="250" Background="Beige">  
    <Grid> 
        <Grid.RowDefinitions> 
            <RowDefinition Height="Auto" /> 
            <RowDefinition Height="Auto" /> 
        </Grid.RowDefinitions> 
        <Image Grid.Row="0" 
               Name="imageBackground"    
               HorizontalAlignment="Left" 
               VerticalAlignment="Top" 
               Source="/WpfApplication1;component/Images/master.png"   
               Stretch="Uniform" MaxHeight="250" /> 
          
        <telerik:RadExpander x:Name="radExpander"   
                             Grid.Row="1" 
                             IsExpanded="True" 
                             telerik:StyleManager.Theme="Vista" 
                             VerticalAlignment="Stretch" HorizontalAlignment="Stretch"   
                             Collapsed="radExpander_Collapsed" Expanded="radExpander_Expanded">  
            <telerik:RadExpander.Header> 
                <TextBlock x:Name="expanderCaption" Foreground="#FFFFFFFF" Text="Test Box" 
                            Visibility="Visible" /> 
            </telerik:RadExpander.Header> 
            <telerik:RadExpander.Content> 
                <WrapPanel x:Name="imageContainer" Orientation="Horizontal">  
                    <Image Margin="12" Width="200" Height="64" Stretch="Uniform" Source="/WpfApplication1;component/Images/test.png" /> 
                    <Image Margin="12" Width="200" Height="64" Stretch="Uniform" Source="/WpfApplication1;component/Images/test.png" /> 
                </WrapPanel> 
            </telerik:RadExpander.Content> 
        </telerik:RadExpander> 
    </Grid> 
</Window> 
 

 

 

code:

 

using System;  
using System.Collections.Generic;  
using System.Linq;  
using System.Text;  
using System.Windows;  
using System.Windows.Controls;  
using System.Windows.Data;  
using System.Windows.Documents;  
using System.Windows.Input;  
using System.Windows.Media;  
using System.Windows.Media.Imaging;  
using System.Windows.Navigation;  
using System.Windows.Shapes;  
 
namespace WpfApplication1  
{  
    /// <summary>  
    /// Interaction logic for Window1.xaml  
    /// </summary>  
    public partial class Window1 : Window  
    {  
        public Window1()  
        {  
            InitializeComponent();  
        }  
 
        private void radExpander_Collapsed(object sender, RoutedEventArgs e)  
        {  
            if (imageContainer != null)  
                imageContainer.Visibility = Visibility.Collapsed;  
        }  
 
        private void radExpander_Expanded(object sender, RoutedEventArgs e)  
        {  
            if (imageContainer != null)  
                imageContainer.Visibility = Visibility.Visible;  
 
        }  
    }  
David
Top achievements
Rank 2
 answered on 22 May 2009
1 answer
201 views
Hi, my dev team is early adopting the Visual Sudio 2010 and .NET 4.0 now that it is officially in public Beta.  I was wondering if it is advisable to manually add the Telerik Q1 2009 WPF controls to the 2010 toolbox?  Are there any known incompatabilities?  Is there a beta version of the WPF controls that I can use instead?

Thanks,
David Sandor

Boyan
Telerik team
 answered on 22 May 2009
7 answers
154 views
Hi I have a unbound treeview. It is populated via Load on demand. I require a style that can set my DefaultImageSrc depending a set of curcumstances, some like

<DataTrigger Binding="{Binding Path=IsFolder}" Value="True">  
                    <Setter Property="DefaultImageSrc" Value="../../folder.png" /> 
                </DataTrigger> 
                <DataTrigger Binding="{Binding Path=IsFolder}" Value="False">  
                    <Setter  Property="DefaultImageSrc" Value="../../diskdrive.png" /> 
                </DataTrigger> 

Can you give me an example

Thanks


P
Valentin.Stoychev
Telerik team
 answered on 22 May 2009
2 answers
161 views
I had a grid view which contains a template column and other columns are autogenerated. I found that "AddingNewDataItem" event is fired when i press insert when the grid view is focused. but it gives me an exception that

Exception has been thrown by the target of an invocation.

System.Reflection.TargetInvocationException was unhandled
  Message="Exception has been thrown by the target of an invocation."
  Source="mscorlib"
  StackTrace:
       at System.RuntimeMethodHandle._InvokeMethodFast(Object target, Object[] arguments, SignatureStruct& sig, MethodAttributes methodAttributes, RuntimeTypeHandle typeOwner)
       at System.RuntimeMethodHandle.InvokeMethodFast(Object target, Object[] arguments, Signature sig, MethodAttributes methodAttributes, RuntimeTypeHandle typeOwner)
       at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture, Boolean skipVisibilityChecks)
       at System.Delegate.DynamicInvokeImpl(Object[] args)
       at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Boolean isSingleParameter)
       at System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Boolean isSingleParameter, Delegate catchHandler)
       at System.Windows.Threading.Dispatcher.WrappedInvoke(Delegate callback, Object args, Boolean isSingleParameter, Delegate catchHandler)
       at System.Windows.Threading.DispatcherOperation.InvokeImpl()
       at System.Windows.Threading.DispatcherOperation.InvokeInSecurityContext(Object state)
       at System.Threading.ExecutionContext.runTryCode(Object userData)
       at System.Runtime.CompilerServices.RuntimeHelpers.ExecuteCodeWithGuaranteedCleanup(TryCode code, CleanupCode backoutCode, Object userData)
       at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state)
       at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
       at System.Windows.Threading.DispatcherOperation.Invoke()
       at System.Windows.Threading.Dispatcher.ProcessQueue()
       at System.Windows.Threading.Dispatcher.WndProcHook(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
       at MS.Win32.HwndWrapper.WndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
       at MS.Win32.HwndSubclass.DispatcherCallbackOperation(Object o)
       at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Boolean isSingleParameter)
       at System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Boolean isSingleParameter, Delegate catchHandler)
       at System.Windows.Threading.Dispatcher.WrappedInvoke(Delegate callback, Object args, Boolean isSingleParameter, Delegate catchHandler)
       at System.Windows.Threading.Dispatcher.InvokeImpl(DispatcherPriority priority, TimeSpan timeout, Delegate method, Object args, Boolean isSingleParameter)
       at System.Windows.Threading.Dispatcher.Invoke(DispatcherPriority priority, Delegate method, Object arg)
       at MS.Win32.HwndSubclass.SubclassWndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam)
       at MS.Win32.UnsafeNativeMethods.DispatchMessage(MSG& msg)
       at System.Windows.Threading.Dispatcher.PushFrameImpl(DispatcherFrame frame)
       at System.Windows.Threading.Dispatcher.PushFrame(DispatcherFrame frame)
       at System.Windows.Threading.Dispatcher.Run()
       at System.Windows.Application.RunDispatcher(Object ignore)
       at System.Windows.Application.RunInternal(Window window)
       at System.Windows.Application.Run(Window window)
       at System.Windows.Application.Run()
       at Cerebrata.CloudStorage.UI.WPF.App.Main() in D:\Projects\CerebrataCloudStorage\UI.WPF\obj\Debug\App.g.cs:line 0
       at System.AppDomain._nExecuteAssembly(Assembly assembly, String[] args)
       at System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence assemblySecurity, String[] args)
       at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()
       at System.Threading.ThreadHelper.ThreadStart_Context(Object state)
       at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
       at System.Threading.ThreadHelper.ThreadStart()
  InnerException: System.NullReferenceException
       Message="Object reference not set to an instance of an object."
       Source="Telerik.Windows.Controls.GridView"
       StackTrace:
            at Telerik.Windows.Controls.GridView.GridViewCell.ShowEditor() in c:\Builds\WPF_Scrum\X1_Q1_2009\Sources\Development\WPF\GridView\GridView\Cells\GridViewCell.cs:line 488
            at Telerik.Windows.Controls.GridView.GridViewCell.<ToggleEditor>b__0() in c:\Builds\WPF_Scrum\X1_Q1_2009\Sources\Development\WPF\GridView\GridView\Cells\GridViewCell.cs:line 593
            at Telerik.Windows.Controls.GridView.GridViewCell.ModifyCellTemplate(Action executeAction) in c:\Builds\WPF_Scrum\X1_Q1_2009\Sources\Development\WPF\GridView\GridView\Cells\GridViewCell.cs:line 461
            at Telerik.Windows.Controls.GridView.GridViewCell.ToggleEditor() in c:\Builds\WPF_Scrum\X1_Q1_2009\Sources\Development\WPF\GridView\GridView\Cells\GridViewCell.cs:line 593
            at Telerik.Windows.Controls.GridView.EditContext.OnCellEditModeChanged(GridViewCell cell, Boolean newIsInEditMode) in c:\Builds\WPF_Scrum\X1_Q1_2009\Sources\Development\WPF\GridView\GridView\Editing\EditContext.cs:line 231
            at Telerik.Windows.Controls.GridView.GridViewCell.IsInEditModeChanged(DependencyObject target, DependencyPropertyChangedEventArgs e) in c:\Builds\WPF_Scrum\X1_Q1_2009\Sources\Development\WPF\GridView\GridView\Cells\GridViewCell.cs:line 586
            at System.Windows.DependencyObject.OnPropertyChanged(DependencyPropertyChangedEventArgs e)
            at System.Windows.FrameworkElement.OnPropertyChanged(DependencyPropertyChangedEventArgs e)
            at System.Windows.DependencyObject.NotifyPropertyChange(DependencyPropertyChangedEventArgs args)
            at System.Windows.DependencyObject.UpdateEffectiveValue(EntryIndex entryIndex, DependencyProperty dp, PropertyMetadata metadata, EffectiveValueEntry oldEntry, EffectiveValueEntry& newEntry, Boolean coerceWithDeferredReference, OperationType operationType)
            at System.Windows.DependencyObject.SetValueCommon(DependencyProperty dp, Object value, PropertyMetadata metadata, Boolean coerceWithDeferredReference, OperationType operationType, Boolean isInternal)
            at System.Windows.DependencyObject.SetValue(DependencyProperty dp, Object value)
            at Telerik.Windows.Controls.GridView.GridViewCell.set_IsInEditMode(Boolean value) in c:\Builds\WPF_Scrum\X1_Q1_2009\Sources\Development\WPF\GridView\GridView\Cells\GridViewCell.cs:line 214
            at Telerik.Windows.Controls.GridView.EditContext.SwitchCellToEditMode(GridViewCell cell) in c:\Builds\WPF_Scrum\X1_Q1_2009\Sources\Development\WPF\GridView\GridView\Editing\EditContext.cs:line 243
            at Telerik.Windows.Controls.GridView.EditContext.BeginEdit(GridViewCell gridViewCell) in c:\Builds\WPF_Scrum\X1_Q1_2009\Sources\Development\WPF\GridView\GridView\Editing\EditContext.cs:line 259
       InnerException:


Nedyalko Nikolov
Telerik team
 answered on 22 May 2009
Narrow your results
Selected tags
Tags
+? more
Top users last month
Will
Top achievements
Rank 2
Iron
Motti
Top achievements
Rank 1
Iron
Hester
Top achievements
Rank 1
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Thomas
Top achievements
Rank 2
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Will
Top achievements
Rank 2
Iron
Motti
Top achievements
Rank 1
Iron
Hester
Top achievements
Rank 1
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Thomas
Top achievements
Rank 2
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?