Telerik Forums
UI for WPF Forum
2 answers
432 views
I need to set programmatically the scroll of a GridView by code.

I can set the value of the scrollbars of my GridView by code. Unfortunatly the content of the grid doesn't scroll automatically if I change the value of the scrollbar.

Here the code to obtain and set the value of the scrollbars of your GridView:

GridViewItemsControl gridViewItemsControl = (GridViewItemsControl)RadGridView1.Template.FindName("PART_RootItemsControl", RadGridView1);

GridViewScrollViewer scrollviewer = (GridViewScrollViewer)gridViewItemsControl.Template.FindName("PART_ItemsScrollViewer", gridViewItemsControl);

ScrollBar verticalscrollbar = (ScrollBar)scrollviewer.Template.FindName("PART_VerticalScrollBar", scrollviewer);
ScrollBar horizontalscrollbar = (ScrollBar)scrollviewer.Template.FindName("PART_HorizontalScrollBar", scrollviewer);

horizontalscrollbar.Value = horizontalscrollbar.Maximum;
verticalscrollbar.Value = verticalscrollbar.Maximum;

Now how can I set the vertical/horizontal offset of the GridView 's content ?

Thanks,
Davide
dav
Top achievements
Rank 1
 answered on 23 Feb 2009
3 answers
183 views
Hi,
I am createing WAP Browser Application to use RadCarousel, in which I am binding data to RadCarousel with datatable. When I run this xbap it doesnt show any error. but not showing data in CaruselItems.
can you please tell me what I am missing here?
my code is

<Page x:Class="WPFBrowserApplication.Page1"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:telerik="http://schemas.telerik.com/2008/xaml/presentation"
    xmlns:carousel="clr-namespace:Telerik.Windows.Controls.Carousel;assembly=Telerik.Windows.Controls.Navigation"
    Title="Page1">
    <Grid>
        <Grid.Resources>
            <carousel:ArithmeticValueConverter x:Key="ArithmeticValueConverter" />

            <Style TargetType="{x:Type telerik:CarouselItem}">
                <Setter Property="Template" >
                    <Setter.Value>
                        <ControlTemplate TargetType="{x:Type telerik:CarouselItem}">
                            <Grid  ClipToBounds="False" Height="175" Width="150" >
                                <Border RenderTransformOrigin="0.5, 1" ClipToBounds="False" Width="{Binding ElementName=CarouselItemInnerGrid, Path=ActualWidth}"                        
                            Opacity="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=ReflectionSettings.Opacity}"
                            Visibility="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=ReflectionSettings.Visibility}"
                            BorderBrush="White"
                            BorderThickness="0">
                                    <Border.RenderTransform>
                                        <TransformGroup>
                                            <ScaleTransform
                                        ScaleX="{Binding RelativeSource={RelativeSource TemplatedParent},
                                                        Path=ReflectionSettings.WidthOffset,
                                                        Converter={StaticResource ArithmeticValueConverter},
                                                        ConverterParameter=1}"
                                        ScaleY="{Binding RelativeSource={RelativeSource TemplatedParent},
                                                        Path=ReflectionSettings.HeightOffset,
                                                        Converter={StaticResource ArithmeticValueConverter},
                                                        ConverterParameter=-1}"
                                        CenterY="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=ReflectionSettings.OffsetY}" />
                                            <TranslateTransform X="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=ReflectionSettings.OffsetX}" />
                                            <SkewTransform AngleX="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=ReflectionSettings.Angle}" />
                                        </TransformGroup>

                                    </Border.RenderTransform>
                                    <Border.OpacityMask>
                                        <LinearGradientBrush StartPoint="0,0" EndPoint="0,1">
                                            <LinearGradientBrush.GradientStops>
                                                <GradientStop Offset="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=ReflectionSettings.HiddenPercentage}" Color="Transparent"/>
                                                <GradientStop Offset="1" Color="Black"/>
                                            </LinearGradientBrush.GradientStops>
                                        </LinearGradientBrush>
                                    </Border.OpacityMask>
                                    <Border.Background>
                                        <VisualBrush Visual="{Binding ElementName=CarouselItemInnerGrid}">
                                        </VisualBrush>
                                    </Border.Background>

                                </Border>

                                <Grid x:Name="CarouselItemInnerGrid">
                                    <Border x:Name="CarouselItemMainBorder" Opacity="0.5" BorderBrush="#FF91B3FF" BorderThickness="1,1,1,1" CornerRadius="5,5,5,5" SnapsToDevicePixels="True">
                                        <Border.Background>
                                            <LinearGradientBrush EndPoint="108,472" StartPoint="108,23" MappingMode="Absolute">
                                                <GradientStop Color="#FF2C3A68" Offset="0"/>
                                                <GradientStop Color="#FF000000" Offset="1"/>
                                                <GradientStop Color="#FF0F224C" Offset="0.045"/>
                                                <GradientStop Color="#FF000000" Offset="0.0451"/>
                                            </LinearGradientBrush>
                                        </Border.Background>
                                    </Border>
                                    <Border Opacity="1" BorderBrush="#3F000000" BorderThickness="1,1,1,1" CornerRadius="5,5,5,5" Margin="10,10,10,10" x:Name="CarouselItemInnerBorder" SnapsToDevicePixels="True">
                                        <Border.Background>
                                            <LinearGradientBrush EndPoint="101,462" StartPoint="101,13" MappingMode="Absolute">
                                                <GradientStop Color="#FF2C3A68" Offset="0"/>
                                                <GradientStop Color="#FF000000" Offset="1"/>
                                                <GradientStop Color="#FF0F224C" Offset="0.045"/>
                                                <GradientStop Color="#FF000000" Offset="0.0451"/>
                                            </LinearGradientBrush>
                                        </Border.Background>
                                        <ContentPresenter IsHitTestVisible="True" />
                                        <Border.Triggers>

                                        </Border.Triggers>
                                    </Border>
                                </Grid>
                            </Grid>

                            <ControlTemplate.Triggers>
                                <MultiTrigger>
                                    <MultiTrigger.Conditions>
                                        <Condition Property="IsSelected" Value="False" />
                                        <Condition Property="IsMouseOver" Value="True" />
                                    </MultiTrigger.Conditions>
                                    <MultiTrigger.EnterActions>
                                        <BeginStoryboard>
                                            <Storyboard >
                                                <ColorAnimation Storyboard.TargetName="CarouselItemMainBorder" Storyboard.TargetProperty="Background.GradientStops[0].Color" To="#FF344B97" Duration="0:0:0.3" />
                                                <ColorAnimation  Storyboard.TargetName="CarouselItemMainBorder" Storyboard.TargetProperty="Background.GradientStops[2].Color" To="#FF233F7E" Duration="0:0:0.3" />
                                                <ColorAnimation Storyboard.TargetName="CarouselItemInnerBorder" Storyboard.TargetProperty="Background.GradientStops[0].Color" To="#FF344B97" Duration="0:0:0.3" />
                                                <ColorAnimation Storyboard.TargetName="CarouselItemInnerBorder" Storyboard.TargetProperty="Background.GradientStops[2].Color" To="#FF233F7E" Duration="0:0:0.3" />
                                            </Storyboard>
                                        </BeginStoryboard>

                                    </MultiTrigger.EnterActions>
                                    <MultiTrigger.ExitActions>
                                        <BeginStoryboard>
                                            <Storyboard FillBehavior="Stop" >
                                                <ColorAnimation Storyboard.TargetName="CarouselItemMainBorder" Storyboard.TargetProperty="Background.GradientStops[0].Color" To="#FF2C3A68" Duration="0:0:0.3" />
                                                <ColorAnimation Storyboard.TargetName="CarouselItemMainBorder" Storyboard.TargetProperty="Background.GradientStops[2].Color" To="#FF0F224C" Duration="0:0:0.3" />
                                                <ColorAnimation Storyboard.TargetName="CarouselItemInnerBorder" Storyboard.TargetProperty="Background.GradientStops[0].Color" To="#FF2C3A68" Duration="0:0:0.3" />
                                                <ColorAnimation Storyboard.TargetName="CarouselItemInnerBorder" Storyboard.TargetProperty="Background.GradientStops[2].Color" To="#FF0F224C" Duration="0:0:0.3" />
                                            </Storyboard>
                                        </BeginStoryboard>
                                    </MultiTrigger.ExitActions>
                                    
                                </MultiTrigger>

                                <Trigger Property="IsSelected" Value="True" >
                                    <Setter TargetName="CarouselItemMainBorder" Property="Background">
                                        <Setter.Value>
                                            <LinearGradientBrush EndPoint="108,472" StartPoint="108,23" MappingMode="Absolute">
                                                <GradientStop Color="#FF344B97" Offset="0"/>
                                                <GradientStop Color="#FF000000" Offset="1"/>
                                                <GradientStop Color="#FF233F7E" Offset="0.045"/>
                                                <GradientStop Color="#FF000000" Offset="0.0451"/>
                                            </LinearGradientBrush>
                                        </Setter.Value>
                                    </Setter>
                                    <Setter TargetName="CarouselItemInnerBorder" Property="Background">
                                        <Setter.Value>
                                            <LinearGradientBrush  EndPoint="101,462" StartPoint="101,13" MappingMode="Absolute">
                                                <GradientStop Color="#FF344B97" Offset="0"/>
                                                <GradientStop Color="#FF000000" Offset="1"/>
                                                <GradientStop Color="#FF233F7E" Offset="0.045"/>
                                                <GradientStop Color="#FF000000" Offset="0.0451"/>
                                            </LinearGradientBrush>
                                        </Setter.Value>
                                    </Setter>
                                </Trigger>

                            </ControlTemplate.Triggers>
                        </ControlTemplate>
                    </Setter.Value>
                </Setter>
            </Style>

            <Style TargetType="{x:Type telerik:CarouselDataRecordPresenter}">
                <Setter Property="Template">
                    <Setter.Value>
                        <ControlTemplate TargetType="{x:Type telerik:CarouselDataRecordPresenter}">
                            <Grid IsHitTestVisible="False" HorizontalAlignment="Stretch" VerticalAlignment="Stretch">
                                <Grid.RowDefinitions>
                                    <RowDefinition Height="30" />
                                    <RowDefinition Height="100" />
                                    <RowDefinition Height="Auto" />
                                </Grid.RowDefinitions>
                                <StackPanel Grid.Row="0" Orientation="Horizontal" VerticalAlignment="Center" >
                                    <Label Content="Name: " Foreground="#ff8FB3FF" FontSize="12"/>
                                    <Label Content="{Binding Path=Data.FirstName}" Foreground="#ff8FB3FF" FontSize="12" />                                    
                                </StackPanel>
                                <Rectangle Grid.Row="1" RadiusX="3" RadiusY="3" Width="110" Height="80">
                                    <!--
                                    <Rectangle.Fill>    
                                         <ImageBrush x:Name="brush" ImageSource="{Binding Path=Data.Picture}"/>
                                    </Rectangle.Fill>
                                    -->
                                </Rectangle>
                                <StackPanel Grid.Row="2"  Orientation="Horizontal" VerticalAlignment="Center">
                                    <Label Content="Phone: " Foreground="#ff8FB3FF" FontSize="12"/>
                                    <Label Content="{Binding Path=Data.Phone}" FontSize="12" Foreground="#ff8FB3FF"/>
                                </StackPanel>
                            </Grid>
                        </ControlTemplate>
                    </Setter.Value>
                </Setter>
            </Style>
        </Grid.Resources>
        
        <telerik:RadCarousel x:Name="sampleRadCarousel" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" />
    </Grid>
</Page>



and my datatable is like


public DataTable getData()
        {
            DataTable dt = new DataTable();
            DataSet ds = new DataSet();
            dt.Columns.Add("ID", Type.GetType("System.Int32"));
            dt.Columns.Add("FirstName", Type.GetType("System.String"));
            dt.Columns.Add("LastName", Type.GetType("System.String"));
            dt.Columns.Add("Phone", Type.GetType("System.String"));
            dt.Columns.Add("Picture");
            
            try
            {
                DataRow dr = dt.NewRow();
                dr["ID"] = 46;
                dr["FirstName"] = "Ana";
                dr["LastName"] = "Trujillo";
                dr["Phone"] = "6562-9722";
                dr["Picture"] = pic code here
                dt.Rows.Add(dr);
                dt.AcceptChanges();
                dr = dt.NewRow();
                dr["ID"] = 47;
                dr["FirstName"] = "Ana";
                dr["LastName"] = "Trujillo";
                dr["Phone"] = "6562-9722";
               dr["Picture"] = pic code here
                dt.Rows.Add(dr);
                dt.AcceptChanges();
            }
            catch(Exception ex)
            {

            }

            return dt;
        }


I could see blank item in RadCarousel at runtime








Milan
Telerik team
 answered on 23 Feb 2009
1 answer
145 views
i'm sure this information is already out there but I can find anything on this topic.  How do you change the style of the datepicker?  With the asp.net rad controls there was a little arrow next to the control where you can change the look and feel of the control.  I guess this doesn't exist for the wpf controls?  Basically what I am looking for is a good resource on how to change the look and feel of the datepicker.
Hristo
Telerik team
 answered on 23 Feb 2009
2 answers
203 views
Hi all,

Excuse for my poor english, i'm a french user. We planned to buy Telerik WPF components to use them in our VS 2008 projects, but i need to check first if they're fully compatible with my actual code.

I followed an article from Code Project, using theViewModelPattern to feed my treeview. That's ok with the basic treeview from vs 2008, but the basic treeview doesn't implement Drag and drop operations, so i have to test yours. I would like to use your treeview instead of microsoft one but without rewriting my code behind and classes, just by rewriting my xaml.I have tried a lot of thing but i couldn't manage to plug my actual code with your treeview.

My "classic" code working with microsoft treeview:

<UserControl  
  x:Class="Window2" 
  xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" 
  xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" 
  xmlns:local="clr-namespace:XXX.XXX.LoadOnDemand" Background="Transparent"
    <DockPanel> 
        <TextBlock DockPanel.Dock="Bottom" TextWrapping="Wrap" FontSize="12"
        
            <Image Source="/XXX;component/LoadOnDemand/Images/logo.png" Height="120" Width="160"></Image> 
        </TextBlock> 
         
        <TreeView ItemsSource="{Binding Regions}" Background="Transparent" BorderThickness="0" x:Name="MonTreeview"
              
            <TreeView.ItemContainerStyle> 
                <!-- 
        This Style binds a TreeViewItem to a TreeViewItemViewModel. 
        --> 
                <Style TargetType="{x:Type TreeViewItem}"
                    <Setter Property="IsExpanded" Value="{Binding IsExpanded, Mode=TwoWay}" /> 
                    <Setter Property="IsSelected" Value="{Binding IsSelected, Mode=TwoWay}" /> 
                    <Setter Property="FontWeight" Value="Normal" /> 
                    <Style.Triggers> 
                        <Trigger Property="IsSelected" Value="True"
                            <Setter Property="FontWeight" Value="Bold" /> 
                        </Trigger> 
                    </Style.Triggers> 
                </Style> 
            </TreeView.ItemContainerStyle> 
 
            <TreeView.Resources> 
                <HierarchicalDataTemplate  
          DataType="{x:Type local:affaireModel}"  
          ItemsSource="{Binding Children}" 
          > 
                    <StackPanel Orientation="Horizontal"
                        <Image Width="16" Height="16" Margin="3,0" Source="Images\Region.png" /> 
                        <TextBlock Text="{Binding AffaireName}" /> 
                    </StackPanel> 
                </HierarchicalDataTemplate> 
 
                <HierarchicalDataTemplate  
          DataType="{x:Type local:StateViewModel}"  
          ItemsSource="{Binding Children}" 
          > 
                    <StackPanel Orientation="Horizontal"
                        <Image Width="16" Height="16" Margin="3,0" Source="Images\State.png" /> 
                        <TextBlock Text="{Binding ChapitreAffaireName}" /> 
                    </StackPanel> 
                </HierarchicalDataTemplate> 
 
                <DataTemplate DataType="{x:Type local:maTacheModel}"
                    <StackPanel Orientation="Horizontal"
                        <Image Width="16" Height="16" Margin="3,0" Source="Images\City.png" /> 
                        <TextBlock Text="{Binding TacheName}" /> 
                    </StackPanel> 
                </DataTemplate> 
            </TreeView.Resources> 
        </TreeView> 
        <Label Height="66" Name="Label1" Width="149">Label</Label> 
    </DockPanel> 
</UserControl> 
 

Is it possible for me to use your treeview just by rewriting my xaml, without changing any of my classes?


Thanks for your reply. I've already try the carousel component and the grid view too, i'm fully satisfied.
LAURIO
Top achievements
Rank 2
 answered on 23 Feb 2009
6 answers
198 views
Hi,

We have download and installed sample exe for WPF application.
It has created some sample application in C:\ProgramFiles\Telerik...

Now when you copy and paste the code from your examples, its not running and giving error.

So Can you please tell me how to use run your sample examples.

I get the error at line
        <telerik:RadCarousel 

Error is : The element grid in namespace http://schemas.microsoft.com/winfx/2006/xaml/presentation
has invalid child element RadCarousel in namepace http://schemas.microsoft.com/winfx/2006/xaml/ list of possible elements expexted..... 

This is my Code

<QuickStart:ExampleControl x:Class="Telerik.Windows.Examples.Carousel.BringIntoView.Example" 
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" 
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" 
    xmlns:QuickStart="clr-namespace:Telerik.Windows.QuickStart;assembly=Telerik.Windows.QuickStart" 
    xmlns:telerik="http://schemas.telerik.com/2008/xaml/presentation" 
    xmlns:e="clr-namespace:Telerik.Windows.Examples">  
    <QuickStart:ExampleControl.Resources> 
        <ObjectDataProvider x:Key="objectDataProvider" ObjectType="{x:Type e:ExamplesDB}" MethodName="GetAddressBookSimple" /> 
    </QuickStart:ExampleControl.Resources> 
    <Grid> 
        <telerik:RadCarousel Name="radCarousel" DataContext="{StaticResource objectDataProvider}" ItemsSource="{Binding}"/>  
      
    </Grid> 
    <QuickStart:ExampleControl.TopRightPanel> 
        <StackPanel> 
            <TextBlock Text="Locate contact" /> 
            <ComboBox DisplayMemberPath="FirstName" DataContext="{StaticResource objectDataProvider}"   
                      ItemsSource="{Binding}" HorizontalAlignment="Stretch" ClipToBounds="True" SelectedIndex="0"   
                      SelectionChanged="Contact_SelectionChanged" /> 
        </StackPanel> 
    </QuickStart:ExampleControl.TopRightPanel> 
</QuickStart:ExampleControl> 

I have installed .NET Framework 3.0 and VS 2005



We need to use this in a web application.
Thanks
Savan

Savan
Top achievements
Rank 1
 answered on 20 Feb 2009
1 answer
151 views
Hello.

I think i found some bug when using RadSlider control.

When I create new RadSlider with IsSelectionRangeEnabled set to true and then move slider so that I create some range and then when I click on slider (like when i would want to move with range but i don't move it only mouse click on it) then it is somehow bugged...

After this it is not possible to move with left slider (selection start value).
Actually when I try to move left (minimum) slider, visually nothing happens but on each mousemove event SelectionStart is increased or decreased (depens wheather I move with mouse on left or on right from left slider position) until it is same as SelectionEnd or same as minimum slider value.

I hope you can understand what I mean . (it is easy to reproduce when slider is on maximum range)

I created my slider in code like this:

RadSlider testSlider = new RadSlider();
testSlider.Minimum = -20;
testSlider.Maximum = 40;
testSlider.Orientation =
Orientation.Horizontal;
testSlider.IsSnapToTickEnabled = true;
testSlider.IsSelectionRangeEnabled =
true;
testSlider.TickPlacement = Telerik.Windows.Controls.TickPlacement.None;
testSlider.TickFrequency = 1;
testSlider.SelectionStart = 0;
testSlider.SelectionEnd = 5;

testSlider.Width = 240;
Canvas.SetLeft(testSlider, 10);
Canvas.SetTop(testSlider, 10);
aMainCanvas.Children.Add(testSlider);

 

 

 

Ivan
Telerik team
 answered on 19 Feb 2009
3 answers
303 views
I'm in the middle of producing a new WPF app to replace an old Clipper application for one of my clients.  So I'm trying to develop a window framework for basic business objects.  I'm trying to build a generic user control which can facilitate the typical <First> <Prev> <Next> <Last> record navigation within a TabControl.  The first tabs are my RadGridViews which allow for sorting and searching capability.  The second tab is a details tab, which is where I would like to have this record navigation so the end user doesn't have to go back and forth between the tabs if they're just trying to move through the list.

I have the navigation working just fine but I would like to add a couple textboxes to the user control which would display the current record # and the total # of records.  I don't want to tightly couple the user control to the specific grid or page.  My user control is "bound" to the grid during the constructor method of the window.  I can easily get the current record during the click event of each of the 4 buttons but would prefer if the user control would update on any movement on the grid.  Also, I would like to have a user control property bound to the population of the grid data so the user control would know whenever a new search if performed within the grid and appropriately reset the two text boxes.  I'm just not quite sure how to do this and what event or property of the RadGridView I'd tie it to.  I'm new to WPF and C# so my guess would be some type of CommandBinding or DependencyProperty?

Any help would be greatly appreciated.

Thanks,
-Sid Meyers.
Milan
Telerik team
 answered on 19 Feb 2009
1 answer
124 views
Hi, I've a problem with the SelectedItem property.
I set ItemsPerPage = 3

The databinding is OK, so I can scroll any element in the collection

But, when I try to do this:

this

 

.sampleCarousel.SelectedItem = this.sample.Items[index];

if the Item isn't in the view the Carousel doesn't update its view...

For example if the SelectedItem corresponds to item 3 in the collection and I do this

this.sampleCarousel.SelectedItem = this.sample.Items[1];

The carousel view doesn't update

Where is the problem?
Thanks in advance,
Manuel

 

Milan
Telerik team
 answered on 19 Feb 2009
1 answer
113 views
Hi,

I have installed RadControls for WPF Q3 2008 SP1 on my machine. If I try to build Example.cs project it is giving me following errors

1. the file not fould at C:\Program Files\Telerik\RadControls for WPF Q3 2008 SP1\CodeAnalysisSpellCheckDictionary.xml.

2. The tag 'DynamicBasePage' does not exist in XML namespace 'clr-namespace:Telerik.Windows.Examples.Gauge'. Line 1 Position 23. C:\Program Files\Telerik\RadControls for WPF Q3 2008 SP1\Examples.CS\Gauge\Indicators\Marker\Example.xaml 1 23 Examples.CS

3. Cannot find the type 'OrderRecurrencies'. Note that type names are case sensitive. C:\Program Files\Telerik\RadControls for WPF Q3 2008 SP1\Examples.CS\Chart\Integration\DeliverySchedule\Themes\OrderAppointmentTemplates.xaml 154 29 Examples.CS

Milan
Telerik team
 answered on 17 Feb 2009
3 answers
201 views
Hi
I added three additional columns to the grid, then bound to my datasource (Nothwinds ado entities)

 Public Sub New()  
        MyBase.New()  
 
        Me.InitializeComponent()  
 
        ' Insert code required on object creation below this point.  
        
        gv1.AutoGenerateColumns = False 
        Dim detailDefinition As GridViewTableDefinition = New GridViewTableDefinition()  
        detailDefinition.Relation = New PropertyRelation("Orders")  
        gv1.TableDefinition.ChildTableDefinitions.Add(detailDefinition)  
 
        Dim gvdc As GridViewDataColumn  
 
        gvdc = New GridViewDataColumn  
        gvdc.HeaderText = "One" 
        gvdc.EditorSettings = New ComboBoxEditorSettings  
        gv1.Columns.Add(gvdc)  
 
        gvdc = New GridViewDataColumn  
        gvdc.HeaderText = "Two" 
        gvdc.EditorSettings = New CheckBoxEditorSettings  
        gv1.Columns.Add(gvdc)  
 
        gvdc = New GridViewDataColumn  
        gvdc.HeaderText = "Three" 
        gvdc.EditorSettings = New DatePickerEditorSettings  
        gv1.Columns.Add(gvdc)  
 
        CustomerList = (From c In _cx.Customers.Include("Orders")).ToList  
        Me.gv1.ItemsSource = CustomerList  
 
        _CurrentCustomer = CustomerList(0)  
    End Sub 
 

clicking on and off column "Three" (DatePickerEditor), after the grid has rendered, causes this exception



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.RoutedEventArgs.InvokeEventHandler(Delegate genericHandler, Object genericTarget)  
       at System.Windows.RoutedEventArgs.InvokeHandler(Delegate handler, Object target)  
       at System.Windows.RoutedEventHandlerInfo.InvokeHandler(Object target, RoutedEventArgs routedEventArgs)  
       at System.Windows.EventRoute.InvokeHandlersImpl(Object source, RoutedEventArgs args, Boolean reRaised)  
       at System.Windows.UIElement.RaiseEventImpl(DependencyObject sender, RoutedEventArgs args)  
       at System.Windows.UIElement.RaiseEvent(RoutedEventArgs e)  
       at Telerik.Windows.Controls.GridView.GridViewCell.RaiseEventEditEnded() in r:\WPF_Scrum\WPF_Team\Sources\Development\WPF\GridView\GridView\Cells\GridViewCell.cs:line 1103  
       at Telerik.Windows.Controls.GridView.GridViewCell.CommitEdit() in r:\WPF_Scrum\WPF_Team\Sources\Development\WPF\GridView\GridView\Cells\GridViewCell.cs:line 710  
       at Telerik.Windows.Controls.GridView.GridViewCell.TryCommitEdit() in r:\WPF_Scrum\WPF_Team\Sources\Development\WPF\GridView\GridView\Cells\GridViewCell.cs:line 887  
       at Telerik.Windows.Controls.GridView.GridViewCell.HandleLostFocus() in r:\WPF_Scrum\WPF_Team\Sources\Development\WPF\GridView\GridView\Cells\GridViewCell.cs:line 875  
       at Telerik.Windows.Controls.GridView.GridViewCell.OnLostFocus(RoutedEventArgs e) in r:\WPF_Scrum\WPF_Team\Sources\Development\WPF\GridView\GridView\Cells\GridViewCell.cs:line 640  
       at System.Windows.UIElement.IsFocused_Changed(DependencyObject d, DependencyPropertyChangedEventArgs e)  
       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.ClearValueCommon(EntryIndex entryIndex, DependencyProperty dp, PropertyMetadata metadata)  
       at System.Windows.DependencyObject.ClearValue(DependencyPropertyKey key)  
       at System.Windows.Input.FocusManager.OnFocusedElementChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)  
       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 System.Windows.Input.FocusManager.SetFocusedElement(DependencyObject element, IInputElement value)  
       at System.Windows.Input.KeyboardNavigation.UpdateFocusedElement(DependencyObject focusTarget)  
       at System.Windows.FrameworkElement.OnGotKeyboardFocus(Object sender, KeyboardFocusChangedEventArgs e)  
       at System.Windows.Input.KeyboardFocusChangedEventArgs.InvokeEventHandler(Delegate genericHandler, Object genericTarget)  
       at System.Windows.RoutedEventArgs.InvokeHandler(Delegate handler, Object target)  
       at System.Windows.RoutedEventHandlerInfo.InvokeHandler(Object target, RoutedEventArgs routedEventArgs)  
       at System.Windows.EventRoute.InvokeHandlersImpl(Object source, RoutedEventArgs args, Boolean reRaised)  
       at System.Windows.UIElement.RaiseEventImpl(DependencyObject sender, RoutedEventArgs args)  
       at System.Windows.UIElement.RaiseEvent(RoutedEventArgs args, Boolean trusted)  
       at System.Windows.Input.InputManager.ProcessStagingArea()  
       at System.Windows.Input.InputManager.ProcessInput(InputEventArgs input)  
       at System.Windows.Input.KeyboardDevice.ChangeFocus(DependencyObject focus, Int32 timestamp)  
       at System.Windows.Input.KeyboardDevice.TryChangeFocus(DependencyObject newFocus, IKeyboardInputProvider keyboardInputProvider, Boolean askOld, Boolean askNew, Boolean forceToNullIfFailed)  
       at System.Windows.Input.KeyboardDevice.Focus(DependencyObject focus, Boolean askOld, Boolean askNew)  
       at System.Windows.Input.KeyboardDevice.Focus(IInputElement element)  
       at System.Windows.Input.Keyboard.Focus(IInputElement element)  
       at Telerik.Windows.Controls.GridView.GridViewCell.GridViewCell_MouseLeftButtonUp(Object sender, MouseButtonEventArgs e) in r:\WPF_Scrum\WPF_Team\Sources\Development\WPF\GridView\GridView\Cells\GridViewCell.cs:line 515  
       at System.Windows.Input.MouseButtonEventArgs.InvokeEventHandler(Delegate genericHandler, Object genericTarget)  
       at System.Windows.RoutedEventArgs.InvokeHandler(Delegate handler, Object target)  
       at System.Windows.RoutedEventHandlerInfo.InvokeHandler(Object target, RoutedEventArgs routedEventArgs)  
       at System.Windows.EventRoute.InvokeHandlersImpl(Object source, RoutedEventArgs args, Boolean reRaised)  
       at System.Windows.UIElement.ReRaiseEventAs(DependencyObject sender, RoutedEventArgs args, RoutedEvent newEvent)  
       at System.Windows.UIElement.CrackMouseButtonEventAndReRaiseEvent(DependencyObject sender, MouseButtonEventArgs e)  
       at System.Windows.UIElement.OnMouseUpThunk(Object sender, MouseButtonEventArgs e)  
       at System.Windows.Input.MouseButtonEventArgs.InvokeEventHandler(Delegate genericHandler, Object genericTarget)  
       at System.Windows.RoutedEventArgs.InvokeHandler(Delegate handler, Object target)  
       at System.Windows.RoutedEventHandlerInfo.InvokeHandler(Object target, RoutedEventArgs routedEventArgs)  
       at System.Windows.EventRoute.InvokeHandlersImpl(Object source, RoutedEventArgs args, Boolean reRaised)  
       at System.Windows.UIElement.RaiseEventImpl(DependencyObject sender, RoutedEventArgs args)  
       at System.Windows.UIElement.RaiseEvent(RoutedEventArgs args, Boolean trusted)  
       at System.Windows.Input.InputManager.ProcessStagingArea()  
       at System.Windows.Input.InputManager.ProcessInput(InputEventArgs input)  
       at System.Windows.Input.InputProviderSite.ReportInput(InputReport inputReport)  
       at System.Windows.Interop.HwndMouseInputProvider.ReportInput(IntPtr hwnd, InputMode mode, Int32 timestamp, RawMouseActions actions, Int32 x, Int32 y, Int32 wheel)  
       at System.Windows.Interop.HwndMouseInputProvider.FilterMessage(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)  
       at System.Windows.Interop.HwndSource.InputFilterMessage(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 WpfApplication2.App.Main() in C:\Examples\wpfTelerik\WpfApplication2\obj\Debug\App.g.vb:line 62  
       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.Reflection.TargetInvocationException  
       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.RoutedEventArgs.InvokeEventHandler(Delegate genericHandler, Object genericTarget)  
            at System.Windows.RoutedEventArgs.InvokeHandler(Delegate handler, Object target)  
            at System.Windows.RoutedEventHandlerInfo.InvokeHandler(Object target, RoutedEventArgs routedEventArgs)  
            at System.Windows.EventRoute.InvokeHandlersImpl(Object source, RoutedEventArgs args, Boolean reRaised)  
            at System.Windows.UIElement.RaiseEventImpl(DependencyObject sender, RoutedEventArgs args)  
            at System.Windows.UIElement.RaiseEvent(RoutedEventArgs e)  
            at Telerik.Windows.Controls.GridView.GridViewRow.HandleValueChangedAfterEdit(RadRoutedEventArgs editEventArgs, RecordsChangeListener changeListener) in r:\WPF_Scrum\WPF_Team\Sources\Development\WPF\GridView\GridView\Rows\GridViewRow.cs:line 534  
            at Telerik.Windows.Controls.GridView.GridViewRow.Cell_EditCommitted(Object sender, CellRoutedEventArgs e) in r:\WPF_Scrum\WPF_Team\Sources\Development\WPF\GridView\GridView\Rows\GridViewRow.cs:line 554  
       InnerException: System.ArgumentNullException  
            Message="Value cannot be null.\r\nParameter name: fieldName" 
            Source="Telerik.Windows.Controls.GridView" 
            ParamName="fieldName" 
            StackTrace:  
                 at Telerik.Windows.Controls.GridView.GridViewDataControl.DataError(Object sender, DataErrorEventArgs args) in r:\WPF_Scrum\WPF_Team\Sources\Development\WPF\GridView\GridView\GridViewDataControl.cs:line 929  
            InnerException:   
 


Can you advise?


Thanks


P
Vlad
Telerik team
 answered on 17 Feb 2009
Narrow your results
Selected tags
Tags
GridView
General Discussions
Chart
RichTextBox
Docking
ScheduleView
ChartView
TreeView
Diagram
Map
ComboBox
TreeListView
Window
RibbonView and RibbonWindow
PropertyGrid
DragAndDrop
TabControl
TileView
Carousel
DataForm
PDFViewer
MaskedInput (Numeric, DateTime, Text, Currency)
AutoCompleteBox
DatePicker
Buttons
ListBox
GanttView
PivotGrid
Spreadsheet
Gauges
NumericUpDown
PanelBar
DateTimePicker
DataFilter
Menu
ContextMenu
TimeLine
Calendar
Installer and Visual Studio Extensions
ImageEditor
BusyIndicator
Expander
Slider
TileList
PersistenceFramework
DataPager
Styling
TimeBar
OutlookBar
TransitionControl
FileDialogs
Book
ToolBar
ColorPicker
TimePicker
MultiColumnComboBox
SyntaxEditor
VirtualGrid
Wizard
ExpressionEditor
NavigationView (Hamburger Menu)
WatermarkTextBox
DesktopAlert
BarCode
SpellChecker
DataServiceDataSource
EntityFrameworkDataSource
RadialMenu
ChartView3D
Data Virtualization
BreadCrumb
ProgressBar
Sparkline
LayoutControl
TabbedWindow
ToolTip
CloudUpload
ColorEditor
TreeMap and PivotMap
EntityFrameworkCoreDataSource (.Net Core)
HeatMap
Chat (Conversational UI)
VirtualizingWrapPanel
Calculator
NotifyIcon
TaskBoard
TimeSpanPicker
BulletGraph
Licensing
WebCam
CardView
DataBar
FilePathPicker
PasswordBox
Rating
SplashScreen
Accessibility
Callout
CollectionNavigator
Localization
AutoSuggestBox
Security
VirtualKeyboard
HighlightTextBlock
TouchManager
StepProgressBar
Badge
OfficeNavigationBar
ExpressionParser
CircularProgressBar
SvgImage
PipsPager
SlideView
AI Coding Assistant
+? more
Top users last month
Top achievements
Rank 1
Iron
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
ivory
Top achievements
Rank 1
Iron
Nurik
Top achievements
Rank 2
Iron
Iron
YF
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Top achievements
Rank 1
Iron
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
ivory
Top achievements
Rank 1
Iron
Nurik
Top achievements
Rank 2
Iron
Iron
YF
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?