Telerik Forums
UI for WPF Forum
1 answer
246 views

I am getting a null reference exception whenever assigning to the RadPdfViewer FixedDocumentPresenter property. The last line of code below is where an exception is thrown. I have also tried to set the FixedDocumentPresenter property by using pdfViewer.GetRegisteredPresenter(), but I get the same exception. I need the presenter to be set so I can get coordinates of the PDF but the value is null.

            pdfViewer = new RadPdfViewer();
            string pdfFilePath = "C:\\temp\\GeneratedDocument.pdf";
            MemoryStream stream = new MemoryStream();
            using (Stream input = File.OpenRead(pdfFilePath))
            {
                input.CopyTo(stream);
            }
            FormatProviderSettings settings = new FormatProviderSettings(ReadingMode.OnDemand);
            PdfFormatProvider provider = new PdfFormatProvider(stream, settings);
            RadFixedDocument doc = provider.Import();
            pdfViewer.Document = doc;
            pdfViewer.MouseDoubleClick += PdfViewer_MouseDoubleClick;

            var myPresenter = new FixedDocumentSinglePageViewPresenter();
            pdfViewer.FixedDocumentPresenter = myPresenter;

 

EXCEPTION:Error Message: Object reference not set to an instance of an object.

   at Telerik.Windows.Controls.FixedDocumentViewerBase.InitializeFixedDocumentPresenter(IFixedDocumentPresenter releasedPresenter, IFixedDocumentPresenter presenter)
   at Telerik.Windows.Controls.FixedDocumentViewerBase.set_FixedDocumentPresenter(IFixedDocumentPresenter value)

 

Polya
Telerik team
 answered on 14 Feb 2018
1 answer
131 views
Is there a way to customize FilterControls on a per column basis?

Thanks in advance,
Steve 
Martin
Telerik team
 answered on 14 Feb 2018
2 answers
116 views

Would it be possible to reorder the columns by dragging as in the GridView?

Thanks in advance,
Steve

Martin
Telerik team
 answered on 14 Feb 2018
1 answer
665 views

Hi!

I have RadGridView, and I need to get Header cell for all columns. How to get header cells (not content) in RadGridView.

Thanks.

Dinko | Tech Support Engineer
Telerik team
 answered on 14 Feb 2018
3 answers
202 views

Hello,

I am new to both XAML and Telerik. I am trying to implement some functionality to an existing application that will allow me to drag and drop a tree node item to a data grid. I have been looking at the example here (https://github.com/telerik/xaml-sdk/tree/master/TreeView/DragDropTreeViewToControls) and it seems very similar to what I need except a data grid instead of a list box. It should behave in the following way:

1) Allow drag and drop of tree node items ONLY to the left column cell(s) of an adjacent data grid (the other column will be prepopulated with data)

2) DISABLE drap and drop (and reorder, etc) within the RadTreeView itself.

 

If possible, please attach an example solution in a zip file.

Thank you in advance.

Bardon
Top achievements
Rank 1
 answered on 14 Feb 2018
1 answer
644 views

Hello,

we've an issue with the fluent theme (and material theme also). 
As example the pin button has a wrong style. See attached screen shot.

How can we fix this problem?

Version: 2018.1.122.145.

Thanx

Markus

Martin
Telerik team
 answered on 14 Feb 2018
9 answers
436 views
Hello,

can you please show an example of how to change the speed of transition animation when it is enabled for the extender control(telerik:AnimationManager.IsAnimationEnabled="True")

Thank you
Sia
Telerik team
 answered on 14 Feb 2018
6 answers
313 views

Hello, I was wondering if I could prevent the user from dragging the alert off screen limits, I did find IsRestricted property here https://docs.telerik.com/devtools/wpf/controls/radwindow/how-to/prevent-dragging-off-the-screen

But I could not manage to apply it to one of your predefined dialogs (Alert, Prompt, Confirm). Is there any way to do it? Couldn't there be a simple property in the DialogParameters?

 

Thanks in advance,

Luís Henrique

Stefan
Telerik team
 answered on 14 Feb 2018
1 answer
915 views

1. Add items (click add new item).
2. Select item (select grid view row).
3. Change Quantity or Unit Price in grid view cell, the sum quantity and line total updated.
4. Change Quantity or Unit Price in other control (textbox), the sum quantity and line total not updated.
5. Add New Item or delete an Item. The sum quantiy and line total updated.

How can I fix the change quantity or unit price in other controll will update the sum quantity and line total?

Thanks

Xaml:

<Window
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
        xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
        xmlns:local="clr-namespace:RadGridView_Bugs"
        xmlns:telerik="http://schemas.telerik.com/2008/xaml/presentation" x:Class="RadGridView_Bugs.MainWindow"
        mc:Ignorable="d"
        Title="MainWindow" Height="350" Width="525">
    <Grid>
        <Grid.ColumnDefinitions>
            <ColumnDefinition/>
            <ColumnDefinition Width="Auto"/>
        </Grid.ColumnDefinitions>
        <telerik:RadGridView Name="_gridView" AutoGenerateColumns="False" ShowColumnFooters="True">
            <telerik:RadGridView.Columns>
                <telerik:GridViewDataColumn Header="Quantity" DataMemberBinding="{Binding Path=Quantity}">
                    <telerik:GridViewDataColumn.AggregateFunctions>
                        <telerik:SumFunction SourceField="Quantity" Caption="Quantity Total: "/>
                    </telerik:GridViewDataColumn.AggregateFunctions>
                </telerik:GridViewDataColumn>
                <telerik:GridViewDataColumn Header="Unit Price" DataMemberBinding="{Binding Path=UnitPrice}"/>
                <telerik:GridViewDataColumn Header="Line Total" DataMemberBinding="{Binding Path=LineTotal}">
                    <telerik:GridViewDataColumn.AggregateFunctions>
                        <telerik:SumFunction SourceField="LineTotal" ResultFormatString=" {0:N0}" Caption="Line Total: "/>
                    </telerik:GridViewDataColumn.AggregateFunctions>
                </telerik:GridViewDataColumn>
            </telerik:RadGridView.Columns>
        </telerik:RadGridView>
        <StackPanel Grid.Column="1">
            <StackPanel Orientation="Horizontal">
                <Label Content="Quantity"/>
                <TextBox Name="_quantity" MinWidth="100" Text="{Binding ElementName=_gridView, Path=SelectedItem.Quantity, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"/>
            </StackPanel>
            <StackPanel Orientation="Horizontal">
                <Label Content="Unit Price"/>
                <TextBox Name="_unitPrice" MinWidth="100" Text="{Binding ElementName=_gridView, Path=SelectedItem.UnitPrice, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"/>
            </StackPanel>
            <StackPanel Orientation="Horizontal">
                <Label Content="Line Total"/>
                <TextBlock MinWidth="100" Text="{Binding ElementName=_gridView, Path=SelectedItem.LineTotal, Mode=OneWay}"/>
            </StackPanel>
            <Button Content="Add New Item" Name="addNewItem" Click="addNewItem_Click"/>
        </StackPanel>
       
    </Grid>
</Window>

 

Code behind:

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
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 RadGridView_Bugs
{
    /// <summary>
    /// Interaction logic for MainWindow.xaml
    /// </summary>
    public partial class MainWindow : Window
    {
        public MainWindow()
        {
            InitializeComponent();
        }
        private void addNewItem_Click(object sender, RoutedEventArgs e)
        {
            _gridView.Items.Add(new LineItem() { Quantity = 1, UnitPrice = 100 });
        }
    }
    public sealed class LineItem : INotifyPropertyChanged
    {
        private decimal _quantity;
        private decimal _unitPrice;
        public LineItem()
        {
        }
        /// <summary>
        /// Gets or sets Quantity.
        /// </summary>
        public decimal Quantity
        {
            get { return _quantity; }
            set
            {
                if (value != _quantity)
                {
                    _quantity = value;
                    this.OnPropertyChanged("LineTotal");
                    this.OnPropertyChanged("Quantity");
                }
            }
        }
        /// <summary>
        /// Gets or sets UnitPrice.
        /// </summary>
        public decimal UnitPrice
        {
            get { return _unitPrice; }
            set
            {
                if (value != _unitPrice)
                {
                    _unitPrice = value;
                    this.OnPropertyChanged("LineTotal");
                    this.OnPropertyChanged("UnitPrice");
                }
            }
        }
        public decimal LineTotal => this.Quantity * this.UnitPrice;
        private void OnPropertyChanged(string propertyName)
        {
            this.PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName));
        }
        public event PropertyChangedEventHandler PropertyChanged;
    }
}


Stefan
Telerik team
 answered on 13 Feb 2018
1 answer
333 views

When editing a cell in a RadGridView, the normal behavior for the escape key is to leave edit mode but retain focus on the same cell; if the enter key is pressed, to commit the edit and advance focus to the next editable cell.

My boss would like for me to modify the behavior so that if enter is pressed but the cell's value has not changed, to act as if it were the escape key instead. While I have been able to cancel the commit, but the focus still advances to the next editable cell, and that's not what he wants.

What is the best way to achieve what we're looking for? Thanks in advance for your help.

Stefan
Telerik team
 answered on 13 Feb 2018
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
NavigationView (Hamburger Menu)
Wizard
ExpressionEditor
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
Callout
PasswordBox
SplashScreen
Localization
Rating
Accessibility
CollectionNavigator
AutoSuggestBox
Security
VirtualKeyboard
HighlightTextBlock
TouchManager
StepProgressBar
Badge
OfficeNavigationBar
ExpressionParser
CircularProgressBar
SvgImage
PipsPager
SlideView
AI Coding Assistant
+? more
Top users last month
Miljana
Top achievements
Rank 2
Iron
Iron
Joel
Top achievements
Rank 3
Bronze
Bronze
Bronze
Cynthia
Top achievements
Rank 1
John
Top achievements
Rank 1
Iron
Mozart
Top achievements
Rank 1
Iron
Veteran
Want to show your ninja superpower to fellow developers?
Top users last month
Miljana
Top achievements
Rank 2
Iron
Iron
Joel
Top achievements
Rank 3
Bronze
Bronze
Bronze
Cynthia
Top achievements
Rank 1
John
Top achievements
Rank 1
Iron
Mozart
Top achievements
Rank 1
Iron
Veteran
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?