Telerik Forums
UI for WPF Forum
1 answer
183 views
Hi,

How to show the default file format as pdf clicking the save button in RadRichTextBox Ribbon Bar?
Perhaps a parameter in the SaveCommand?

Thanks,
marc.








Todor
Telerik team
 answered on 16 Dec 2014
4 answers
117 views
Hi guys, 
my application recently logged the following unhandled exception.
It happened just once and I'm unable to reproduce it, but looking at the stacktrace it seems an invalid cast on the RadTabControl.ScrollViewer_MouseWheel.

I never subscribe to that event so I'm assuming it's something related to RadTabControl internal implementation...
Can you have a look at it?

Thanks

Manuel

<SerializableException xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
  <ExtendedInformation>
    <HResult>-2146233079</HResult>
  </ExtendedInformation>
  <Message>'System.Windows.Documents.Hyperlink' is not a Visual or Visual3D.</Message>
  <Source>PresentationCore</Source>
  <StackTrace>   at MS.Internal.Media.VisualTreeUtils.AsVisual(DependencyObject element, Visual&amp; visual, Visual3D&amp; visual3D)

 at Telerik.Windows.Controls.RadTabControl.ScrollViewer_MouseWheel(Object sender, MouseWheelEventArgs e)
 at System.Windows.RoutedEventArgs.InvokeHandler(Delegate handler, Object target)
 at System.Windows.EventRoute.InvokeHandlersImpl(Object source, RoutedEventArgs args, Boolean reRaised)
 at System.Windows.UIElement.RaiseEventImpl(DependencyObject sender, RoutedEventArgs args)
 at System.Windows.UIElement.RaiseTrustedEvent(RoutedEventArgs args)
 at System.Windows.Input.InputManager.ProcessStagingArea()
 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, WindowMessage msg, IntPtr wParam, IntPtr lParam, Boolean&amp; handled)
 at System.Windows.Interop.HwndSource.InputFilterMessage(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean&amp; handled)
 at MS.Win32.HwndWrapper.WndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean&amp; handled)
 at MS.Win32.HwndSubclass.DispatcherCallbackOperation(Object o)
 at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs)
 at MS.Internal.Threading.ExceptionFilterHelper.TryCatchWhen(Object source, Delegate method, Object args, Int32 numArgs, Delegate catchHandler)
</StackTrace>
  <TargetSite>Void AsVisual(System.Windows.DependencyObject, System.Windows.Media.Visual ByRef, System.Windows.Media.Media3D.Visual3D ByRef) @ MS.Internal.Media.VisualTreeUtils</TargetSite>
  <Type>System.InvalidOperationException</Type>
</SerializableException>
Manuel
Top achievements
Rank 1
 answered on 16 Dec 2014
8 answers
147 views
Hi,

We are using WPF RadGridView in our screen.
We notice that the screens which have RadGridView without grouping perform better but the screens where grouping is enabled take a long time to load.
Our best guess is that UI virtualization is not happening for RadGridView with grouping enabled.

Is UI Virtualization turned off when grouping is enabled? If yes, please suggest an alternative way to improve performance.

Thanks.
Dimitrina
Telerik team
 answered on 16 Dec 2014
3 answers
386 views
Hello,
i have a controltemplate for GridViewCell and I'm having some problems with its binding.
First of all when i used: (the column is binded to Price)
Text="{Binding Path=Content.Field.Value}" 
The value disapears from the cell when the row is selected.

Then i tried:
Text="{Binding Path=DataContext.Price, Mode=TwoWay, Converter = {StaticResource CentPriceConverter}, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type telerik:GridViewRow}}}" 
but this way the value in the source object  is not updated. the setter is called with the old value

can you tell what I'm doing wrong?

my controlTemplate looks like this:
                <ControlTemplate x:Key="PriceExpandedCell" TargetType="telerik:GridViewCell">  
                    <Border Name="Part_Border"   
                            CornerRadius="0"   
                            Loaded="Part_Border_Loaded" 
                            Height="Auto" 
                            BorderBrush="{StaticResource SolidBorderBrush}" 
                            VerticalAlignment="Stretch">  
                        <StackPanel Name="Part_StackPanel"   
                                    ScrollViewer.VerticalScrollBarVisibility="Hidden" 
                                    Orientation="Vertical" 
                                    Background="{Binding Path=Background, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type telerik:GridViewRow}}}">  
                            <TextBox Name="Part_Text"    
                                     Width="Auto"   
                                     BorderThickness="0" 
                                     Background="Transparent" 
                                     Margin="2,2,2,2"   
                                     TextChanged="Part_Text_TextChanged" 
                                     Foreground="{Binding Path=Foreground, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type telerik:GridViewRow}}}" 
                                     Text="{Binding Path=DataContext.Price, Mode=TwoWayConverter = {StaticResource CentPriceConverter},   
                                RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type telerik:GridViewRow}}}"/> 
                            <Button Content="Discount" Margin="15,3,3,3"   
                                    Name="btnDiscount" 
                                    Click="btnDiscount_Click" 
                                    HorizontalAlignment="Left" 
                                    Style="{StaticResource CompactButton}"/>  
                        </StackPanel> 
                    </Border> 
                    <ControlTemplate.Triggers> 
                        <DataTrigger Binding="{Binding Path=IsSelected, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type telerik:GridViewRow}}}" Value="True">  
                            <Setter TargetName="Part_StackPanel" Property="Background" Value="{StaticResource HighlightGradientBrush}"/>  
                        </DataTrigger> 
                        <Trigger Property="IsInEditMode" Value="True">  
                            <Setter TargetName="Part_Border" Property="BorderThickness" Value="3"/>  
                            <Setter TargetName="Part_StackPanel" Property="Background" Value="{StaticResource LightBlueBrush}"/>  
                        </Trigger> 
 
                    </ControlTemplate.Triggers> 
                </ControlTemplate> 
 

Thanks!

Dimitrina
Telerik team
 answered on 16 Dec 2014
1 answer
198 views
Hello,

Could you please point me to a working code of WPF (that uses a ribbon view similar  to Microsoft word) and using PRISM (and unity or MEF). Thanks.

-Jayanth 
Pavel R. Pavlov
Telerik team
 answered on 16 Dec 2014
8 answers
411 views
Hello!
How to bind the radribbon tab to a command?
like ... <RadRibbonTab Command="{Binding MyCommand}"...>

Thanks.
Ram
Top achievements
Rank 1
 answered on 15 Dec 2014
2 answers
114 views
Is there a property that I can reliably use to determine if the CloudUpload is currently working on 1 or more uploads? I suppose I could subscribe to one of the events and set a custom property if not.
Kiril Vandov
Telerik team
 answered on 15 Dec 2014
1 answer
138 views
Hello, I'm setting up a windows explorer tree view and when it displays, I get a header node then C: then Folder then File.    How can I suppress the Header and drive letter so the first node starts with a sub-folder?  I can't find an event to filter as it's creating the node structure.

attached in yellow are the two nodes I would like to remove on initialization of the control.

thanks.
Martin Ivanov
Telerik team
 answered on 15 Dec 2014
1 answer
146 views
Hi
I'm trying to using RadBook control to display a PDF file and also a custom control named DrawingCanvas to draw some shapes over the PDF file loaded.
I've done this successfully thanks to the vast amount of samples available.
Here is how I do:

I load the file as follows:
private void LoadFile(String filePath)
{
    documentStream = new FileStream(filePath, FileMode.Open);
    var doc = new PdfFormatProvider(documentStream, FormatProviderSettings.ReadOnDemand).Import();
    book.ItemsSource = doc.Pages;
}

And here is the DataTemplate which I use:
<DataTemplate x:Key="PageTemplate">
            <Viewbox>
                     <Grid>
                    <ui:FixedDocumentSinglePagePresenter Page="{Binding}" Width="500" Height="500"/>
                    <hosts:DrawingCanvas Width="500" Height="500" Margin="15" Background="#00000000" />
                </Grid>
            </Viewbox>
        </DataTemplate>
And everything works great.
My problem is that, when the page is changed (on PageChanged event), I want to access the DrawingCanvas!
I tries the 2 approaches mentioned in this post How to access controls in RadBook DataTemplete?, but it doesn't help me.
When using the loaded event, I have 2 problems:
  1. When paging back, the events (sometimes) does not raise!
  2. It seems the RadBook caches the pages, so while RightPageIndex is 0, I get events of canvases in page 1 and 2.

And when trying to use the RadBook.ItemContainerGenerator the problem is that myBook.ItemContainerGenerator.ContainerFromIndex(leftPageInd) returns null,
and I also tried to use the book.Items property, but my Items type are RadFixedPage (because I've set ItemsSource of book to PdfFormatProvider's Pages property) and I don't know how can I use it to get my DrawingCanvas.

Regards, Vahid 

Martin Ivanov
Telerik team
 answered on 15 Dec 2014
2 answers
1.0K+ views
I am attempting to set a style for the RadWatermarkTextbox as follows;

<Style TargetType="telerik:RadWatermarkTextBox" x:Key="RadWatermark">
    <Style.Triggers>
        <DataTrigger Binding="{Binding Path=IsActive}" Value="False">
            <Setter Property="TextBlock.Foreground" Value="Red"/>
            <Setter Property="TextBlock.Background" Value="LightYellow" />
        </DataTrigger>
    </Style.Triggers>
</Style>

The foreground colour changers to red but the background appears grey.  I haver tried various opacity settings and also;

<Style TargetType="telerik:RadWatermarkTextBox" x:Key="RadWatermark">
    <Style.Triggers>
        <DataTrigger Binding="{Binding Path=IsActive}" Value="False">
            <Setter Property="TextBlock.Foreground" Value="Red"/>
            <Setter Property="TextBlock.Background" Value="LightYellow" />
            <Setter Property="Background" Value="LightYellow" />
        </DataTrigger>
    </Style.Triggers>
</Style>

but the best I seem to get is a dirty-yellow background.

How do I override the default "battleship grey"?
Raymond
Top achievements
Rank 1
 answered on 15 Dec 2014
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
DataPager
PersistenceFramework
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
LayoutControl
ProgressBar
Sparkline
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
SplashScreen
Callout
Rating
Accessibility
CollectionNavigator
Localization
AutoSuggestBox
Security
VirtualKeyboard
HighlightTextBlock
TouchManager
StepProgressBar
Badge
OfficeNavigationBar
ExpressionParser
CircularProgressBar
SvgImage
PipsPager
SlideView
AI Coding Assistant
+? more
Top users last month
Chester
Top achievements
Rank 1
Iron
Simon
Top achievements
Rank 1
Iron
Douglas
Top achievements
Rank 2
Iron
Iron
SUNIL
Top achievements
Rank 3
Iron
Iron
Iron
Marco
Top achievements
Rank 3
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Chester
Top achievements
Rank 1
Iron
Simon
Top achievements
Rank 1
Iron
Douglas
Top achievements
Rank 2
Iron
Iron
SUNIL
Top achievements
Rank 3
Iron
Iron
Iron
Marco
Top achievements
Rank 3
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?