Telerik Forums
UI for WPF Forum
2 answers
207 views
Hi,
i tried to export my RadGridView as PNG (followed this guide: http://www.telerik.com/help/wpf/common-export-support.html) works fine, but i want all the rows on the PNG-file. How do i do that? Adjust the grid.height right before the export?

I need a screenshot/image, word/excel is unfortunately not enough.
Joscha
Top achievements
Rank 2
 answered on 10 Jan 2014
1 answer
191 views
I have a RadGridView populated by a collection of objects. The first column uses a converter for the DataMemberBinding like so:

<telerik:GridViewDataColumn
    Name="NotificationTypeGridViewDataColumn"
    Header="Type"
    MinWidth="100"
    Width="100"
    IsSortable="True"
    SortingState="None"
    DataMemberBinding="{Binding Converter={StaticResource notificationTypeConverter}}"
    >
</telerik:GridViewDataColumn>

The converter returns a string based on the typeof(object) in the collection.  Since there is no property on the object I can name for the SortMemberPath to sort from, how then can I sort this GridViewDataColumn based on the string returned by the converter?  Do I have to use the "Sorting" handler and custom sort all of the columns?  Thanks.
Don
Top achievements
Rank 1
 answered on 10 Jan 2014
1 answer
146 views
Hi,

We have just updated from .Net Framework 3.5 to 4.5.
Since we did this, when the grid is validated, the first column of the lines in error is considered to be in error as well and is showing all the errors contained in the row.

Is there a way to disable this feature, it is really annoying for us.

Also, if there are errors in the row details, they are shown in the first column of the parent row and they may contain the same error more than once...


We are using version 2013.3.1204.45.

Thanks
Yoan
Telerik team
 answered on 09 Jan 2014
1 answer
214 views

Hi

For some reason i only able to work with the .NET 3.5 Version of Telerik-Controls.



I'm having a hard time trying to Change the Color of the SelectedItem in a TreeView.

I tried using your sample from another post here. But since the control template used there uses VisualStates, i cannot use it in .NET 3.5.



I have this control:

<UserControl
    x:Class="My.Controls.Views.TreeView"
    xmlns:windows="clr-namespace:Telerik.Windows;assembly=Telerik.Windows.Controls"
    mc:Ignorable="d"
    d:DesignHeight="300" d:DesignWidth="300"
    Name="TreeControlView">
    <UserControl.Resources>
        <Style TargetType="ToggleButton" x:Key="Expander">
            <Setter Property="IsTabStop" Value="False" />
            <Setter Property="Cursor" Value="Hand" />
            <Setter Property="Template">
                <Setter.Value>
                    <ControlTemplate TargetType="{x:Type ToggleButton}">
                        <ControlTemplate.Triggers>
                            <Trigger Property="IsMouseOver" Value="True">
                                <Trigger.EnterActions>
                                    <BeginStoryboard>
                                        <Storyboard>
                                            <DoubleAnimation
                                                Duration="0:0:0.05"
                                                Storyboard.TargetName="Button"
                                                Storyboard.TargetProperty="Opacity" To="0" />
                                            <DoubleAnimation
                                                Duration="0:0:0.05"
                                                Storyboard.TargetName="ButtonOver"
                                                Storyboard.TargetProperty="Opacity" To="1" />
                                        </Storyboard>
                                    </BeginStoryboard>
                                </Trigger.EnterActions>
                            </Trigger>
                            <Trigger Property="IsChecked" Value="True">
                                <Trigger.EnterActions>
                                    <BeginStoryboard>
                                        <Storyboard>
                                            <DoubleAnimation
                                                Duration="0:0:0.05"
                                                Storyboard.TargetName="CollapsedVisual"
                                                Storyboard.TargetProperty="Opacity" To="0" />
                                            <DoubleAnimation
                                                Duration="0:0:0.05"
                                                Storyboard.TargetName="CollapsedVisualOver"
                                                Storyboard.TargetProperty="Opacity" To="0" />
                                        </Storyboard>
                                    </BeginStoryboard>
                                </Trigger.EnterActions>
                                <Trigger.ExitActions>
                                    <BeginStoryboard>
                                        <Storyboard>
                                            <DoubleAnimation
                                                Duration="0:0:0.05"
                                                Storyboard.TargetName="CollapsedVisual"
                                                Storyboard.TargetProperty="Opacity" To="1" />
                                            <DoubleAnimation
                                                Duration="0:0:0.05"
                                                Storyboard.TargetName="CollapsedVisualOver"
                                                Storyboard.TargetProperty="Opacity" To="1" />
                                        </Storyboard>
                                    </BeginStoryboard>
                                </Trigger.ExitActions>
                            </Trigger>
                        </ControlTemplate.Triggers>
                        <Grid>
                            <Grid x:Name="Button" Margin="0,7,4,0" HorizontalAlignment="Right" VerticalAlignment="Top" Width="11" Height="11">
                                <Grid.Background>
                                    <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
                                        <GradientStop Color="#3F047BA5" Offset="0.996" />
                                        <GradientStop Color="#00000000" Offset="0" />
                                    </LinearGradientBrush>
                                </Grid.Background>
                                <Rectangle Stroke="#FF000000" HorizontalAlignment="Left" VerticalAlignment="Top" Width="11" Height="11" />
                                <Rectangle
                                    x:Name="CollapsedVisual" Fill="#FF000000"
                                    HorizontalAlignment="Left" VerticalAlignment="Top"
                                    Width="1" Height="5" Margin="5,3,0,0" />
                                <Rectangle
                                    Fill="#FF000000" VerticalAlignment="Top"
                                    HorizontalAlignment="Left" Height="1" Width="5"
                                    Margin="3,5,0,0" />
                            </Grid>
                            <Grid
                                x:Name="ButtonOver" Margin="0,7,4,0"
                                HorizontalAlignment="Right" VerticalAlignment="Top"
                                Width="11" Height="11">
                                <Rectangle
                                    Stroke="#FF167497" HorizontalAlignment="Left"
                                    VerticalAlignment="Top" Width="11" Height="11">
                                    <Rectangle.Fill>
                                        <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
                                            <GradientStop Color="#26167497" Offset="1" />
                                            <GradientStop Color="#00167497" Offset="0" />
                                        </LinearGradientBrush>
                                    </Rectangle.Fill>
                                </Rectangle>
                                <Rectangle
                                    x:Name="CollapsedVisualOver" Fill="#FF167497"
                                    HorizontalAlignment="Left" VerticalAlignment="Top"
                                    Width="1" Height="5" Margin="5,3,0,0" />
                                <Rectangle
                                    Fill="#FF167497" VerticalAlignment="Top"
                                    HorizontalAlignment="Left" Height="1" Width="5"
                                    Margin="3,5,0,0" />
                            </Grid>
                        </Grid>
                    </ControlTemplate>
                </Setter.Value>
            </Setter>
        </Style>
    </UserControl.Resources>
    <telerik:RadTreeView
        x:Name="BaseTreeView"
        telerik:TextSearch.TextPath="Header"
        ExpanderStyle="{StaticResource Expander}"
        IsLoadOnDemandEnabled="False"
        IsVirtualizing="True"
        telerik:TreeViewPanel.IsVirtualizing="True"
        telerik:TreeViewPanel.VirtualizationMode="Hierarchical"
        telerik:AnimationManager.IsAnimationEnabled="False" ItemDoubleClick="BaseTreeView_ItemDoubleClick"
        >
        <telerik:RadTreeView.ContextMenu>
            <ContextMenu Name="_treeViewContextMenu">
                <MenuItem Header="Expand All" Click="ContextMenuExpandAll" />
                <MenuItem Header="Collapse All" Click="ContextMenuCollapseAll" />
                <Separator x:Name="_expandCollapseSeparator" x:FieldModifier="private" Visibility="Collapsed" />
                <MenuItem x:Name="_expandMenuItem" x:FieldModifier="private" Header="Expand" Click="ContextMenuExpand" Visibility="Collapsed" />
                <MenuItem x:Name="_collapseMenuItem" x:FieldModifier="private" Header="Collapse" Click="ContextMenuCollapse" Visibility="Collapsed" />
            </ContextMenu>
        </telerik:RadTreeView.ContextMenu>
        <telerik:RadTreeView.ItemTemplate>
            <HierarchicalDataTemplate ItemsSource="{Binding Children}" >
                <StackPanel Orientation="Horizontal">
                    <TextBlock Text="{Binding Header}">
                        <TextBlock.Style>
                            <Style TargetType="TextBlock">
                                <Style.Triggers>
                                    <DataTrigger Binding="{Binding IsTemplateSet, RelativeSource={RelativeSource AncestorType={x:Type views:TreeView}}}" Value="True">
                                        <Setter Property="Visibility" Value="Collapsed" />
                                    </DataTrigger>
                                </Style.Triggers>
                            </Style>
                        </TextBlock.Style>
                        <ToolTipService.ToolTip>
                            <ToolTip>
                                <ToolTip.Content>
                                    <StackPanel Orientation="Horizontal">
                                        <TextBlock Text="{Binding ToolTip}" />
                                    </StackPanel>
                                </ToolTip.Content>
                            </ToolTip>
                        </ToolTipService.ToolTip>                       
                    </TextBlock>
                    <ContentPresenter x:Name="TreeItemContent" Content="{Binding Value}" ContentTemplate="{Binding TreeItemContentTemplate, RelativeSource={RelativeSource AncestorType={x:Type views:TreeView}}}" >
                        <ContentPresenter.Style>
                            <Style TargetType="ContentPresenter">
                                <Style.Triggers>
                                    <DataTrigger Binding="{Binding IsTemplateSet, RelativeSource={RelativeSource AncestorType={x:Type views:TreeView}}}" Value="False">
                                        <Setter Property="Visibility" Value="Collapsed" />
                                    </DataTrigger>
                                </Style.Triggers>
                            </Style>
                        </ContentPresenter.Style>
                    </ContentPresenter>
                </StackPanel>
            </HierarchicalDataTemplate>
        </telerik:RadTreeView.ItemTemplate>
        <telerik:RadTreeView.ItemContainerStyle>
            <Style TargetType="telerik:RadTreeViewItem" >
                <Setter Property="IsSelected" Value="{Binding Selected, Mode=TwoWay}" />
                <Style.Triggers>
                    <DataTrigger Binding="{Binding IsMarked }" Value="True">
                        <Setter Property="Background" Value="#F9D381" />
                    </DataTrigger>
                    <DataTrigger Binding="{Binding ContainsMarkedItems }" Value="True">
                        <Setter Property="Background" Value="#F9EBCC" />
                    </DataTrigger>
                </Style.Triggers>
            </Style>
        </telerik:RadTreeView.ItemContainerStyle>       
    </telerik:RadTreeView>
</UserControl>


I cannot seem to create a Style for RadTreeViewItem and with a different Color for SelectedItem and set it as BasedOn in the ItemContainerStyle.



Any help would really be appreciated!



Regards

Jonathan

Martin Ivanov
Telerik team
 answered on 09 Jan 2014
2 answers
267 views

Is it possible to set the color of a line segment for a specific point?  This is basically the same functionality where you'd set the color of a particular column in a column chart, but in this case you have a line chart (with no point markers) & so want to set the line segment either to/from that point.


Thanks - Mitch

Mitchell
Top achievements
Rank 1
 answered on 09 Jan 2014
1 answer
175 views
Hello,

I am having a problem with merging documents together and was hoping there would be a solution to this. Currently We are combining RadDocuments together with the following code found on another thread.

private RadDocument MergeDocuments(RadDocument[] documents)
{
    RadDocument mergedDocument = new RadDocument();
   
    foreach (RadDocument document in documents)
    {
        foreach (Section section in document.Sections)
        {
            Section copySection = section.CreateDeepCopy() as Section;
            document.Sections.Remove(section);
            mergedDocument.Sections.Add(copySection);
        }
    }
   
    return mergedDocument;
}

This does combine the documents but it messes with the formatting of them. Documents seem to inherit the header/footer properties of the other document and will also change the spacing and FontFamily of the document. I thought that this had something to do with the default values for a new RadDocument but I can't seem to figure out how to preserve each individual documents formatting when combining them.

I basically would like to append a document to another one and keep them looking the same as they used to just on another page (Their own headers/footers, spacing, font etc). If there is a way to do this I would appreciate any help on how to accomplish this.

Thanks,
Aaron
Missing User
 answered on 09 Jan 2014
1 answer
66 views
I wonder is there somewhere on the site were I can get access to more examples projects.  

In the WPF examples program there are examples for all controls.  Some have loads of examples some have only one or two.  Personally you can never have enough samples.  

When using support,  support sometimes kindly give a small sample app to demonstrate how to do what you want.  These are invaluable.  There should be some sort of repository were people can go and search for these.   Users could even post their own.

Some issues with the 2 example applications the sales dashboard and the executive dashboard.
1) they are basically the same
2) they are nice and flashy but don't really represent real business applications.
3) they only show a very small portion of your controls.

Yana
Telerik team
 answered on 09 Jan 2014
2 answers
126 views
I have a dialog that shows four charts with a single zoom bar that controls the zoom for each of the four charts. These four charts are inside a tabitem, the next tab item in the control contains another four similar charts that show a different representation of the data. All of the charts are scatter charts and have the same x and y axis ranges.

Zooming works perfectly for the four visible charts, but when I change tab I find that the charts that had been invisible during the zoom have zoomed incorrectly and the datapoints are often off the chart. If I try to zoom on these charts again they suddenly correct themselves and zoom correctly, but switching to the first tab reveals that the first set of charts has now zoomed incorrectly. 

I am currently setting the charts like this: 

//Charts on tab 1
Chart1Tab1.Zoom = new Size(value, value);
Chart2Tab1.Zoom = new Size(value, value);
Chart3Tab1.Zoom = new Size(value, value);
Chart4Tab1.Zoom = new Size(value, value);

//Charts on tab 2 
Chart1Tab2.Zoom = new Size(value, value);
Chart2Tab2.Zoom = new Size(value, value);
Chart3Tab2.Zoom = new Size(value, value);
Chart4Tab2.Zoom = new Size(value, value);

Can you suggest a fix so that both sets of charts zoom at the same time in the same way?

Thanks,

Andy. 
Andrew
Top achievements
Rank 1
 answered on 09 Jan 2014
3 answers
123 views
Hi,

I have a timelineview with vertical grouped resources on the left side of scheduleview.
The Default behavior is that appointments get sorted from the longest to the smallest appointment within a resourcegroup.
Is it possible to sort appointments by their subject within a resourcegroup ??

Kind Regards
Kim
Vladi
Telerik team
 answered on 09 Jan 2014
4 answers
217 views
I have found a problem when using IsSynchronizedWithCurrentItem and removing items from an observable list from code-behind. Using the sample code below, if you:
  • Edit the ThirdItem Name field, then use the Delete button (while still in edit mode), ThirdItem remains on the screen but is successfully deleted from the code-behind. You can see this by sorting by any column, and the list gets redrawn correctly.
  • Edit SecondItem Name field, then use the Delete button (while still in edit mode), the list now shows one Firstitem and two ThirdItems! Again, sorting redraws the list correctly.
There are various other strange scenarios with removing items. I haven't been able to reproduce it in the simple example, but in my application there are scenarios where more than one row are removed from the UI on delete (but fine in the ObservableCollection behind), and others where you can delete multiple rows and get one of the deleted rows to show back up (even though it doesn't exist in the Observable Collection). In all these cases, sorting again refreshes the list correctly.

This simple example seem to work fine without the IsSynchronizedWithCurrentItem flag, but my actual application still has similar problems without this flag set when deleting the item currently being edited, so I'm not sure if it's related.

Example Code:

MainWindow.xaml:
<Window x:Class="SortedChangingList.MainWindow"
        Title="MainWindow" Height="350" Width="525">
    <Grid>
        <telerik:RadGridView
                    IsSynchronizedWithCurrentItem="True"
                    AutoGenerateColumns="False"
                    ItemsSource="{Binding ItemCollection}"
                    SelectionMode="Single">
            <telerik:RadGridView.Columns>
                <telerik:GridViewDataColumn DataMemberBinding="{Binding Path=Name}"
                                            Header="Name" />
                <telerik:GridViewDataColumn DataMemberBinding="{Binding Path=Comment}"
                                            Header="Comment" />
                <telerik:GridViewColumn>
                    <telerik:GridViewColumn.CellTemplate>
                        <DataTemplate>
                            <Button
                            Command="{Binding DataContext.DeleteCommand,
                            RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type telerik:RadGridView}}}"
                            CommandParameter="{Binding }">Delete Me</Button>
                        </DataTemplate>
                    </telerik:GridViewColumn.CellTemplate>
                </telerik:GridViewColumn>
            </telerik:RadGridView.Columns>
        </telerik:RadGridView>
    </Grid>
</Window>

MainWindow.xaml.cs:
using System;
using System.Collections.ObjectModel;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Input;
 
namespace SortedChangingList
{
    public class Item
    {
        public string Name { get; set; }
        public string Comment { get; set; }
    }
    public partial class MainWindow : Window
    {
        private RelayCommand _DeleteCommand;
        public ObservableCollection<Item> ItemCollection { get; set; }
        public ICommand DeleteCommand
        {
            get
            {
                return _DeleteCommand ?? (_DeleteCommand = new RelayCommand(DeleteItem));
            }
        }
        public MainWindow()
        {
            ItemCollection = new ObservableCollection<Item>();
            ItemCollection.Add(new Item() { Name = "FirstItem" });
            ItemCollection.Add(new Item() { Name = "SecondItem" });
            ItemCollection.Add(new Item() { Name = "ThirdItem" });
 
            InitializeComponent();
 
            DataContext = this;
        }
        private void DeleteItem(object obj)
        {
            Item item = obj as Item;
            ItemCollection.Remove(item);
        }
    }
 
    public class RelayCommand : ICommand
    {
        private readonly Action<object> _Execute;
        public RelayCommand(Action<object> execute)
        {
            _Execute = execute;
        }
        public bool CanExecute(object parameter)
        {
            return true;
        }
        public event EventHandler CanExecuteChanged
        {
            add { CommandManager.RequerySuggested += value; }
            remove { CommandManager.RequerySuggested -= value; }
        }
        public void Execute(object parameter)
        {
            _Execute(parameter);
        }
    }
}

Louis

Vera
Telerik team
 answered on 08 Jan 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?