Telerik Forums
UI for WPF Forum
6 answers
645 views
I was working with the previous version of this control but for some reason it would not render some of our pdf files.  I upgraded to the latest version but now I am running into a new issue.  I can't seem to clear the document from the viewer.  I have attached some sample code that will reproduce the NullReferenceException errors I am getting.

WPF Code:
<Window x:Class="TelerikPDFViewerTest.MainWindow"
        Title="MainWindow" Height="550" Width="525">
    <Window.CommandBindings>
        <CommandBinding Command="Open" CanExecute="Open_CanExecute" Executed="Open_Executed" />
        <CommandBinding Command="Close" CanExecute="Close_CanExecute" Executed="Close_Executed" />
    </Window.CommandBindings>
    <Grid>
 
        <telerik:RadPdfViewer Name="pdfViewer" Margin="3,30,3,3" VerticalAlignment="Stretch" HorizontalAlignment="Stretch" />
        <telerik:RadButton Name="btnOpen" Content="Open" Margin="3,3,0,0" VerticalAlignment="Top" HorizontalAlignment="Left" Width="72" Command="Open" />
        <telerik:RadButton Name="btnClose" Content="Close" Margin="0,3,0,3" VerticalAlignment="Top" HorizontalAlignment="Right" Width="72" Command="Close" />
    </Grid>
</Window>

C# Code:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
 
namespace TelerikPDFViewerTest
{
    /// <summary>
    /// Interaction logic for MainWindow.xaml
    /// </summary>
    public partial class MainWindow : Window
    {
        private System.IO.FileStream fs = null;
        public MainWindow()
        {
            InitializeComponent();
        }
 
        private void Open_CanExecute(object sender, CanExecuteRoutedEventArgs e)
        {
            e.CanExecute =(System.IO.File.Exists("benchbook.pdf"));
            e.Handled = true;
        }
 
        private void Open_Executed(object sender, ExecutedRoutedEventArgs e)
        {
            fs = new System.IO.FileStream("benchbook.pdf", System.IO.FileMode.Open, System.IO.FileAccess.Read, System.IO.FileShare.Delete);
            pdfViewer.DocumentSource = new Telerik.Windows.Documents.Fixed.PdfDocumentSource(fs);
        }
 
        private void Close_CanExecute(object sender, CanExecuteRoutedEventArgs e)
        {
            e.CanExecute = (this.pdfViewer.Document != null);
            e.Handled = true;
        }
 
        private void Close_Executed(object sender, ExecutedRoutedEventArgs e)
        {
            this.fs.Close();
            //Get NullReferenceException in both cases
            //First try to set document source = null
            this.pdfViewer.DocumentSource = null;
             
            //Or try just releasing the document
            //this.pdfViewer.Document = null;
        }
    }
}

I could not attach the pdf I was using but any pdf will reproduce the problem.  Please let me know if there is some workaround for this.

Ideally it would be great if the PdfViewer had a Clear() function that would release all resources referenced and displayed.

Thanks,
Lee Keel
Stephen
Top achievements
Rank 1
Iron
 answered on 21 Nov 2013
5 answers
97 views
Hi, 

Is it possible to transform the RadGridView by 90degrees so that the column headers are displayed down the side? I have a lot of headers but not much data so it makes sense to flip the orientation.

Thanks for your help!
Dimitrina
Telerik team
 answered on 21 Nov 2013
7 answers
226 views
I'm working on a new WPF application, and am making extensive use of the RadMaskedNumericInput control. I've defined a couple of validation classes based upon the ValidationRule class. I'm using this in every instance where I use a RadMaskedNumericInput control. I want it such that if the RadMaskedNumericInput control shows up and the user does nothing with it, then the lowest value is saved back to the database. This isn't happening. What's happening is a null is being saved to the database. Now, I know that I could define a default value in the table definition, and perhaps that's what I'll have to do, but I'd like to know if there's a way to make the RadMaskedNumericInput control automatically save the lowest value (in all my cases that happens to be a 0, but it could technically be any numeric value) to the backend database. You see, it's weird because the RadMaskedNumericInput control is showing a 0 in it, when it comes up, but I've found that in testing if I do nothing with that control, or just tab to it and then past it, a null is what's saved to the database. That's counterintuitive.
Rod
Top achievements
Rank 1
 answered on 21 Nov 2013
3 answers
767 views
i'm using RadGridView in my application, for displaying all users registered in my app, also i can edit them. When i started editing and wanted to move to another screen i need to "close" or "end" editing mode programmatically(on my ViewModel). Help me how to handle this.
Dimitrina
Telerik team
 answered on 21 Nov 2013
2 answers
139 views
Hi

The dataform works well when AutoGenerateFields is true, but once i turn it off and supply it with 3 different DataTemplates it throws the Exception "Parameter count mismatch", the Object implements  IDataErrorInfo, IEditableObject and the problem seems to be the
IDataErrorInfo, any ideas
thanks

   at System.Reflection.RuntimeMethodInfo.InvokeArgumentsCheck(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
   at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
   at System.Reflection.RuntimePropertyInfo.GetValue(Object obj, BindingFlags invokeAttr, Binder binder, Object[] index, CultureInfo culture)
   at System.Reflection.RuntimePropertyInfo.GetValue(Object obj, Object[] index)
   at Telerik.Windows.Data.ItemPropertyInfoExtensions.GetValue(ItemPropertyInfo itemProperty, Object item) in c:\TB\105\WPF_Scrum\Release_WPF\Sources\Development\Core\Data\ItemProperties\ItemPropertyInfoExtensions.cs:line 105




Ramon
Top achievements
Rank 1
 answered on 21 Nov 2013
0 answers
47 views
Hi folks.

I have a treelist control on my page where I load the items dynamicaly. At each section I'd like to have aggregated sums at the bottom. I thing I have all set correctly regarding online demos but the result footer are all empty.

I use this code:

     <telerik:RadTreeList ID="rtlData" AllowLoadOnDemand="true" runat="server" AutoGenerateColumns="false"
         OnChildItemsDataBind="RadTreeList_ChildItemsDataBind" OnNeedDataSource="RadTreeList_NeedDataSource"
          DataKeyNames="CssClass,ParentId" ParentDataKeyNames="CssClass,ParentId" OnItemCreated="RadTreeList_ItemCreated"
         OnItemDataBound="RadTreeList_ItemDataBound" ShowFooter="true">
          <Columns>
               <telerik:TreeListBoundColumn DataField="ProductCatL3" UniqueName="ProductCatL3" HeaderText="Produkt L3">
               </telerik:TreeListBoundColumn>
               <telerik:TreeListBoundColumn DataField="ProductCatL2" UniqueName="ProductCatL2" HeaderText="Produkt L2">
               </telerik:TreeListBoundColumn>
               <telerik:TreeListBoundColumn DataField="ProductCatL1" UniqueName="ProductCatL1" HeaderText="Produkt L1">
               </telerik:TreeListBoundColumn>
               <telerik:TreeListBoundColumn DataField="State" UniqueName="State" HeaderText="Stav" DataType="System.Decimal" DataFormatString="{0:C2}" Aggregate="Sum">
               </telerik:TreeListBoundColumn>
               <telerik:TreeListBoundColumn DataField="Avg1Month" UniqueName="Avg1Month" HeaderText="PrůmÄ›r 1 mÄ›síc" DataFormatString="{0:C2}" Aggregate="Avg">
               </telerik:TreeListBoundColumn>
               <telerik:TreeListBoundColumn DataField="Avg3Months" UniqueName="Avg3Months" HeaderText="PrůmÄ›r 3 mÄ›síce" DataFormatString="{0:C2}" Aggregate="Avg">
               </telerik:TreeListBoundColumn>
               <telerik:TreeListBoundColumn DataField="ApprovedLimit" UniqueName="ApprovedLimit" HeaderText="Schválený limit" DataFormatString="{0:C2}" Aggregate="Sum">
               </telerik:TreeListBoundColumn>
               <telerik:TreeListBoundColumn DataField="CssClass" UniqueName="Css" HeaderText="CSS" Visible="false">
               </telerik:TreeListBoundColumn>
               <telerik:TreeListBoundColumn DataField="ParentId" UniqueName="ParentId" HeaderText="ParentId" Visible="false">
               </telerik:TreeListBoundColumn>
          </Columns>
     </telerik:RadTreeList>

What am I doing wrong that no footer are calculated and it only shows empty fields?

Sincerely
Scarlaxx
Jiri
Top achievements
Rank 1
 asked on 21 Nov 2013
5 answers
490 views
Hello!

I need real-time update. 
When I updated properties, everything was ok, but there were problems with sorting, filtering and grouping. 
According to your demo, I start to replace whole object. 
Everything works fine, but scroll's behaviour becomes very strange.

There is example: Sample

1. If you scroll grid for a while, you will see scroll "jumps" sometimes.. Here it is small jump, but in my app it is more noticeable.

2. If there are enough columns for horizontal scroll, it will also jump from right side, and it would be very difficult to use last column.

What should I do?

Thanks. 
Vanya Pavlova
Telerik team
 answered on 20 Nov 2013
9 answers
325 views
Hi ,
I am using RadRichtextBox for print of RadGridView Data.Print is working but All the column in RadGridView  is not cmming.Its get cuts from end.
 My reqirement is when there is more column then those column should appear automatically in the next page consecutively or next document.

Please find my attached document also.And please help me it is very urgent ..

Thanks in advanced...
Regards
Rahman
Petya
Telerik team
 answered on 20 Nov 2013
1 answer
102 views
public void test()
        {
            LineSeries line1 = new LineSeries() { };
            for (int i = 0; i < 10; i++)
            {
                line1.DataPoints.Add(new Telerik.Charting.CategoricalDataPoint() { Value = i });
            }
 
            line1.MouseLeftButtonDown += (sender, args) => MouseLeftDown(sender, args, chart1);
 
            chart1.Series.Add(line1);
        }
 
        public void MouseLeftDown(object sender,MouseButtonEventArgs args,RadCartesianChart chart)
        {
         
        }

Can I use MouseEvent to get the  datapoint of line?


I set  MouseDown in LineSeries and I want to add datapoint where I trigger this event.

But I can't find any data about  the position of line. 
Yavor
Telerik team
 answered on 20 Nov 2013
1 answer
97 views
chart[i].HorizontalAxis= new LinearAxis() {  LabelInterval = 10  };
Use LabelInterval can control  regular pattern of label.

If I only want to show the last label? (attachment1)
if I wnat to show the  Irregular label? (attachment2)
Petar Marchev
Telerik team
 answered on 20 Nov 2013
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
Book
FileDialogs
ToolBar
ColorPicker
TimePicker
SyntaxEditor
MultiColumnComboBox
VirtualGrid
Wizard
ExpressionEditor
NavigationView (Hamburger Menu)
DesktopAlert
WatermarkTextBox
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
VirtualKeyboard
HighlightTextBlock
Security
TouchManager
StepProgressBar
Badge
OfficeNavigationBar
ExpressionParser
CircularProgressBar
SvgImage
PipsPager
SlideView
AI Coding Assistant
+? more
Top users last month
Ambisoft
Top achievements
Rank 2
Iron
Pascal
Top achievements
Rank 2
Iron
Matthew
Top achievements
Rank 1
Sergii
Top achievements
Rank 1
Iron
Iron
Andrey
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Ambisoft
Top achievements
Rank 2
Iron
Pascal
Top achievements
Rank 2
Iron
Matthew
Top achievements
Rank 1
Sergii
Top achievements
Rank 1
Iron
Iron
Andrey
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?