Telerik Forums
UI for WPF Forum
3 answers
196 views
Hi,
I seem to be unable to get the databinding to work so that, for example, the background colour of a grid cell is set to the colour property of a business object. Please can someone take a look and show me the error of my ways?

ORM version 2013.2.702.1
RadControls for WPF version 2013.2.724.40

In summary, I am getting a list back from the database using a stored procedure mapped to a domain method. I have also added a partial class and a transient property to the result item in my ORM library. This transient property is a System.Windows.Media.Color and the values are stored in an XML file that are merged with the database result by my view model prior to the view being presented.

In my attempt to understand why the colour is not set, I am showing the ToString result in the cell so I know the colour value is present, however, the colour of the cell remains white.

Here's my ORM partial class:
using System;
using System.Linq;
using System.Windows.Media;
 
namespace xyz
{
    public partial class DBLISTitem
    {
        [Telerik.OpenAccess.Transient]
        private Color _patternColour;
        public Color PatternColour
        {
            get
            {
                return _patternColour;
            }
            set
            {
                _patternColour = value;
            }
        }
    }
}

Here's the XAML cut down for brevity:
<UserControl x:Class="..."
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:telerik="http://schemas.telerik.com/2008/xaml/presentation"
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
             mc:Ignorable="d"
             d:DesignHeight="300" d:DesignWidth="300">
    <Grid>
        <Grid.ColumnDefinitions>
            <ColumnDefinition />
            <ColumnDefinition Width="5"/>
            <ColumnDefinition Width="*"/>
        </Grid.ColumnDefinitions>
        <Grid.RowDefinitions>
            <RowDefinition Height="*" />
            <RowDefinition Height="30"/>
            <RowDefinition Height="30"/>
        </Grid.RowDefinitions>
        <Grid.Resources>
            <telerik:ColorToBrushConverter x:Key="ColorToBrushConverter" />
        </Grid.Resources>
 
        <telerik:RadGridView Name="ocyMapyGrid" Grid.Column="0" Grid.Row="0" Grid.ColumnSpan="3"
                             HorizontalAlignment="Left" VerticalAlignment="Stretch" Width="Auto" IsFilteringAllowed="False" CanUserSortColumns="True" CanUserSortGroups="True" 
                             ItemsSource="{Binding DBLIST, Mode=TwoWay}" AutoGenerateColumns="False" ShowGroupPanel="False"
                             ShowInsertRow="False"
                             RowHeight="23" RowIndicatorVisibility="Collapsed" ScrollViewer.HorizontalScrollBarVisibility="Disabled"
                             CanUserFreezeColumns="False" CanUserReorderColumns="False" CanUserResizeColumns="True"
                             >
                <telerik:RadGridView.Columns>
                <telerik:GridViewDataColumn DataMemberBinding="{Binding ColName}" Header="Col1" Width="*" />
                <telerik:GridViewDataColumn Header="Colour" Width="150">
                    <telerik:GridViewDataColumn.CellTemplate>
                        <DataTemplate>
                            <TextBlock Text="{Binding Path=PatternColour}" Background="{Binding Path=PatternColour, Converter={StaticResource ColorToBrushConverter}}" Margin="0" />
                        </DataTemplate>
                    </telerik:GridViewDataColumn.CellTemplate>
                </telerik:GridViewDataColumn>
            </telerik:RadGridView.Columns>
        </telerik:RadGridView>
    </Grid>
</UserControl>

I've attached a sample of the output view.

I've since worked on a very simple test project to try to reproduce the problem but I cannot. The test app works. I changed the cell template in the problem app to match the working test app as follows:
<telerik:GridViewDataColumn.CellTemplate>
    <DataTemplate>
        <TextBlock Text="{Binding Path=HatchPatternColour}" Margin="0">
            <TextBlock.Background>
                <SolidColorBrush Color="{Binding Path=HatchPatternColour}" />
            </TextBlock.Background>
        </TextBlock>
    </DataTemplate>
</telerik:GridViewDataColumn.CellTemplate>
This made no difference. The backgound color remains white.

Further to this, I've increased the trace level to high and get this output for the SolidColorBrush binding:
System.Windows.Data Warning: 54 : Created BindingExpression (hash=20902088) for Binding (hash=2322454)
System.Windows.Data Warning: 56 :   Path: 'HatchPatternColour'
System.Windows.Data Warning: 58 : BindingExpression (hash=20902088): Default mode resolved to OneWay
System.Windows.Data Warning: 59 : BindingExpression (hash=20902088): Default update trigger resolved to PropertyChanged
System.Windows.Data Warning: 60 : BindingExpression (hash=20902088): Attach to System.Windows.Media.SolidColorBrush.Color (hash=53901065)
System.Windows.Data Warning: 62 : BindingExpression (hash=20902088): Use Framework mentor <null>
System.Windows.Data Warning: 65 : BindingExpression (hash=20902088): Resolving source 
System.Windows.Data Warning: 67 : BindingExpression (hash=20902088): Framework mentor not found
System.Windows.Data Warning: 63 : BindingExpression (hash=20902088): Resolve source deferred
System.Windows.Data Warning: 93 : BindingExpression (hash=20902088): Got InheritanceContextChanged event from SolidColorBrush (hash=53901065)
System.Windows.Data Warning: 65 : BindingExpression (hash=20902088): Resolving source 
System.Windows.Data Warning: 68 : BindingExpression (hash=20902088): Found data context element: TextBlock (hash=15347538) (OK)
System.Windows.Data Warning: 69 : BindingExpression (hash=20902088): DataContext is null
System.Windows.Data Warning: 65 : BindingExpression (hash=20902088): Resolving source 
System.Windows.Data Warning: 68 : BindingExpression (hash=20902088): Found data context element: TextBlock (hash=15347538) (OK)
System.Windows.Data Warning: 76 : BindingExpression (hash=20902088): Activate with root item TopLevelAccountCode (hash=28952916)
System.Windows.Data Warning: 106 : BindingExpression (hash=20902088):   At level 0 - for TopLevelAccountCode.HatchPatternColour found accessor ReflectPropertyDescriptor(HatchPatternColour)
System.Windows.Data Warning: 102 : BindingExpression (hash=20902088): Replace item at level 0 with TopLevelAccountCode (hash=28952916), using accessor ReflectPropertyDescriptor(HatchPatternColour)
System.Windows.Data Warning: 99 : BindingExpression (hash=20902088): GetValue at level 0 from TopLevelAccountCode (hash=28952916) using ReflectPropertyDescriptor(HatchPatternColour): Color (hash=1871599772)
System.Windows.Data Warning: 78 : BindingExpression (hash=20902088): TransferValue - got raw value Color (hash=1871599772)
System.Windows.Data Warning: 87 : BindingExpression (hash=20902088): TransferValue - using final value Color (hash=1871599772)
Doesn't this show that it has found the Color property?

Any suggestions please?

Thanks
Craig

Craig
Top achievements
Rank 1
 answered on 16 Oct 2013
1 answer
350 views
Hello.
I'm a beginner.
I think it's kind of difficult to make program related to Log-in stuff to me.
Do you have a plan to support Wpf Login Control.
Yana
Telerik team
 answered on 16 Oct 2013
1 answer
311 views
Hi,

I have a chart like the one in the attached image, this is the code:

<telerik:RadCartesianChart Name="CartesianChartDemo" Margin="10">
            <telerik:RadCartesianChart.Behaviors>
                <telerik:ChartPanAndZoomBehavior PanMode="Both" ZoomMode="Both"/>
            </telerik:RadCartesianChart.Behaviors>
        </telerik:RadCartesianChart>

CartesianChartDemo.VerticalAxis = new LinearAxis();
CartesianChartDemo.HorizontalAxis = new CategoricalAxis();
 
CartesianChartDemo.Grid = new CartesianChartGrid() { MajorLinesVisibility = GridLineVisibility.XY };
 
DataTable dtAlloys = new DataTable("DATA");
 
dtAlloys.Columns.Add(new DataColumn("Name", typeof(string)));
dtAlloys.Columns.Add(new DataColumn("Value1", typeof(double)));
dtAlloys.Columns.Add(new DataColumn("Value2", typeof(double)));
 
dtAlloys.Rows.Add(new object[] { "Value1", 70, 30 });
dtAlloys.Rows.Add(new object[] { "Value2", 15, 85 });
dtAlloys.Rows.Add(new object[] { "Value3", 50, 50 });
 
BarSeries barSer = new BarSeries();
barSer.ShowLabels = true;
barSer.CombineMode = ChartSeriesCombineMode.Stack100;
 
BarSeries barSer2 = new BarSeries();
barSer2.ShowLabels = true;
barSer2.CombineMode = ChartSeriesCombineMode.Stack100;
 
foreach (DataRow drAlloy in dtAlloys.Rows)
{
    barSer.DataPoints.Add(new CategoricalDataPoint() { Category = drAlloy["Name"], Label = string.Format("{0:N}", drAlloy["Value1"]), Value = double.Parse(drAlloy["Value1"].ToString()) });
    barSer2.DataPoints.Add(new CategoricalDataPoint() { Category = drAlloy["Name"], Label = string.Format("{0:N}", drAlloy["Value2"]), Value = double.Parse(drAlloy["Value2"].ToString()) });
    
}
 
CartesianChartDemo.Series.Clear();
CartesianChartDemo.Series.Add(barSer);
CartesianChartDemo.Series.Add(barSer2);

I am trying to use the MouseDown event to do something like show an alert with bar info or open a new window and pass it data from that bar that I am clicking.

How can I obtain the data of the bar that I am clicking?

It is ok to use that event or should I use another one?

Thanks,

Alberto



Petar Kirov
Telerik team
 answered on 16 Oct 2013
1 answer
131 views
I have byte array data in which it contains text and images.
Now i want to show that byte array into table paragraph.
I tired it with InlineImage  by converting byte array to stream but its not working

is there any option to show such a byte array containing of image and text together?

Thanx in advance
Petya
Telerik team
 answered on 15 Oct 2013
5 answers
417 views
I'm trying to implement paste functionality into my GridView, but have run into 2 issues.

First, even if the Grid is set with SelectionUnit="FullRow" SelectionMode="Single", after a paste occurs the top row where the data was pasted remains selected. I can then select another row, ending up with multiple-rows selected. Subsequent pastes start at the top-most selected row, even if it's not the most recently selected row. Therefore, in addition to a very strange display (with multiple rows selected and no apparent way to unselect them), you can never paste data into rows below where you have previously pasted data.

The second issue is that the InsertNewRows value of GridViewClipboardPasteMode no longer appears to be present, such that pasting data when not enough rows exist to accommodate truncates the paste.

For reference, the options I'm using are:

       <telerik:RadGridView Grid.Row="0"  x:Name="HistoricalGridView" AutoGenerateColumns="False" ItemsSource="{Binding Path=HistoricalData}" 
                                 IsFilteringAllowed="False" ShowGroupPanel="False" CanUserSortColumns="False" 
                              ClipboardPasteMode="OverwriteWithEmptyValues,Cells" SelectionUnit="FullRow" SelectionMode="Single" >

Thanks for your help on these.

Louis
Maya
Telerik team
 answered on 15 Oct 2013
1 answer
136 views
Hi,

I have a radTreeView defined with its context menu in resources::

<UserControl.Resources>
    <sampleData:c_treeViewData x:Key="DataSource"/>
    <Style x:Key="ItemContainerStyle" TargetType="telerik:RadTreeViewItem">
        <Setter Property="IsExpanded" Value="True"/>
    </Style>
    <DataTemplate x:Key="ItemEditTemplate">
        <Grid>
 
            <StackPanel Orientation="Horizontal">
                <TextBox Text="{Binding Name, Mode=TwoWay}"/>
            </StackPanel>
 
        </Grid>
    </DataTemplate>
     
    <DataTemplate x:Key="c_proprietyValue">
        <TextBlock Text="{Binding Name}" FontSize="14" TextWrapping="Wrap" Width="200" />
    </DataTemplate>
 
 
    <HierarchicalDataTemplate x:Key="c_proprietyType" ItemTemplate="{StaticResource c_proprietyValue}"
       ItemsSource="{Binding propretyValues}">
        <StackPanel Orientation="Horizontal">
        <Image Source="{Binding Image}" Margin=" 0,0,6,0" Height="20" Width="20" />
        <TextBlock Text="{Binding Name}" FontWeight="Bold" FontSize="14">
              <telerik:RadContextMenu.ContextMenu >
                    <telerik:RadContextMenu Name="rcm_context1" Opened="RadContextMenu_Opened">
                    <telerik:RadMenuItem Name="Delete" Header="Delete" />
                    <telerik:RadMenuItem Name="Contraer" Header="Collapse tree" />
                    <telerik:RadMenuItem Name="Expandir" Header="Expand tree" />
                </telerik:RadContextMenu>
              </telerik:RadContextMenu.ContextMenu>
             
        </TextBlock>
        </StackPanel>
    </HierarchicalDataTemplate>
 
    <HierarchicalDataTemplate x:Key="c_block" ItemTemplate="{StaticResource c_proprietyType}"
       ItemsSource="{Binding propretyTypes}" >
        <StackPanel Orientation="Horizontal">
            <Image Source="{Binding Image}" Margin=" 0,0,6,0" Height="20" Width="20" />
             
            <TextBlock Text="{Binding Name}" FontWeight="Bold" FontSize="16" HorizontalAlignment="Stretch">
             
    <telerik:RadContextMenu.ContextMenu>
        <telerik:RadContextMenu Opened="RadContextMenu_Opened">
            <telerik:RadMenuItem Name="Rename" Header="Rename" />
            <telerik:RadMenuItem Name="Delete" Header="Delete" />
            <telerik:RadMenuItem Name="Contraer" Header="Collapse tree" />
            <telerik:RadMenuItem Name="Expandir" Header="Expand tree" />
        </telerik:RadContextMenu>
    </telerik:RadContextMenu.ContextMenu>
 
            </TextBlock>
 
        </StackPanel>
    </HierarchicalDataTemplate>
 
 
 
</UserControl.Resources>


I want to access the context menu to change the headers of the items depending on the country. 
Can you help me, please? I'm using VB.NET

Thanks

Daniel
Top achievements
Rank 1
 answered on 15 Oct 2013
6 answers
237 views
Hello, I have problem with my radGridView. When I delete or add new rows, gridview scroll items to the top. But I don't need it. How can I fix it ?
Yoan
Telerik team
 answered on 15 Oct 2013
2 answers
430 views
Hello,

I am creating an application where I need to have 4 RadWindows and each window has assigned a UserControl to its content.
I was taking a look to the window examples in the WPF Demo so I took some code from there, this is how I created the windows:
RadWindow window = new RadWindow();
        RadWindow window2 = new RadWindow();
        RadWindow window3 = new RadWindow();
        RadWindow window4 = new RadWindow();
 
        public MainWindow()
        {
            InitializeComponent();
 
            window.Header = "Window1";
            window.Owner = Application.Current.MainWindow;
            window.CanClose = false;
 
            window2.Header = "Window2";
            window2.Owner = Application.Current.MainWindow;
            window2.CanClose = false;
 
            window3.Header = "Window3";
            window3.Owner = Application.Current.MainWindow;
            window3.CanClose = false;
 
            window4.Header = "Window4";
            window4.Owner = Application.Current.MainWindow;
            window4.CanClose = false;
                         
            this.Loaded += OnExampleLoaded;
            this.Unloaded += OnExampleUnloaded;
 
        }


void OnExampleUnloaded(object sender, RoutedEventArgs e)
        {
            window.Close();
            window2.Close();
            window3.Close();
            window4.Close();
        }
 
        void OnExampleLoaded(object sender, RoutedEventArgs e)
        {
            double dblHeight = (this.ActualHeight / 2) - 15;
            double dblWidth = (this.ActualWidth / 2) - 20;
 
            window.Height = dblHeight;
            window.Width = dblWidth;
 
            window2.Height = dblHeight;
            window2.Width = dblWidth;
 
            window3.Height = dblHeight;
            window3.Width = dblWidth;
 
            window4.Height = dblHeight;
            window4.Width = dblWidth;
 
            window.Left = 10;
            window.Top = 34;
 
            window2.Left = dblWidth + 20;
            window2.Top = 34;
 
            window3.Left = 10;
            window3.Top = dblHeight + 44;
 
            window4.Left = dblWidth + 20;
            window4.Top = dblHeight + 44;
 
            window2.Content = new MyControl();
 
            window.Show();
            window2.Show();
            window3.Show();
            window4.Show();
        }

And the first attached image is how this look.

MyControl has 3 charts and a label:

<UserControl
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
             xmlns:telerik="http://schemas.telerik.com/2008/xaml/presentation" x:Class="ScoreBoard.MyControl"
             mc:Ignorable="d" Height="358.566" Width="391.232">
    <Grid Margin="0,10,10,10">
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto" />
            <RowDefinition Height="132*"/>
            <RowDefinition Height="133*"/>
            <RowDefinition Height="27*"/>
        </Grid.RowDefinitions>
 
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="*" />
            <ColumnDefinition Width="*" />
        </Grid.ColumnDefinitions>
 
               
        <telerik:Label Content="Times" Margin="10,9,10,10" FontSize="36" FontWeight="Bold" HorizontalContentAlignment="Center" Grid.ColumnSpan="2"/>
 
        <telerik:RadCartesianChart x:Name="chartTimes1" Margin="10" Grid.Row="1" FontSize="11" FontWeight="Normal" >
            <telerik:RadCartesianChart.Behaviors>
                <telerik:ChartPanAndZoomBehavior PanMode="Both" ZoomMode="Both"/>
            </telerik:RadCartesianChart.Behaviors>
        </telerik:RadCartesianChart>
 
        <telerik:RadCartesianChart x:Name="chartTimes2" Margin="10" Grid.Row="2" FontSize="11" FontWeight="Normal" Grid.RowSpan="2" >
            <telerik:RadCartesianChart.Behaviors>
                <telerik:ChartPanAndZoomBehavior PanMode="Both" ZoomMode="Both"/>
            </telerik:RadCartesianChart.Behaviors>
        </telerik:RadCartesianChart>
        <telerik:RadCartesianChart Grid.Column="1" Margin="10" Grid.Row="1">
            <telerik:RadCartesianChart.HorizontalAxis>
                <telerik:CategoricalAxis/>
            </telerik:RadCartesianChart.HorizontalAxis>
            <telerik:RadCartesianChart.VerticalAxis>
                <telerik:LinearAxis/>
            </telerik:RadCartesianChart.VerticalAxis>
            <telerik:BarSeries>
                <telerik:BarSeries.DataPoints>
                    <telerik:CategoricalDataPoint Category="{x:Null}" IsSelected="False" Label="10" Value="10"/>
                    <telerik:CategoricalDataPoint Category="{x:Null}" IsSelected="False" Label="20" Value="20"/>
                    <telerik:CategoricalDataPoint Category="{x:Null}" IsSelected="False" Label="30" Value="30"/>
                </telerik:BarSeries.DataPoints>
            </telerik:BarSeries>
        </telerik:RadCartesianChart>
 
    </Grid>
</UserControl>

In the design of MyControl I change the size of the control and the charts changes its size whether I make it smaller or larger, as you can see in the image MyControl.

But when I assign MyControl to the window content and I change the size of the window, the control appears to be fixed in the center but It doesn't change its size.

Do I need to configure or assign MyControl in a different way?

Regards,

Alberto


Alberto
Top achievements
Rank 1
 answered on 15 Oct 2013
6 answers
167 views
Hello,

I am using a RadBook in kombination with the RadDataPager in my application. I added 55 pages from Word (.png) statically, like this:

        <telerik:RadDataPager x:Name="radDataPager1" Source="{Binding PagedItems, ElementName=book1}" Margin="-1000,585,168,0" VerticalAlignment="Top" Width="1464" HorizontalAlignment="Right" Grid.Column="1"  Grid.ColumnSpan="2" DisplayMode="All"  />
        <telerik:RadBook x:Name="book1" HardPages="None" FoldSize="300,150" Margin="-1000,142.5,168,0" RightPageIndex="55" Grid.ColumnSpan="2" HorizontalAlignment="Right" Width="1464" d:LayoutOverrides="GridBox" Height="443" VerticalAlignment="Top" Grid.Column="1">
            <telerik:RadBookItem>
                <Image Source="/FuelOPTBA20;component/Images/1.png"></Image>
            </telerik:RadBookItem>
            <telerik:RadBookItem>
                <Image Source="/FuelOPTBA20;component/Images/2.png"></Image>
            </telerik:RadBookItem>
            <telerik:RadBookItem>
                <Image Source="/FuelOPTBA20;component/Images/3.png"></Image>
            </telerik:RadBookItem>
                            .
                            .
                            .

                            .

            <telerik:RadBookItem>
                <Image Source="/FuelOPTBA20;component/Images/53.png"></Image>
            </telerik:RadBookItem>
            <telerik:RadBookItem>
                <Image Source="/FuelOPTBA20;component/Images/54.png"></Image>
            </telerik:RadBookItem>
            <telerik:RadBookItem>
                <Image Source="/FuelOPTBA20;component/Images/55.png"></Image>
            </telerik:RadBookItem>
        </telerik:RadBook>



when I start the application and press the << or >> button of the DataPager the program throws an null pointer exception:

System.NullReferenceException wurde nicht behandelt.
  HResult=-2147467261
  Message=Der Objektverweis wurde nicht auf eine Objektinstanz festgelegt.
  Source=Telerik.Windows.Controls.Navigation
  StackTrace:
       bei Telerik.Windows.Controls.RadBook.OnCurrentSheetIndexChanged(Int32 newValue, Int32 oldValue) in c:\TB\221\WPF_Scrum\Release_WPF\Sources\Development\Controls\Navigation\Book\RadBook.cs:Zeile 1302.
       bei Telerik.Windows.Controls.RadBook.set_CurrentSheetIndex(Int32 value) in c:\TB\221\WPF_Scrum\Release_WPF\Sources\Development\Controls\Navigation\Book\RadBook.cs:Zeile 528.
       bei Telerik.Windows.Controls.RadBook.OnRightPageIndexChanged(Int32 rightPageIndex) in c:\TB\221\WPF_Scrum\Release_WPF\Sources\Development\Controls\Navigation\Book\RadBook.cs:Zeile 2274.
       bei Telerik.Windows.Controls.RadBook.OnRightPageIndexPropertyChanged(DependencyObject d, DependencyPropertyChangedEventArgs e) in c:\TB\221\WPF_Scrum\Release_WPF\Sources\Development\Controls\Navigation\Book\RadBook.cs:Zeile 1195.
       bei System.Windows.DependencyObject.OnPropertyChanged(DependencyPropertyChangedEventArgs e)
       bei System.Windows.FrameworkElement.OnPropertyChanged(DependencyPropertyChangedEventArgs e)
       bei System.Windows.DependencyObject.NotifyPropertyChange(DependencyPropertyChangedEventArgs args)
       bei System.Windows.DependencyObject.UpdateEffectiveValue(EntryIndex entryIndex, DependencyProperty dp, PropertyMetadata metadata, EffectiveValueEntry oldEntry, EffectiveValueEntry& newEntry, Boolean coerceWithDeferredReference, Boolean coerceWithCurrentValue, OperationType operationType)
       bei System.Windows.DependencyObject.SetValueCommon(DependencyProperty dp, Object value, PropertyMetadata metadata, Boolean coerceWithDeferredReference, Boolean coerceWithCurrentValue, OperationType operationType, Boolean isInternal)
       bei System.Windows.DependencyObject.SetValue(DependencyProperty dp, Object value)
       bei Telerik.Windows.Controls.RadBook.set_RightPageIndex(Int32 value) in c:\TB\221\WPF_Scrum\Release_WPF\Sources\Development\Controls\Navigation\Book\RadBook.cs:Zeile 353.
       bei Telerik.Windows.Controls.RadBook.NavigateToPage(PageToNavigateTo pageToNavigateTo) in c:\TB\221\WPF_Scrum\Release_WPF\Sources\Development\Controls\Navigation\Book\RadBook.cs:Zeile 2240.
       bei Telerik.Windows.Controls.RadBook.FirstPage() in c:\TB\221\WPF_Scrum\Release_WPF\Sources\Development\Controls\Navigation\Book\RadBook.cs:Zeile 616.
       bei Telerik.Windows.Controls.Book.BookPagedCollectionView.MoveToFirstPage() in c:\TB\221\WPF_Scrum\Release_WPF\Sources\Development\Controls\Navigation\Book\BookPagedCollectionView.cs:Zeile 143.
       bei Telerik.Windows.Controls.Data.DataPager.DataPagerViewModel.MoveToFirstPage() in c:\TB\221\WPF_Scrum\Release_WPF\Sources\Development\Controls\Data\DataPager\DataPagerViewModel.cs:Zeile 183.
       bei Telerik.Windows.Controls.RadDataPager.<>c__DisplayClass1.<MoveToPage>b__0(Int32 i) in c:\TB\221\WPF_Scrum\Release_WPF\Sources\Development\Controls\Data\DataPager\RadDataPager.cs:Zeile 940.
       bei Telerik.Windows.Controls.RadDataPager.MoveToPage(Int32 pageIndex, Func`2 pageMoveOperation) in c:\TB\221\WPF_Scrum\Release_WPF\Sources\Development\Controls\Data\DataPager\RadDataPager.cs:Zeile 972.
       bei Telerik.Windows.Controls.RadDataPager.MoveToPage(Int32 pageIndex, Func`1 pageMoveOperation) in c:\TB\221\WPF_Scrum\Release_WPF\Sources\Development\Controls\Data\DataPager\RadDataPager.cs:Zeile 940.
       bei Telerik.Windows.Controls.RadDataPager.MoveToFirstPage() in c:\TB\221\WPF_Scrum\Release_WPF\Sources\Development\Controls\Data\DataPager\RadDataPager.cs:Zeile 841.
       bei Telerik.Windows.Controls.RadDataPager.OnMoveToFirstPage(Object sender, ExecutedRoutedEventArgs e) in c:\TB\221\WPF_Scrum\Release_WPF\Sources\Development\Controls\Data\DataPager\RadDataPager.Commands.cs:Zeile 52.
       bei System.Windows.Input.CommandBinding.OnExecuted(Object sender, ExecutedRoutedEventArgs e)
       bei System.Windows.Input.CommandManager.ExecuteCommandBinding(Object sender, ExecutedRoutedEventArgs e, CommandBinding commandBinding)
       bei System.Windows.Input.CommandManager.FindCommandBinding(CommandBindingCollection commandBindings, Object sender, RoutedEventArgs e, ICommand command, Boolean execute)
       bei System.Windows.Input.CommandManager.FindCommandBinding(Object sender, RoutedEventArgs e, ICommand command, Boolean execute)
       bei System.Windows.Input.CommandManager.OnExecuted(Object sender, ExecutedRoutedEventArgs e)
       bei System.Windows.UIElement.OnExecutedThunk(Object sender, ExecutedRoutedEventArgs e)
       bei System.Windows.Input.ExecutedRoutedEventArgs.InvokeEventHandler(Delegate genericHandler, Object target)
       bei System.Windows.RoutedEventArgs.InvokeHandler(Delegate handler, Object target)
       bei System.Windows.RoutedEventHandlerInfo.InvokeHandler(Object target, RoutedEventArgs routedEventArgs)
       bei System.Windows.EventRoute.InvokeHandlersImpl(Object source, RoutedEventArgs args, Boolean reRaised)
       bei System.Windows.UIElement.RaiseEventImpl(DependencyObject sender, RoutedEventArgs args)
       bei System.Windows.UIElement.RaiseEvent(RoutedEventArgs args, Boolean trusted)
       bei System.Windows.Input.RoutedCommand.ExecuteImpl(Object parameter, IInputElement target, Boolean userInitiated)
       bei System.Windows.Input.RoutedCommand.ExecuteCore(Object parameter, IInputElement target, Boolean userInitiated)
       bei MS.Internal.Commands.CommandHelpers.CriticalExecuteCommandSource(ICommandSource commandSource, Boolean userInitiated)
       bei System.Windows.Controls.Primitives.ButtonBase.OnClick()
       bei System.Windows.Controls.Button.OnClick()
       bei Telerik.Windows.Controls.RadButton.OnClick() in c:\TB\221\WPF_Scrum\Release_WPF\Sources\Development\Core\Controls\Buttons\RadButton.cs:Zeile 398.
       bei System.Windows.Controls.Primitives.ButtonBase.OnMouseLeftButtonUp(MouseButtonEventArgs e)
       bei System.Windows.UIElement.OnMouseLeftButtonUpThunk(Object sender, MouseButtonEventArgs e)
       bei System.Windows.Input.MouseButtonEventArgs.InvokeEventHandler(Delegate genericHandler, Object genericTarget)
       bei System.Windows.RoutedEventArgs.InvokeHandler(Delegate handler, Object target)
       bei System.Windows.RoutedEventHandlerInfo.InvokeHandler(Object target, RoutedEventArgs routedEventArgs)
       bei System.Windows.EventRoute.InvokeHandlersImpl(Object source, RoutedEventArgs args, Boolean reRaised)
       bei System.Windows.UIElement.ReRaiseEventAs(DependencyObject sender, RoutedEventArgs args, RoutedEvent newEvent)
       bei System.Windows.UIElement.OnMouseUpThunk(Object sender, MouseButtonEventArgs e)
       bei System.Windows.Input.MouseButtonEventArgs.InvokeEventHandler(Delegate genericHandler, Object genericTarget)
       bei System.Windows.RoutedEventArgs.InvokeHandler(Delegate handler, Object target)
       bei System.Windows.RoutedEventHandlerInfo.InvokeHandler(Object target, RoutedEventArgs routedEventArgs)
       bei System.Windows.EventRoute.InvokeHandlersImpl(Object source, RoutedEventArgs args, Boolean reRaised)
       bei System.Windows.UIElement.RaiseEventImpl(DependencyObject sender, RoutedEventArgs args)
       bei System.Windows.UIElement.RaiseTrustedEvent(RoutedEventArgs args)
       bei System.Windows.UIElement.RaiseEvent(RoutedEventArgs args, Boolean trusted)
       bei System.Windows.Input.InputManager.ProcessStagingArea()
       bei System.Windows.Input.InputManager.ProcessInput(InputEventArgs input)
       bei System.Windows.Input.InputProviderSite.ReportInput(InputReport inputReport)
       bei System.Windows.Interop.HwndMouseInputProvider.ReportInput(IntPtr hwnd, InputMode mode, Int32 timestamp, RawMouseActions actions, Int32 x, Int32 y, Int32 wheel)
       bei System.Windows.Interop.HwndMouseInputProvider.FilterMessage(IntPtr hwnd, WindowMessage msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
       bei System.Windows.Interop.HwndSource.InputFilterMessage(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
       bei MS.Win32.HwndWrapper.WndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
       bei MS.Win32.HwndSubclass.DispatcherCallbackOperation(Object o)
       bei System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs)
       bei MS.Internal.Threading.ExceptionFilterHelper.TryCatchWhen(Object source, Delegate method, Object args, Int32 numArgs, Delegate catchHandler)
       bei System.Windows.Threading.Dispatcher.LegacyInvokeImpl(DispatcherPriority priority, TimeSpan timeout, Delegate method, Object args, Int32 numArgs)
       bei MS.Win32.HwndSubclass.SubclassWndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam)
       bei MS.Win32.UnsafeNativeMethods.DispatchMessage(MSG& msg)
       bei System.Windows.Threading.Dispatcher.PushFrameImpl(DispatcherFrame frame)
       bei System.Windows.Threading.Dispatcher.PushFrame(DispatcherFrame frame)
       bei System.Windows.Threading.Dispatcher.Run()
       bei System.Windows.Application.RunDispatcher(Object ignore)
       bei System.Windows.Application.RunInternal(Window window)
       bei System.Windows.Application.Run(Window window)
       bei System.Windows.Application.Run()
       bei FuelOPTBA20.App.Main() in c:\Projects\GIT\FuelOPTBA20\FuelOPTBA20\obj\x86\Debug\App.g.cs:Zeile 0.
       bei System.AppDomain._nExecuteAssembly(RuntimeAssembly assembly, String[] args)
       bei System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence assemblySecurity, String[] args)
       bei Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()
       bei System.Threading.ThreadHelper.ThreadStart_Context(Object state)
       bei System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
       bei System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
       bei System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
       bei System.Threading.ThreadHelper.ThreadStart()
  InnerException: 


when I went step by step throw the pages (from end to beginning) it works, after this I can properly press the << and >> button. This works reliably traceable.

Greetings Uwe







Yoan
Telerik team
 answered on 15 Oct 2013
1 answer
69 views
Hi, 

The DataPager does not show up at the end of the GridView.

WPF Trial Project.

Here is my code :

    <Grid >
        
        <Grid.RowDefinitions>
            <RowDefinition />
            <RowDefinition Height="Auto" />
        </Grid.RowDefinitions>
        
        
        <controls:RadGridView  
                      Name="radGridView1" controls3:StyleManager.Theme="Windows8Touch" ColumnWidth="*" AutoGenerateColumns="False">
            <controls:RadGridView.Columns>
                <controls:GridViewDataColumn DataMemberBinding="{Binding Type}"  Header="Type" >
                    <controls:GridViewDataColumn.AggregateFunctions>
                        <data:CountFunction Caption="Total # of records: " />
                    </controls:GridViewDataColumn.AggregateFunctions>
                </controls:GridViewDataColumn>
                <controls:GridViewDataColumn DataMemberBinding="{Binding NumDossier}" Header="Numéro de dossier" />
                <controls:GridViewDataColumn DataMemberBinding="{Binding NomCommune}" Header="Nom commune" />
                <controls:GridViewDataColumn DataMemberBinding="{Binding Ref}"  Header="Ref" />
            </controls:RadGridView.Columns>
        </controls:RadGridView>

        <telerik:RadDataPager 
                                Name="xRadDataPager" 
                                Source="{Binding Items, ElementName=radGridView1}" 
                                PageSize="5" />
    </Grid>

Any suggestion?
Regards,
Maya
Telerik team
 answered on 15 Oct 2013
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?