Telerik Forums
UI for WPF Forum
3 answers
107 views
Hi Now I'm getting one error while opening multiple PDF files and displaying them to RadBook.

I'm getting the error during navigating pages or open PDF.

"Object reference not set to an instance of an object."

Error occurs at Telerik.Windows.Documents.UI.FixedDocumentSinglePagePresenter.LoadPageContent.AnonymousMethod__1()

Following is the souce code


        private ObservableCollection<AttachFileInfo> _attachedFiles;
        public ObservableCollection<AttachFileInfo> AttachedFiles
        {
            get
            {
                return _attachedFiles;
            }
            set
            {
                if (_attachedFiles != value)
                {
                    _attachedFiles = value;
                    NotifyPropertyChanged("AttachedFiles");


                    OpenPDFFiles();
                }
            }
        }


        private IEnumerable<RadFixedPage> _pages;
        public IEnumerable<RadFixedPage> Pages
        {
            get
            {
                return _pages;
            }
            set
            {
                if (_pages != value)
                {
                    _pages = value;
                    NotifyPropertyChanged("Pages");
                }
            }
        }

if (AttachedFiles != null)
            {
                int step = 0;


                if (attachDocumentStream != null)
                {
                    foreach (Stream attachStream in attachDocumentStream)
                    {
                        attachStream.Close();
                        attachStream.Dispose();
                    }
                }


                attachDocumentStream = new List<Stream>(AttachedFiles.Count);
                foreach (AttachFileInfo AttachFile in AttachedFiles)
                {


                    attachDocumentStream.Add(File.Open(AttachFile.FilePath, FileMode.Open));
                    doc = new PdfFormatProvider(attachDocumentStream[step], FormatProviderSettings.ReadOnDemand).Import();
                    DataStore.TotalPages = DataStore.TotalPages+ doc.Pages.Count;
                    Pages = Pages.Concat(doc.Pages);


                    step = step + 1;
                }
            } 
Iva Toteva
Telerik team
 answered on 09 Aug 2012
5 answers
453 views
I am using a RadTreeListView and I want to have certain nodes (based on object type) expanded the first time they are loaded. I have tried several ways to do this but they all seem to have issues. I think most of the issues have to do with the fact that the row is not actually created or loaded at the time I try to expand it. I found the example used to expand all rows and that works but my tree is way to big to do that all the time.

My current approach is to handle the RowLoaded event and if the e.DataElement meets the criteria call TreeListView.ExpandHierarchyItem(e.DataElement). This actually works except the TreeListView is initially blank (except with a scrollbar on the bottom). If I click the scoll bar the tree shows up (and the scroll bar goes away). The other issue with this is that if one of the expanded nodes is a child of a node that is not expanded the whole tree disappears never to return.

Here is my RowLoaded event handler (not terribly complicated).

        private void TreeView_RowLoaded(object sender, Telerik.Windows.Controls.GridView.RowLoadedEventArgs e)
        {
            if ((e.DataElement != null) && (e.Row is GridViewRow) && !(e.Row is GridViewNewRow))
            {
                if (e.DataElement is myObjectType)
                {
                    this.TreeView.ExpandHierarchyItem(e.DataElement);
                }
            }
        }

Is there a better way to do this?

Thanks
Dave Goughnour

Jake
Top achievements
Rank 1
 answered on 09 Aug 2012
0 answers
89 views

We have a RadGridView populate with some items. If we scroll to the bottom and delete some items the vertical scrollbar disappear and all the items are moved to the top and at the bottom remain white spaces.  I’m using RadControls for WPF Q1 2011 SP1 and we are obligated by the client to use this telerik version so if this was fixed in future releases please provide me a workaround solution.

Best regards,

Cotutiu Lucian.

Lucian
Top achievements
Rank 1
 asked on 09 Aug 2012
0 answers
45 views

This bug exist in multiple examples from demo application(Appearance/Columns, Scrolling, Date Formatting, and for Commands using ctrl for multi selection). If you move to the bottom of the grid from vertical scrollbar and delete one or multiple items from the bottom, on the top of the grid white spaces appear. I’m using RadControls for WPF Q1 2011 SP1 and we are obligated by the client to use this telerik version so if this was fixed in future releases please provide me a workaround solution.

Best regards,

Cotutiu Lucian.

Lucian
Top achievements
Rank 1
 asked on 09 Aug 2012
1 answer
60 views
Hi all,

I am having an Issue with the RadTreeView.  I am dragging items from one treeview to another, but inside the PreviewDragEnded method setting e.Handled=true does not stop the drag.  I also see that the default drag/drop behavior is still active.

Any ideas?

Cheers,
Brandon
Tina Stancheva
Telerik team
 answered on 09 Aug 2012
5 answers
201 views
Hi,
I have a radDataFilter and radGridView. On a first place data is not loaded. I want after user put a some filter ( example: username start with: sa) to load data from the server based on the filter condition and show it on the grid.

I not see how to do this. In FilterDescriptors_ItemChanged event i capture what user ask to filter, send a request to load a data but it not show on the grid.

Please advise more better way to do this.

Best regards,
Saykor
Saykor
Top achievements
Rank 2
 answered on 09 Aug 2012
2 answers
350 views
I currently have a RadGridView that is bound to a collection of objects. One of those objects contains a property that is calculated based on a user-supplied value, so whenever the user changes the value, the value in every row changes as well.

I am able to manually update the Footer Aggregate using .CalculateAggregates(), however if the Grid is grouped, this does not update the aggregates that are located in the group totals.

How can I make the RadGridView re-calculate the aggregates in the grouped records? The relevant bits of code are below

<TextBox Text="{Binding SalePercent}" />

<
telerik:RadGridView x:Name="MyGrid" DataContextChanged="MyGrid_DataContextChanged"
           ItemsSource="{Binding MyObservableCollection}" ShowColumnFooters="True">
    <telerik:RadGridView.Columns>
        <telerik:GridViewDataColumn DataMemberBinding="{Binding Price, StringFormat=N2}" Header="Price">
            <telerik:GridViewDataColumn.AggregateFunctions>
                <telerik:SumFunction Caption="Price: " ResultFormatString="{}{0:C}" />
            </telerik:GridViewDataColumn.AggregateFunctions>
        </telerik:GridViewDataColumn>
        <telerik:GridViewDataColumn DataMemberBinding="{Binding SalePrice, StringFormat=N2}" Header="Sale Price">
            <telerik:GridViewDataColumn.AggregateFunctions>
                <telerik:SumFunction Caption="Sale Price: " ResultFormatString="{}{0:C}" />
            </telerik:GridViewDataColumn.AggregateFunctions>
        </telerik:GridViewDataColumn>
    </telerik:RadGridView.Columns>
</telerik:RadGridView>

private
void MyGrid_DataContextChanged(object sender, DependencyPropertyChangedEventArgs e)
{
    MyViewModel vm = MyGrid.DataContext as MyViewModel;
    if (vm != null)
        vm.PropertyChanged += MyViewModel_PropertyChanged;
 
    MyGrid.DataContextChanged -= MyGrid_DataContextChanged;
}
 
void MyViewModel_PropertyChanged(object sender, PropertyChangedEventArgs e)
{
    if (e.PropertyName == "SalePercent")
        MyGrid.CalculateAggregates();
}
void MyViewModel_PropertyChanged(object sender, PropertyChangedEventArgs e)
{
    switch (e.PropertyName)
    {
        case "SalePercent":
            foreach (var item in MyObservableCollection)
                item.SalePrice = item.Price * SalePercent;
            break;
    }
}
LHR
Top achievements
Rank 1
 answered on 09 Aug 2012
4 answers
311 views
Hi,


I'm using the drag and drop functionality of the RadTreeView, with a hierarchical list of transportation rides with multiple addresses.
I've managed to add some logic to make sure no rides can be added to addresses and stuff like that, using the existing handlers:

TreeviewMonday.AddHandler(RadDragAndDropManager.DropQueryEvent, new EventHandler<DragDropQueryEventArgs>(OnDropQuery), true);


I do, however, have 2 problems/questions when using the drag and drop between tree views:

1. The preview, when dragging, is shown but stays empty.
2. How can I change the tooltip that is shown when dropping is possible? I would like to change the language of the text and add custom text to it.

(these problems are shown in the screenshot in attachment)

Hope someone can help! Thanks in advance.

Best regards,
Pieter Jan
Nick
Telerik team
 answered on 09 Aug 2012
1 answer
119 views
Hello,

I read about the sampling for radchart.  Is this available for chartview for a barseries?  If so, how would I go about using it?

Thanks,
Eric
Evgenia
Telerik team
 answered on 09 Aug 2012
19 answers
218 views
I need to print my datagrids. I looked to WPF Control Examples and found appropriate one. However it prints data in such a way that first column overlaps itself.

I have attached sample file. This file comes right from Telerik Examples.

I tried it with XPS printer and PDF Creator printer and effects where the same.

How can I print the whole datagrid?
Vlad
Telerik team
 answered on 09 Aug 2012
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
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
Cynthia
Top achievements
Rank 1
Iron
Toby
Top achievements
Rank 3
Iron
Iron
Iron
Danielle
Top achievements
Rank 1
Iron
Iron
Joel
Top achievements
Rank 3
Bronze
Bronze
Iron
yw
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Cynthia
Top achievements
Rank 1
Iron
Toby
Top achievements
Rank 3
Iron
Iron
Iron
Danielle
Top achievements
Rank 1
Iron
Iron
Joel
Top achievements
Rank 3
Bronze
Bronze
Iron
yw
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?