Telerik Forums
UI for WPF Forum
1 answer
120 views

Hello,

I'm looking to create generic templates where displayed info, if of a certain type, would be styled as an hyperlink (blue foreground and underlined). When clicked, the button (My first implementation was using a styled RadButton) sends a command from the code-behind. 

Unfortunately, my current implementation even though it works great breaks the Highlighting of the cell and text when searching via the Full search text box on top of the grid.

I have been looking in the source code to understand the way it was implemented, but even templating GridViewCell doesn't seem to work (it never seem to be in Highlighted mode)

 

Any idea?

Best Regards,

Bastian

Stefan
Telerik team
 answered on 29 Sep 2017
2 answers
902 views

In my program,  some time i need to disable some propertyDefinition, when the  propertyDefinition has NestedProperties, i also need disable the expand to prevent user open or close the expander

i try to set the IsEnable propetry as this code

 var expanderButtons= myRadPropertyGrid.ChildrenOfType<RadToggleButton>().Where(b => b.Name == "PART_NestedPropertiesButton").ToList();
            expanderButtons.ForEach(t => t.IsEnabled = false);

it is ok at the beginning but when in the case as follows is not 

1.when close or open the properties group;

2.when call the NestedProperties.Reset() method

3. when  switch the propertyGrid to another one and then switch back

it seems  this method can't be done after the second render

how to achieve this?

thank you

rui
Top achievements
Rank 1
 answered on 29 Sep 2017
2 answers
190 views
Use panelbar How to change the group item  panel to a wrappanel
Stefan
Telerik team
 answered on 29 Sep 2017
3 answers
247 views
Hello,

I've searched the forums and tickets but can't seem to find my specific scenario.

Basically, we have a RadGridView in a RadDocking Pane.  The ItemsSource is bound to a property which is an ObservableCollection.  The issue we are having is when the pane is either pinned or unpinned, the ItemsSource is retrieved again from the property causing scroll position, filters, etc... to be re-set as if the grid was initially loaded.

Is there any way to prevent this from happening, or could this be a bug?  I would like to avoid using an explicit binding mode if possible.

Thanks for the help,
Chris
Martin Ivanov
Telerik team
 answered on 29 Sep 2017
11 answers
389 views
When I have my RadPane's IsHidden property bound to a boolean ViewModel property which is set to true, I get an exception from within Telerik's RadDocking code:

System.NullReferenceException was unhandled by user code
  Message=Object reference not set to an instance of an object.
  Source=Telerik.Windows.Controls.Docking
  StackTrace:
       at Telerik.Windows.Controls.RadDocking.OnRadPaneClose(Object sender, StateChangeCommandEventArgs args) in c:\TB\117\WPF_Scrum\Release_WPF\Sources\Development\Controls\Docking\Docking\Docking\RadDocking.cs:line 834
  InnerException: 

Right now this is preventing me from implementing a full MVVM using your controls. I'm hoping this is something I've done wrong but if not, is there any workaround that I can use to get me past this before this bug is fixed (it is a bug)?

From my sample project with only this in it:

Here's my View XAML:

<Window x:Class="Telerik_IsHidden_RadPane_Bug.MainView"
        xmlns:telerik="http://schemas.telerik.com/2008/xaml/presentation"        mc:Ignorable="d"
        DataContext="{Binding Main, Source={StaticResource Locator}}">
 
    <Grid>
        <!--  Main Window Docking Container (stretch to fill grid) -->
        <telerik:RadDocking Grid.Row="1"
                            HasDocumentHost="false"
                            HorizontalAlignment="Stretch"
                            Margin="0,0,0,32"
                            Name="radDockingMainWindow"
                            VerticalAlignment="Stretch" >
 
            <!--  Split container that holds all of the accordion panels -->
            <telerik:RadSplitContainer telerik:DockingPanel.InitialSize="300, 200"
                                       Name="AccordionContainer"
                                       InitialPosition="DockedLeft"
                                       Orientation="Vertical" VerticalAlignment="Stretch" >
                <!--  Panes must be in pane groups, even if there is just 1 -->
                <telerik:RadPaneGroup MaxWidth="300" x:Name="ToolWindow1Group" >
                    <telerik:RadPane x:Name="ToolWindow1" Title="" CanUserClose="False" CanUserPin="False" CanFloat="True">
                        <Button Content="Example" />
                    </telerik:RadPane>
                </telerik:RadPaneGroup>
            </telerik:RadSplitContainer>
            <telerik:RadSplitContainer InitialPosition="FloatingDockable"                                 
                    telerik:RadDocking.FloatingLocation="450, 250"
                    telerik:RadDocking.FloatingSize="300, 220" x:Name="uxWindowRadSplitContainer" >
                <telerik:RadPaneGroup>
                    <telerik:RadPane Header="Intellifolders" CanDockInDocumentHost="False" IsHidden="{Binding Path=ToolWindowProp}" x:Name="uxToolWindowRadPane">
                        <TextBlock Text="Hi" />
                    </telerik:RadPane>
                </telerik:RadPaneGroup>
            </telerik:RadSplitContainer>
        </telerik:RadDocking>
 
    </Grid>
</Window>


And here's my ViewModel code:

using GalaSoft.MvvmLight;
 
namespace Telerik_IsHidden_RadPane_Bug
{
    /// <summary>
    /// This class contains properties that a View can data bind to.
    /// <para>
    /// Use the <strong>mvvminpc</strong> snippet to add bindable properties to this ViewModel.
    /// </para>
    /// <para>
    /// </para>
    /// </summary>
    public class MainViewModel : ViewModelBase
    {
        public bool ToolWindowProp  
{
get; set; }
 
        /// <summary>
        /// Initializes a new instance of the MainViewModel class.
        /// </summary>
        public MainViewModel()
        {
            ToolWindowProp = true;
        }
    }
}


Stefan
Telerik team
 answered on 29 Sep 2017
2 answers
166 views

Hello,

I am looking to dynamically set the RadDiagramToolboxGroupStyle based on a style or template selector. I found this : http://www.telerik.com/forums/radwrappanel-instead-of-raduniformgrid-in-raddiagramtoolbox   which does work to set the /default/ style of a RadDiagramToolboxGroup created in the application. However, I don't want to change every instance, just a single one, in a single specific situation. If I add x:Key to my style, what do I change in the definition of the RadDiagramToolbox to implement using that new toolbox group style? (better yet, is there a style or template selector I can use to dynamically set that?)

I've tried the SelectedContentTemplate but I can't seem to get that to work

I've tried ItemContainerStyleSelector that didn't work

I've tried ItemContainerStyle inside the HierarchicalDataTemplate applied to the raddiagramtoolbox.ItemTemplate and that also didn't work

 

Any advice?

Dinko | Tech Support Engineer
Telerik team
 answered on 28 Sep 2017
1 answer
165 views

Dear support representative,

issue is that my RadGridView aggregation functions seems too slow.
I have RadGridView bound with IQueryable collection and it has sum aggregation function enabled for 4 columns.
RadGridView has also paging enabled, is set to normally load 100 rows per page.
In SQL table there are about 120 thousand rows and it takes about 2 sec. to calculate sum on a float type column.
In RadGridView it is about 8 sec. to load initial page with aggregation and 1 sec. if aggregation is not used.
Note that PersistableRadGridView is derived form RadGridView just to have couple more properties related to saving settings.
Any leads?
Currently working on binding aggregation values to VM's property so I would not need to use the sum.

 
<controls:PersistableRadGridView
    x:Name="RadGridView"
    Style="{StaticResource RadGridViewWithFilters}"
    DockPanel.Dock="Top"
    DataLoadMode="Asynchronous"
    FrozenColumnCount="{Binding FrozenColumns}"
    behaviours:RadGridViewColumnsBinding.ColumnsCollection="{Binding Columns}"
    behaviours:DoubleClickBehavior.Command="{Binding ShowDetailsViewCommand}"
    behaviours:RadGridViewFilterBehavior.Filters="{Binding ColumnFilterDescriptors}"
    behaviours:RadGridViewSortDescriptorsBinding.SortDescriptorsCollection="{Binding ColumnSortDescriptors}"
    ShouldCloseFilteringPopupOnKeyboardFocusChanged="True"
    SelectionMode="Extended"
    IsSynchronizedWithCurrentItem="False"
    IsReadOnly="True"
    Key="{Binding PersistanceKey}"
    RememberFilters="{Binding RememberFilters, Mode=TwoWay}"
    IsRememberFilterDisabled="{Binding DisableRememberFilters, Mode=TwoWay}"
    ItemsSource="{Binding QueryableData}"
    ShowColumnFooters="True">
    <telerik:StyleManager.Theme>
        <telerik:Windows8Theme/>
    </telerik:StyleManager.Theme>
    <telerik:RadGridView.Resources>
        <Style TargetType="{x:Type telerik:GridViewCell}">
            <Setter Property="Template">
                <Setter.Value>
                    <ControlTemplate>
                        <ContentPresenter x:Name="PART_ContentPresenter" Margin="{TemplateBinding Control.Padding}"
                                          Content="{TemplateBinding ContentControl.Content}"
                                          ContentTemplate="{TemplateBinding ContentControl.ContentTemplate}"
                                          VerticalAlignment="{TemplateBinding Control.VerticalContentAlignment}"
                                          HorizontalAlignment="{TemplateBinding Control.HorizontalContentAlignment}"/>
                    </ControlTemplate>
                </Setter.Value>
            </Setter>
        </Style>
    </telerik:RadGridView.Resources>
    <i:Interaction.Behaviors>
        <behaviours:MultiSelectBehavior SelectedItems="{Binding SelectedEntries, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" />
        <behaviours:RadGridViewRememberFiltersBehavior />
    </i:Interaction.Behaviors>
</controls:PersistableRadGridView>
Stefan
Telerik team
 answered on 28 Sep 2017
1 answer
332 views

Hi,

I'm working with Piechart and I have an issue with the labels when I have many slices (please see the attached picture). The labels overlaps and even with changing the PieChartLabelsDisplayMode it would not help much. Is there any way to fix this issue?

 

Best regards,

Houssem

Martin Ivanov
Telerik team
 answered on 28 Sep 2017
2 answers
184 views

I have a RadDiagramToolbox and I populate it in my viewmodel in an ObservableCollection.  I have added a transform to one of the shapes already in the FlowChartShapeType of a 90 degree rotation.  Now it appears properly in the toolbox however when I drag it into the diagram it keeps the shape but I lose the rotation.  I have followed some examples on deserializing and have added what I have in the code behind on the diagram view.  Why doesn't it deserialize properly since Transform is part of Geometry.  

ViewModel:

 this.Items = new ObservableCollection<MyShape>();

                var fe_geometry = ShapeFactory.GetShapeGeometry(FlowChartShapeType.ManualOperationShape).Clone();
                fe_geometry.Transform = new RotateTransform(90);
                Items .Shapes.Add(new MyShape
                {
                    Name = $"FE{i}",
                    Geometry = fe_geometry,                                

                });                
            }

----------------------------

relevant xaml

View:

  <telerik:RadDiagramToolbox x:Name="toolbox"
                               Title="Modules"
                               
                               
                               Header="{Binding SelectedItem.Header, RelativeSource={RelativeSource Self}}"
                               ItemsSource="{Binding Items}"
                               ItemTemplate="{StaticResource ToolboxGroupTemplate}"
                               Visibility="{Binding IsChecked, Converter={StaticResource BooleanToVisibilityConverter}, ElementName=toolboxButton}" />

 

<telerik:RadDiagram Grid.Row="1"  x:Name="diagram" ConnectionBridge="Bow" 
                                                        RouteConnections="True" IsRotationEnabled="False" 
                                                        ScrollViewer.VerticalScrollBarVisibility="Auto"
                                                        ScrollViewer.HorizontalScrollBarVisibility="Auto"
                                                        IsEditable="False"
                                                        IsResizingEnabled="False" ShapeDeserialized="diagram_ShapeDeserialized" ShapeDoubleClicked="diagram_ShapeDoubleClicked"  >

 

code behind:

  public MainWindow()
        {
            InitializeComponent();        

            //this is when you drag it creates the right shape
            //http://docs.telerik.com/devtools/wpf/controls/raddiagram/howto/drag-custom-toolboxitem
            SerializationService.Default.ItemSerializing += Default_ItemSerializing;
        }

        private void Default_ItemSerializing(object sender, SerializationEventArgs<IDiagramItem> e)
        {
            if (e.Entity is RadDiagramShape)
            {
                e.SerializationInfo["Geometry"] = (e.Entity as RadDiagramShape).Geometry.ToString(CultureInfo.InvariantCulture);

                XmlSerializer serializer = new XmlSerializer(typeof(IModule));
                using (var writer = new StringWriter())
                {
                    serializer.Serialize(writer, ((e.Entity as RadDiagramShape).DataContext as MyShape).Module);
                    e.SerializationInfo["DataContent2"] = writer.ToString();
                }
              
            }
        }

   

               private void diagram_ShapeDeserialized(object sender, Telerik.Windows.Controls.Diagrams.ShapeSerializationRoutedEventArgs e)
        {
            if (e.Shape as RadDiagramShape != null)
            {
                (e.Shape as RadDiagramShape).Geometry = GeometryParser.GetGeometry(e.SerializationInfo["Geometry"].ToString()).Clone();
                

                var test = e.SerializationInfo["DataContent2"].ToString();
                XmlSerializer serializer = new XmlSerializer(typeof(IModule));
                using (var reader = new StringReader(test))
                {
                    (e.Shape as RadDiagramShape).DataContext = serializer.Deserialize(reader);                  

                }
            }
        }

     

Thanks,

Amiel

 

Petar Mladenov
Telerik team
 answered on 28 Sep 2017
8 answers
804 views
Hi, I have the following RadTreeView:

<tc:RadTreeView x:Name="tree"
                ItemsSource="{Binding CategoryCollectionView, UpdateSourceTrigger=PropertyChanged}"
                SelectionChanged="RadTreeView_SelectionChanged"
                LoadOnDemand="tree_LoadOnDemand"
                IsVirtualizing="True"
                tc:TreeViewPanel.VirtualizationMode="Standard"
                ta:AnimationManager.IsAnimationEnabled="False"
                IsDragTooltipEnabled="False"
                IsDragDropEnabled="True"
                SelectionMode="Multiple">
    <tc:RadTreeView.Resources>
        <Style TargetType="{x:Type ScrollBar}" />
 
        <HierarchicalDataTemplate DataType="{x:Type local:CategoryTreeItemViewModel}"
                                  ItemsSource="{Binding ChildrenCollectionView}">
             <!--snip-->
        </HierarchicalDataTemplate>
 
        <DataTemplate DataType="{x:Type local:EventNodeViewModel}">
            <!-- snip -->
        </DataTemplate>
 
    </tc:RadTreeView.Resources>
    <tc:RadTreeView.ItemContainerStyle>
        <Style TargetType="{x:Type tc:RadTreeViewItem}">
            <Setter Property="IsExpanded"
                    Value="{Binding IsExpanded, Mode=TwoWay}" />
            <Setter Property="IsSelected"
                    Value="{Binding IsSelected, Mode=TwoWay}" />
            <Style.Triggers>
                <DataTrigger Binding="{Binding DataContext.IsMainCategoryTree, ElementName=tree}"
                             Value="True">
                    <Setter Property="IsLoadOnDemandEnabled"
                            Value="{Binding LoadOnDemand}" />
                </DataTrigger>
            </Style.Triggers>
        </Style>
    </tc:RadTreeView.ItemContainerStyle>
</tc:RadTreeView>

I am doing a refresh of the tree using a button which recreates all the item ViewModels in the tree and then I am attempting to restore the state of the tree i.e. expand previously expanded nodes and set previously selected item. This is all done from within the tree's ViewModel.

This all works fine as long as the user has not scrolled down. Unfortunately, when the user has scrolled down and a refresh happens, the user will then only see the root nodes (not expanded) unless they scroll back up to the top of the tree.

In order to work around this I subscribed to the tree's ItemContainerGenerator.StatusChanged event after refreshing the data to check when the items are finished generating and then I used the BringItemIntoView or BringIndexIntoView methods to bring to the selected item into view.

However, this doesn't currently work due to the following exception being thrown when either of these methods are called.:
Cannot call StartAt when content generation is in progress.

Any help would be appreciated with this problem,

Thanks,

A.
Kevin
Top achievements
Rank 1
 answered on 27 Sep 2017
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
Boardy
Top achievements
Rank 2
Veteran
Iron
Benjamin
Top achievements
Rank 3
Bronze
Iron
Veteran
ivory
Top achievements
Rank 1
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
ClausDC
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Boardy
Top achievements
Rank 2
Veteran
Iron
Benjamin
Top achievements
Rank 3
Bronze
Iron
Veteran
ivory
Top achievements
Rank 1
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
ClausDC
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?