this.pdfViewer.DocumentSource = new PdfDocumentSource(new FileStream(@".\Resources\MERE_User_Guide_v1_2.pdf", FileMode.Open, FileAccess.Read));
thanks
Hi,
I have a problem with GridView (2012.1.326.40):
<telerik:RadGridView CanUserSortColumns="True" ScrollViewer.HorizontalScrollBarVisibility="Disabled" Name="ProductionQuantityTable" IsSynchronizedWithCurrentItem="True"
grid:RadGridViewHelper.ColumnsCollection="{Binding Path=ColumnsCollection, NotifyOnSourceUpdated=True}" SelectedItem="{Binding SelectedQuantity, Mode=TwoWay}" SelectionMode="Single" ItemsSource="{Binding Quantities}" />
ViewModel:
private ProductionQuantityItemViewModel _selectedQuantity;
public ProductionQuantityItemViewModel SelectedQuantity
{
get
{
if (_selectedQuantity == null && _project.CurrentQuantityVariantId.HasValue)
{
_selectedQuantity = _quantities.FirstOrDefault(q => q.QuantityVariant.Identity == _project.CurrentQuantityVariantId.Value);
}
return _selectedQuantity;
}
set
{
_selectedQuantity = value;
_project.CurrentQuantityVariantId = _selectedQuantity.QuantityVariant.Identity;
RaisePropertyChanged(() => SelectedQuantity);
_eventAggregator.GetEvent<ProductionQuantityChangedEvent>().Publish(_selectedQuantity.QuantityVariant.ProductionQuantity);
}
}
SelectedItem is binding to ViewModel, but when I set SelectedQuantity in ViewModel I don't get any graphical representation in UI.
What I'm trying to achieve is that when I load table that row is selected (based on data in DB). In this example row #2.
http://gyazo.com/38e88488d872989beb03b447a6e545d6
<UserControl x:Class="com.christiegrp.Neuron.ClientApplication.PdfViewer"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:converters="clr-namespace:Telerik.Windows.Documents.Converters;assembly=Telerik.Windows.Controls.FixedDocumentViewers"
xmlns:telerik="http://schemas.telerik.com/2008/xaml/presentation"
xmlns:controls="clr-namespace:Telerik.Windows.Controls;assembly=Telerik.Windows.Controls">
<UserControl.Resources>
<ResourceDictionary>
<ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="PdfViewer-Fr-Res.xaml"/>
<ResourceDictionary Source="pack://application:,,,/Resources;component/Neuron-CustomStyles.xaml"/>
</ResourceDictionary.MergedDictionaries>
</ResourceDictionary>
</UserControl.Resources>
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition Height="*" />
</Grid.RowDefinitions>
<!-- The following element is used to trigger an event allowing to replace the language resources before they are used. -->
<TextBlock Initialized="ReplaceLanguageResources"/>
<telerik:RadToolBar x:Name="pdfToolBar" DataContext="{Binding ElementName=pdfViewer, Path=Commands}">
<telerik:RadToolBar.Resources>
<converters:DoubleToStringPercentConverter x:Key="doubleToStringPercentConverter" />
</telerik:RadToolBar.Resources>
<controls:RadButton Padding="4" Command="{Binding OpenPdfDocumentCommand}">
<ToolTipService.ToolTip>
<TextBlock Text="{StaticResource Open}" />
</ToolTipService.ToolTip>
<Image Source="/Telerik.Windows.Controls.FixedDocumentViewers;component/Images/open.png" Stretch="None" />
</controls:RadButton>
<controls:RadButton Command="{Binding PrintPdfDocumentCommand}">
<ToolTipService.ToolTip>
<TextBlock Text="{StaticResource Print}" />
</ToolTipService.ToolTip>
<Image Source="/Telerik.Windows.Controls.FixedDocumentViewers;component/Images/printer.png" Stretch="None" />
</controls:RadButton>
<telerik:RadToolBarSeparator/>
<controls:RadButton Command="{Binding PageUpCommand}" >
<ToolTipService.ToolTip>
<TextBlock Text="{StaticResource PreviousPage}" />
</ToolTipService.ToolTip>
<Image Source="/Telerik.Windows.Controls.FixedDocumentViewers;component/Images/previous.png" Stretch="None" />
</controls:RadButton>
<controls:RadButton Command="{Binding PageDownCommand}">
<ToolTipService.ToolTip>
<TextBlock Text="{StaticResource NextPage}" />
</ToolTipService.ToolTip>
<Image Source="/Telerik.Windows.Controls.FixedDocumentViewers;component/Images/next.png" Stretch="None" />
</controls:RadButton>
<TextBox Width="30" Margin="2" Text="{Binding FixedDocumentViewer.CurrentPageNumber, Mode=TwoWay}" HorizontalContentAlignment="Center" x:Name="tbCurrentPage" KeyDown="tbCurrentPage_KeyDown"/>
<TextBlock VerticalAlignment="Center" Margin="2" Text="/" />
<TextBlock VerticalAlignment="Center" Margin="2" Text="{Binding ElementName=pdfViewer, Path=Document.Pages.Count}" />
<telerik:RadToolBarSeparator/>
<controls:RadButton Command="{Binding ZoomInCommand}">
<ToolTipService.ToolTip>
<TextBlock Text="{StaticResource ZoomIn}" />
</ToolTipService.ToolTip>
<Image Source="/Telerik.Windows.Controls.FixedDocumentViewers;component/Images/zoom-in.png" Stretch="None" />
</controls:RadButton>
<controls:RadButton x:Name="PART_btnZoomOut" Command="{Binding ZoomOutCommand}">
<ToolTipService.ToolTip>
<TextBlock Text="{StaticResource ZoomOut}" />
</ToolTipService.ToolTip>
<Image Source="/Telerik.Windows.Controls.FixedDocumentViewers;component/Images/zoom-out.png" Stretch="None" />
</controls:RadButton>
<telerik:RadComboBox IsEditable="True" Margin="2" Width="70" SelectedIndex="4"
Text="{Binding FixedDocumentViewer.ScaleFactor, Converter={StaticResource doubleToStringPercentConverter}, Mode=TwoWay}">
<telerik:RadComboBoxItem Content="10%" />
<telerik:RadComboBoxItem Content="25%" />
<telerik:RadComboBoxItem Content="50%" />
<telerik:RadComboBoxItem Content="75%" />
<telerik:RadComboBoxItem Content="100%" />
<telerik:RadComboBoxItem Content="150%" />
<telerik:RadComboBoxItem Content="200%" />
<telerik:RadComboBoxItem Content="500%" />
<telerik:RadComboBoxItem Content="1000%" />
<telerik:RadComboBoxItem Content="2000%" />
</telerik:RadComboBox>
<telerik:RadToolBarSeparator />
<controls:RadToggleButton IsChecked="{Binding FixedDocumentViewer.IsInPanMode, Mode=TwoWay}" >
<ToolTipService.ToolTip>
<TextBlock Text="{StaticResource Pan}" />
</ToolTipService.ToolTip>
<Image Source="/Telerik.Windows.Controls.FixedDocumentViewers;component/Images/hand-free.png" Stretch="None" />
</controls:RadToggleButton>
</telerik:RadToolBar>
<telerik:RadPdfViewer Grid.Row="1" x:Name="pdfViewer" />
</Grid>
</UserControl>
<
Telerik:RadChart
Name
=
"RefundAmountsByBucketChart"
Grid.Row
=
"1"
Grid.Column
=
"1"
Background
=
"White"
Margin
=
"5,5,10,5"
>
<
Telerik:RadChart.DefaultView
>
<
Telerik:ChartDefaultView
>
<
Telerik:ChartDefaultView.ChartTitle
>
<
Telerik:ChartTitle
Content
=
"Refund Amounts By Bucket"
Background
=
"{x:Null}"
Foreground
=
"Black"
OuterBorderBrush
=
"{x:Null}"
BorderBrush
=
"{x:Null}"
/>
</
Telerik:ChartDefaultView.ChartTitle
>
<
Telerik:ChartDefaultView.ChartLegend
>
<
Telerik:ChartLegend
x:Name
=
"RefundAmountsPieChartLegend"
UseAutoGeneratedItems
=
"True"
Header
=
"Buckets"
/>
</
Telerik:ChartDefaultView.ChartLegend
>
<
Telerik:ChartDefaultView.ChartArea
>
<
Telerik:ChartArea
SmartLabelsEnabled
=
"False"
LegendName
=
"RefundAmountsPieChartLegend"
/>
</
Telerik:ChartDefaultView.ChartArea
>
</
Telerik:ChartDefaultView
>
</
Telerik:RadChart.DefaultView
>
<
Telerik:RadChart.SeriesMappings
>
<
Telerik:SeriesMapping
ItemsSource
=
"{Binding RefundAmountsByBucket}"
>
<
Telerik:SeriesMapping.SeriesDefinition
>
<
Telerik:PieSeriesDefinition
ItemLabelFormat
=
"#%{P0}"
RadiusFactor
=
"0.75"
>
<
Telerik:PieSeriesDefinition.LabelSettings
>
<
Telerik:RadialLabelSettings
ShowZeroValueLabels
=
"False"
SpiderModeEnabled
=
"True"
ShowConnectors
=
"True"
Distance
=
"15"
/>
</
Telerik:PieSeriesDefinition.LabelSettings
>
</
Telerik:PieSeriesDefinition
>
</
Telerik:SeriesMapping.SeriesDefinition
>
<
Telerik:SeriesMapping.ItemMappings
>
<
Telerik:ItemMapping
FieldName
=
"Bucket"
DataPointMember
=
"XCategory"
/>
<
Telerik:ItemMapping
FieldName
=
"RefundAmount"
DataPointMember
=
"YValue"
/>
</
Telerik:SeriesMapping.ItemMappings
>
</
Telerik:SeriesMapping
>
</
Telerik:RadChart.SeriesMappings
>
</
Telerik:RadChart
>
System.Windows.Data Error: 5 : Value produced by BindingExpression
is
not valid
for
target property.; Value=
'<null>'
BindingExpression:Path=(0); DataItem=
'ToolWindow'
(Name=
''
); target element
is
'WindowHostWindow'
(Name=
''
); target property
is
'Title'
(type
'String'
)
La référence d
'objet n'
est pas définie à une instance d'un objet.
à Telerik.Windows.Controls.InternalWindow.PopupWindowHost.PopupHostManagerBase.GetManager(DependencyObject obj) dans c:\TB\117\WPF_Scrum\Release_WPF\Sources\Development\Controls\Navigation\Window\InternalWindow\PopupWindowHost.cs:ligne 36
à Telerik.Windows.Controls.InternalWindow.SinglePopupWindowHost.GetHostManager() dans c:\TB\117\WPF_Scrum\Release_WPF\Sources\Development\Controls\Navigation\Window\InternalWindow\SinglePopupWindowHost.cs:ligne 51
à Telerik.Windows.Controls.InternalWindow.PopupWindowHost.Open(Boolean isModal) dans c:\TB\117\WPF_Scrum\Release_WPF\Sources\Development\Controls\Navigation\Window\InternalWindow\PopupWindowHost.cs:ligne 105
à Telerik.Windows.Controls.WindowBase.ShowWindow(Boolean isModal) dans c:\TB\117\WPF_Scrum\Release_WPF\Sources\Development\Controls\Navigation\Window\WindowBase.cs:ligne 714
à Telerik.Windows.Controls.Docking.ToolWindow.Open() dans c:\TB\117\WPF_Scrum\Release_WPF\Sources\Development\Controls\Docking\Docking\Parts\ToolWindow.cs:ligne 101
à Telerik.Windows.Controls.RadDocking.ShowWindow(ToolWindow window, Boolean shouldReallyOpen) dans c:\TB\117\WPF_Scrum\Release_WPF\Sources\Development\Controls\Docking\Docking\Docking\RadDocking.cs:ligne 1465
à Telerik.Windows.Controls.RadDocking.OpenInToolWindow(RadPane pane) dans c:\TB\117\WPF_Scrum\Release_WPF\Sources\Development\Controls\Docking\Docking\Docking\RadDocking.cs:ligne 519
à Telerik.Windows.Controls.RadDocking.OpenAsFloatingOnly(RadSplitContainer container) dans c:\TB\117\WPF_Scrum\Release_WPF\Sources\Development\Controls\Docking\Docking\Docking\RadDocking.cs:ligne 1248
à Telerik.Windows.Controls.RadDocking.InitializeSplitContainer(RadSplitContainer container) dans c:\TB\117\WPF_Scrum\Release_WPF\Sources\Development\Controls\Docking\Docking\Docking\RadDocking.cs:ligne 1201
à Telerik.Windows.Controls.RadDocking.OnApplyTemplate() dans c:\TB\117\WPF_Scrum\Release_WPF\Sources\Development\Controls\Docking\Docking\Docking\RadDocking.cs:ligne 178
à System.Windows.FrameworkElement.ApplyTemplate()
à Microsoft.Expression.Platform.WPF.WpfViewNodeManager.EnsureElementInDictionary(Object root, ViewNode knownAncestor)