Telerik Forums
UI for WPF Forum
1 answer
143 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
81 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
104 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
223 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
204 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
156 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
168 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
1 answer
63 views
Hi all;

First, I need to preface this by saying I'm a newbie when it comes to the WPF world.  But I'm having some trouble with the design time experience for WPF grid view.  Can anybody summarize how I can set up a design time experience that lets me work with the data I'll be using at runtime, so that I don't wind up with XML parser errors on the design surface, rather than a representation of my grid?

For example, if I set up a grid similar to the following:
    <Grid> 
        <telerik:RadGridView Margin="0" Name="radGridView1" AutoGenerateColumns="False"
            <telerik:RadGridView.Columns> 
                <telerik:GridViewColumn UniqueName="salesperson_name" IsVisible="False"/> 
            </telerik:RadGridView.Columns> 
            <telerik:RadGridView.GroupDescriptions> 
                <telerik:RadGroupDescription PropertyName="salesperson_name" SortDirection="Ascending"/> 
            </telerik:RadGridView.GroupDescriptions> 
        </telerik:RadGridView> 
    </Grid> 

I wind up with an Unhandled Exception on the design surface.

Thanks,
Jason


Hristo Deshev
Telerik team
 answered on 21 May 2009
3 answers
324 views
Hello. 

I'm back with more questions and problems.

  1. When inserting new row into master grid (master/child scenario), new row is out of alignment with other rows. This is clearly a bug?
  2. When cell in grid has focus, routed commands (trigerred through button in a toolbar) get selected GridViewCell as ExecutedRoutedEventArgs.OriginalSource. When only row has focus (row is selected but no cell has focus) nothing (button itself) is returned as OriginalSource. Shouldn't selected GridViewRow be passed in OriginalSource?
  3. 4. After adding new record to child grid (in a way explained here here), that new row is immediately removed. I add record to database (LINQ) in RowEditEnded, so after restarting an application record does show. The cause seems to be RadGrid not inserting data into underlying LINQ container. This does not happen in master grid. Child grid ItemsSource is set to "{Binding MasterRecord.Data.Addresses}". Addresses is a property of class EntitySet. The workaround is adding new record manually into this collection, which works fine, but I'd like to know this this is the way it's supposed to be or is it some kind of bug (my code or RadGrid doing something wrong).
  4. I'm using binding validation (based on IDataErrorInfo implemented in business objects). I have problems marking cells that have validation errors. Setting Validation.ErrorTemplate has more or less unpredictable results. So I use code like this:
        <Style TargetType="{x:Type telerik:GridViewCell}"
            <Style.Triggers> 
                <Trigger Property="Validation.HasError" Value="true"
                    <Setter Property="ToolTip" Value="{Binding RelativeSource={RelativeSource Self}, Path=(Validation.Errors)[0].ErrorContent}" /> 
                    <Setter Property="Background" Value="Red" /> 
                </Trigger> 
            </Style.Triggers> 
        </Style> 
  • This leaves misaligned red borders (where inserted cells were marked red for validation errors) in first row even after row has been commited and moved. This remains in place event when scrolling grid. It works fine for row's that were already in database or were only modified, but not for new rows.
  • Red background does not show for fields containging date.

Thanks.
Branko
Nedyalko Nikolov
Telerik team
 answered on 21 May 2009
1 answer
321 views
Can you please post some sample code as to how I could change the theme for a chart in code behind?  I just want to switch from the balck theme to either Vista or Simple.

 For the life of me I can't find the method or property to set.

Thanks!!

--Tad Richard
Ves
Telerik team
 answered on 21 May 2009
Narrow your results
Selected tags
Tags
+? more
Top users last month
Rob
Top achievements
Rank 3
Iron
Iron
Iron
Atul
Top achievements
Rank 1
Iron
Iron
Iron
Alexander
Top achievements
Rank 1
Veteran
Iron
Serkan
Top achievements
Rank 1
Iron
Shawn
Top achievements
Rank 1
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Rob
Top achievements
Rank 3
Iron
Iron
Iron
Atul
Top achievements
Rank 1
Iron
Iron
Iron
Alexander
Top achievements
Rank 1
Veteran
Iron
Serkan
Top achievements
Rank 1
Iron
Shawn
Top achievements
Rank 1
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?