Telerik Forums
UI for WPF Forum
2 answers
289 views
Hi,

I am using the datafilter in the mvvm pattern, with the filter collection data stored in the viewmodel, which is then used to build a query to run against a WCF Data Services / OData IQueryable entity.  I'm not connecting the datafilter to another itemscontrol to be populated with ItemProperties, but rather creating my own item properties via reflection and linq off the entity type.

One issue is that I cannot bind to the FilterDescriptors property of the datafilter as it is readonly, so instead I am using a bit of code-behind code to persist this collection between the view and viewmodel when the datacontext changes.

The inability to bind to FilterDescriptors is causing one problem, which is why I am posting here.  I am saving/loading the filter data to/from a database, and would like to know when the data becomes 'dirty' (so that i can indicate visually that the data should be saved).  This is ok for filters being added or removed (via the CollectionChanged event) or for the logical operator being changed (via the PropertyChanged event), but I cannot find any way of detecting when the value of any of the simple filter properties (Member, Operator or MemberValue) have changed.

I've tried adding handlers for all sorts of events on the datafilter and on its viewmodel, but none of the handlers are hit when editing the filters.  I have even looped through the RadDataFilter.ViewModel.CompositeFilter.Filters collection, adding handlers for each item's PropertyChanged event, but still nothing.

So, is there something I can do that I have missed - or - can an event be added when these simple filter values are changed, or can the FilterDescriptors property on the control be made bindable?

Thanks.
ianr
Top achievements
Rank 1
 answered on 20 Aug 2010
3 answers
167 views
Hi Telerik,
I'm working on a project that needs to load a massive amount of data into the grid.
The data loading is divided into two chunks: the first chunk will bring only several rows for the user to be able to start working with.
The second chunk will load the rest of the data in a separate thread.

While loading the first chunk I'm setting the IsBusy property to true.
Once the first chunk is loaded isBusy is false (the user should be able to start working), and I want to "add" a row to the end of the grid's rows collection that will represent a loading indicator (like in the iPhone) - this is exactly like in the iPhone (see attachment).

I tried to make modifications in the grid's GridViewScrollViewer template by changing the content of the ScrollContentPresenter to contain a ContentPresenter with the loading indicator below it (I made it a button for simplicity).
<ScrollContentPresenter
    Grid.Row="2"
    CanContentScroll="{TemplateBinding CanContentScroll}"
    CanHorizontallyScroll="False"
    CanVerticallyScroll="False">
    <ScrollContentPresenter.Content>
        <StackPanel Orientation="Vertical">
            <ContentPresenter
                ContentTemplate="{TemplateBinding ContentTemplate}"
                Content="{TemplateBinding Content}"
                ContentStringFormat="{TemplateBinding ContentStringFormat}" />

      <!-- Loading indicator -->
                <Button
                    Content="Loading..." />
        </StackPanel>
    </ScrollContentPresenter.Content>
</ScrollContentPresenter>

This works well when applied to a regular ScrollViewer's template, but on GridViewScrollViewer template it throws an exception:
In a FrameworkTemplate, ContentPresenter and GridViewRowPresenter cannot be in each other inclusively or exclusively.

Please help!!
Regards,

David.
Vlad
Telerik team
 answered on 20 Aug 2010
4 answers
387 views
Hello. I'm concerned about the performance of the RadTreeView. I created a simplistic project where I create 1001 items, one root item with 1000 sub items and the RadTreeView's size is 24.84 MB, so I thought something must be wrong because I'm just putting strings in the RadTreeViewItems, so I checked with a memory profiler, and I found out that a lot of very heavy objects are created. The ones that jump out the most are these three:

55,308x EffectiveValueEntry[] (4.69MB)
9,011x Rectangle (2.52MB)
8,019x Grid (2.17MB)

Now, this is in a simplistic problem. In our real project these numbers are much bigger (also with around 1000 items). The number of rectangles goes up to 17,000 when we display the RadTreeView and it has become a major issue for us because it uses a lot of memory. Just by displaying our tree, which is very complex, the memory usage goes up 76mb and we have two of them so that makes 152mb for both trees. We're now working in just using one tree, but 76mb is still a lot of memory of the one tree.

Here's a video I captured while making sure the items are coming from the RadTreeView:

http://www.screencast.com/users/CarloToribio/folders/Jing/media/88771fe2-84b6-4ad3-92c3-2a6f31bc32c6

Let me know if there's anything we can do, and also minimizing GUI loses.

Thanks. By the way we're using the 2009.3.1208.35 RadTreeViewItem version.

Let me know. Thank you.
Miro Miroslavov
Telerik team
 answered on 20 Aug 2010
3 answers
106 views
Can you advise what change is required so that the scroll bar appearance is the same as the default WPF scroll bar.
Miro Miroslavov
Telerik team
 answered on 20 Aug 2010
1 answer
132 views
I created a simple RadChart with the following code that binds to a collection of data.  The x-axis binds to Date property of DateTIme and the y-axis binds to Quantity property of type Int.  When I try and set a property in ChartARea.AXisX, the UI is not updated.  For example, I try and set LabelRotationAngle = 45.  Nothing happens.  What I see in the x-axis since it is bound to DateTIme values, is LongDateTime format values which is making the x-axis all messy.  I set DefaultLabelFormat="dd-MMM" but the UI doesn't get updated again. 

Can anyone figure out why my chart is not getting updated in the UI.  I've looked at all the Chart Sample Demo's and my XAML looks pretty much the same.  Not sure what I'm doing wrong where the UI does not updated.

Thanks

<telerikChart:RadChart Grid.Row="1" Foreground="White" Background="Transparent" x:Name="RadChart1" ItemsSource="{Binding MetricSum}">
                <telerikChart:RadChart.DefaultView>
                    <Charting:ChartDefaultView>
                        <Charting:ChartDefaultView.ChartArea>
                            <Charting:ChartArea LegendName="chartLegend">
                                <Charting:ChartArea.AxisX>
                                    <Charting:AxisX AutoRange="True" Step="5" DefaultLabelFormat="dd-MMM" LabelRotationAngle="45" IsDateTime="True"
                                                    LayoutMode="Normal" LabelStep="5" TicksDistance="100" Title="XAxis Title">
                                    </Charting:AxisX>
                                </Charting:ChartArea.AxisX>
                            </Charting:ChartArea>
                        </Charting:ChartDefaultView.ChartArea>
                        <Charting:ChartDefaultView.ChartLegend>
                            <Charting:ChartLegend x:Name="chartLegend" Header="Legend" UseAutoGeneratedItems="True"  />
                        </Charting:ChartDefaultView.ChartLegend>
                        <Charting:ChartDefaultView.ChartTitle>
                            <Charting:ChartTitle Content="" HorizontalAlignment="Left" />
                        </Charting:ChartDefaultView.ChartTitle>
                    </Charting:ChartDefaultView>
                </telerikChart:RadChart.DefaultView>
                <telerikChart:RadChart.PaletteBrushes>
                    <SolidColorBrush Color="DarkBlue" />
                    <SolidColorBrush Color="Red" />
                </telerikChart:RadChart.PaletteBrushes>
                <telerikChart:RadChart.SeriesMappings>
                    <Charting:SeriesMapping CollectionIndex="0" LegendLabel="Expected">
                        <Charting:SeriesMapping.SeriesDefinition>
                            <Charting:LineSeriesDefinition ShowPointMarks="True" ShowItemLabels="False" ShowItemToolTips="True" ItemToolTipFormat="Quintiles Expected&#x0a;#X{MMM/yy}&#x0a;value: #Y">
                                <Charting:LineSeriesDefinition.Appearance>
                                    <Charting:SeriesAppearanceSettings StrokeThickness="5"></Charting:SeriesAppearanceSettings>
                                </Charting:LineSeriesDefinition.Appearance>
                            </Charting:LineSeriesDefinition>
                        </Charting:SeriesMapping.SeriesDefinition>
                        <Charting:SeriesMapping.ItemMappings>
                            <Charting:ItemMapping FieldName="Date" DataPointMember="XValue" />
                            <Charting:ItemMapping FieldName="Quantity" DataPointMember="YValue" />
                        </Charting:SeriesMapping.ItemMappings>
                    </Charting:SeriesMapping>
                    <Charting:SeriesMapping CollectionIndex="1" LegendLabel="Actual">
                        <Charting:SeriesMapping.SeriesDefinition>
                            <Charting:LineSeriesDefinition ShowPointMarks="True" ShowItemLabels="False" ShowItemToolTips="True" ItemToolTipFormat="Quintiles Actual&#x0a;#X{MMM/yy}&#x0a;value: #Y">
                                <Charting:LineSeriesDefinition.Appearance>
                                    <Charting:SeriesAppearanceSettings StrokeThickness="5"></Charting:SeriesAppearanceSettings>
                                </Charting:LineSeriesDefinition.Appearance>
                            </Charting:LineSeriesDefinition>
                        </Charting:SeriesMapping.SeriesDefinition>
                        <Charting:SeriesMapping.ItemMappings>
                            <Charting:ItemMapping FieldName="Date" DataPointMember="XValue" />
                            <Charting:ItemMapping FieldName="Quantity" DataPointMember="YValue" />
                        </Charting:SeriesMapping.ItemMappings>
                    </Charting:SeriesMapping>
                </telerikChart:RadChart.SeriesMappings>
            </telerikChart:RadChart>
Nikolay
Telerik team
 answered on 20 Aug 2010
1 answer
125 views
Hello,
I bound the RadTreeView to an ObservableCollection of TreeFolderHierarchyItem (my object)
public class TreeFolderHierarchyItem : INotifyPropertyChanged
    {
        #region properties
        private string _header;
        private bool _isexpanded;
        private string _defaultimagesrc;
        private string _expandedimagesrc;
        private string _collapsedimagesrc;
        private TreeFolderItem _tag;
        private TreeFolderHierarchy _items;
        public string Header
        {
            get { return _header; }
            set
            {
                if (value != _header)
                {
                    _header = value;
                    OnPropertyChange("Header");

                }
            }
        }
        public bool IsExpanded
        {
            get { return _isexpanded; }
            set {
                if (value != _isexpanded)
                {
                    _isexpanded = value;
                    OnPropertyChange("IsExpanded");
                }
            }
        }
        public string DefaultImageSource
        {
            get { return _defaultimagesrc; }
            set
            {
                if (value != _defaultimagesrc)
                {
                    _defaultimagesrc = value;
                    OnPropertyChange("DefaultImageSource");
                }
            }
        }
        public string ExpandedImageSource
        {
            get { return _expandedimagesrc; }
            set
            {
                if (value != _expandedimagesrc)
                {
                    _expandedimagesrc = value;
                    OnPropertyChange("ExpandedImageSource");
                }
            }
        }

        public string CollapsedImageSource
        {
            get { return _collapsedimagesrc; }
            set
            {
                if (value!= _collapsedimagesrc)
                {
                    _collapsedimagesrc = value;
                    OnPropertyChange("CollapsedImageSource");
                }
            }
        }
        public TreeFolderItem Tag
        {
            get { return _tag; }
            set
            {
                if (value != _tag)
                {
                    _tag = value;
                    OnPropertyChange("Tag");
                }
            }
        }
        public TreeFolderHierarchy Items
        {
            get
            {
                return _items;
            }
            set
            {
                if (value != _items)
                {
                    _items = value;
                    OnPropertyChange("Child");
                }
            }
        }
        public int ID
        {
            get { return Tag.ID; }
            set {
                if (value != Tag.ID)
                {
                    Tag.ID = value;
                    OnPropertyChange("ID");
                }            
            }
        }
 
        public TreeFolderHierarchyItem(TreeFolderItem tag, bool isexpanded )
        {
            _items = new TreeFolderHierarchy();
            if (tag == null)
                throw new ArgumentException();
            _tag = tag;

            SetProperties(isexpanded);

        }
        private void SetProperties(bool isexpanded)
        {
            _header = _tag.Titre;
            _isexpanded = isexpanded;            
            switch (_tag.Type)
            {
                case TreeFolderType.Acte:
                    _defaultimagesrc = "folder.png";
                    _expandedimagesrc = "openedfolder.png";
                    _collapsedimagesrc = "folder.png";
                    break;
                case TreeFolderType.Message:
                    _defaultimagesrc = "sent.png";
                    _expandedimagesrc = "sent.png";
                    _collapsedimagesrc = "sent.png";
                    break;
                case TreeFolderType.Pdf:
                    _defaultimagesrc = "3Drafts.png";
                    _expandedimagesrc = "3Drafts.png";
                    _collapsedimagesrc = "3Drafts.png";
                    break;
                case TreeFolderType.Libre:
                    _defaultimagesrc = "1PersonalFolder.png";
                    _expandedimagesrc = "1PersonalFolder.png";
                    _collapsedimagesrc = "1PersonalFolder.png";
                    break;
            }
 

        }

  
        #endregion

        public event PropertyChangedEventHandler PropertyChanged;


        // Helper Methods
        private void OnPropertyChange(string propertyName)
        {
            if (PropertyChanged != null)
            {
                PropertyChanged(thisnew PropertyChangedEventArgs(propertyName));
            }
        }
    }

Since this this an observablecollection, I just need to add a new TreeFolderHierarchyItem object to my observable collection
Adding new Item works fine and RadTreeView control refreshs correctly with the new item. But I want, enter in edit mode for this new item in order to change its header .
using MyRadViewTree.ItemContainerGenerator.ContainerFromIndex(0) returns always null even when all the node are expanded . So I am not able to iterate into the hierarchy ...
I thought to set IsEditMode=True but when I calls MyRadTreeVieew.Items I get my Observable collection of TreeFolderHierarchyItem  as expected but useless for setting the EditMode ..
What am I doing wrong ?
Thanks for your help

Miro Miroslavov
Telerik team
 answered on 20 Aug 2010
1 answer
154 views
Hi

Can we set the width of the tabcontrol according to the containter Control?

For eg:
The tab control size should increase according to the usercontrol size.
Miro Miroslavov
Telerik team
 answered on 20 Aug 2010
4 answers
138 views
Hi,

I know there is new feature in current version copy paste into excel. but i found only demo. would you please provide me example in C#.


RadControls for WPF Trial Version: 2010.2 812 

thank you.

Yavor Georgiev
Telerik team
 answered on 19 Aug 2010
2 answers
403 views
Hello,

I would like to have the Slider thumb control move to the correct position when I set the value programmatically.  How would I go about doing this?

Thanks
Ryan Black
Ryan Black
Top achievements
Rank 1
 answered on 19 Aug 2010
4 answers
465 views
Hi,
We are having trouble getting a RadDock in WPF to resize to the height/width of it's container.  We'd like it to be 100% of the grid row's height and width so it adjusts to the size of the window as it's the main area users will work in.

We want a RadRibbon to appear at the top of the screen in a manner where the user cannot remove it then have the docking area for windows appear beneath that taking up the remaining space in height.

<Window x:Class="Company.ApplicationName.UI.DesktopClient.Windows.Main"
    xmlns:controls="clr-namespace:Company.ApplicationName.UI.DesktopClient.Controls"
    Title="Main" xmlns:telerik="http://schemas.telerik.com/2008/xaml/presentation" 
    WindowStartupLocation="CenterScreen"
    WindowState="Maximized" Height="600" Width="700" Icon="/Company.ApplicationName.UI.DesktopClient;component/Resources/application_icon.png">
    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto"/>
            <RowDefinition Height="*"/>
        </Grid.RowDefinitions>
        <telerik:RadRibbonBar Margin="0,0,0,0" Name="radRibbonBar1" VerticalAlignment="Top" Title="Main Dashboard" ApplicationName="Available To Promise" ApplicationButtonImageSource="/Company.ApplicationName.UI.DesktopClient;component/Resources/application_logo.png" ClipToBounds="True" >
            <telerik:RadRibbonBar.ApplicationMenu>
                <telerik:ApplicationMenu>
                    <telerik:RadRibbonButton LargeImage="/Company.ApplicationName.UI.DesktopClient;component/Resources/MenuItems/save.png" Text="Save"/>
                    <telerik:RadRibbonButton LargeImage="/Company.ApplicationName.UI.DesktopClient;component/Resources/MenuItems/exit.png" Text="Exit"/>
                </telerik:ApplicationMenu>
            </telerik:RadRibbonBar.ApplicationMenu>
  
            <telerik:RadRibbonTab Header="Home">
                <telerik:RadRibbonGroup Header="Clipboard">
                    <telerik:RadRibbonSplitButton Text="Paste" LargeImage="/Company.ApplicationName.UI.DesktopClient;component/Resources/MenuItems/paste.png" Size="Large"
              telerik:ScreenTip.Title="Paste(Ctrl+V)"
              telerik:ScreenTip.Description="Paste the contents the Clipboard.">
                        <telerik:RadRibbonSplitButton.DropDownContent>
                            <telerik:RadContextMenu BorderThickness="0">
                                <telerik:RadMenuItem Header="Paste"/>
                            </telerik:RadContextMenu>
                        </telerik:RadRibbonSplitButton.DropDownContent>
                    </telerik:RadRibbonSplitButton>
                </telerik:RadRibbonGroup>
            </telerik:RadRibbonTab>
            <telerik:RadRibbonTab Header="Admin">
            </telerik:RadRibbonTab>
            <telerik:RadRibbonTab Header="View"/>
            </telerik:RadRibbonBar>
            <telerik:RadRibbonTab Header="Planning">
            </telerik:RadRibbonTab>
            <telerik:RadRibbonTab Header="Reports">
            </telerik:RadRibbonTab>
            <telerik:RadRibbonTab Header="Modeling Scenarios">
            </telerik:RadRibbonTab>
        <Grid Grid.Row="1">
            <Grid.RowDefinitions>
                <RowDefinition Height="Auto"/>
                <RowDefinition Height="*"/>
            </Grid.RowDefinitions>
            <telerik:RadDocking ClipToBounds="True" Margin="0,0,0,0" AllowUnsafeMode="True" VerticalAlignment="Stretch" HorizontalContentAlignment="Stretch" VerticalContentAlignment="Stretch" >
            <telerik:RadDocking.DocumentHost>
                <telerik:RadSplitContainer>
                    <telerik:RadPaneGroup>
                        <telerik:RadPane Header="Description">
                            <TextBlock TextWrapping="Wrap" Text="On the Documents tab above press Ctrl + Mouse Left button to display the Popup Menu. You can use the same combination on every tab."/>
                        </telerik:RadPane>
                        <telerik:RadPane Header="NonDraggable" CanFloat="False">
                            <TextBlock TextWrapping="Wrap" Text="This pane cannot be dragged, because it has its property CanFloat set 'False'."/>
                        </telerik:RadPane>
                    </telerik:RadPaneGroup>
                </telerik:RadSplitContainer>
            </telerik:RadDocking.DocumentHost>
  
            <telerik:RadSplitContainer InitialPosition="DockedLeft" VerticalAlignment="Bottom">
                <telerik:RadPaneGroup>
                    <telerik:RadPane Header="Progress/Schedule">
                        <controls:ProgressBar></controls:ProgressBar>
                    </telerik:RadPane>
                    <telerik:RadPane Header="Server Explorer"/>
                </telerik:RadPaneGroup>
            </telerik:RadSplitContainer>
  
            <telerik:RadSplitContainer InitialPosition="DockedRight">
                <telerik:RadPaneGroup>
                    <telerik:RadPane Header="Properties"/>
                    <telerik:RadPane Header="Solution Explorer"/>
                </telerik:RadPaneGroup>
            </telerik:RadSplitContainer>
  
            <telerik:RadSplitContainer InitialPosition="DockedBottom">
                <telerik:RadPaneGroup>
                    <telerik:RadPane Header="Output"/>
                    <telerik:RadPane Header="Error List"/>
                </telerik:RadPaneGroup>
            </telerik:RadSplitContainer>
  
        </telerik:RadDocking>
            </Grid>
          
    </Grid>
</Window>
jgill
Top achievements
Rank 1
 answered on 19 Aug 2010
Narrow your results
Selected tags
Tags
+? more
Top users last month
Rob
Top achievements
Rank 3
Iron
Iron
Iron
Atul
Top achievements
Rank 1
Iron
Iron
Alexander
Top achievements
Rank 1
Veteran
Iron
Serkan
Top achievements
Rank 1
Iron
Shawn
Top achievements
Rank 1
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Rob
Top achievements
Rank 3
Iron
Iron
Iron
Atul
Top achievements
Rank 1
Iron
Iron
Alexander
Top achievements
Rank 1
Veteran
Iron
Serkan
Top achievements
Rank 1
Iron
Shawn
Top achievements
Rank 1
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?