Telerik Forums
UI for WPF Forum
1 answer
109 views
I found exampale how to add toltip for each column, and it is working fine for me. I just wonder is there any way to define totlip once for whole row and bind with row data?
Maya
Telerik team
 answered on 17 Apr 2013
2 answers
226 views
Hi all,

I have an application which is using RadTreeListView to bind and display as a tree. The ItemSource is binded from ViewModel with type is RadObservableCollection and declared:

ItemsSource="{Binding HistoryList, Mode=TwoWay,
UpdateSourceTrigger=PropertyChanged,
NotifyOnSourceUpdated=True,
NotifyOnTargetUpdated=True}"

The issue is when I add a new node to HistoryList then call RaisePropertyChange of HistoryList, the UI of RadTreeListView doesn't update even though the data added.

this.HistoryList.Add(treeViewItem);
this.RaisePropertyChanged(x => x.HistoryList);

Then if I use reset() method of RadObservableCollection, the UI is updated but float top the top of view. So the question is how can I handle with it? I mean I wan to keep the state/position of node that I selected.. not jump or float.

This video gets better for you to understand: http://screencast.com/t/iLa3XWsa

Thank you
Maya
Telerik team
 answered on 17 Apr 2013
4 answers
247 views
Hello,
I referred to a MVVM RadRibbonView example and I tried to implement RadRibbonComboBox in RibbonView with MVVM method.
But it doesn't work normally.
Please see a attached screenshot image.

I make a DataTemplate as follows.

Case1 -- use RadComboBox in RibbonView

    <!-- 
    <DataTemplate x:Key="ComboBoxItemTemplate">
        <Grid>
            <TextBlock Text="{Binding Text}" />
        </Grid>
    </DataTemplate>
    
    <DataTemplate x:Key="ComboBoxTemplate">
        <telerik:RadComboBox 
            ItemsSource="{Binding Items}" 
            ItemTemplate="{StaticResource ComboBoxItemTemplate}"
            SelectionBoxTemplate="{StaticResource ComboBoxItemTemplate}"
            SelectedIndex="{Binding SelectedIndex}"/>
    </DataTemplate>
    -->


Case 2. use RadRibbonComboBox and RadRibbonComboBoxItem 

    <DataTemplate x:Key="ComboBoxItemTemplate">
        <telerik:RadRibbonComboBoxItem Content="{Binding Text}" />
    </DataTemplate>

    <DataTemplate x:Key="ComboBoxTemplate">
        <telerik:RadRibbonComboBox 
            ItemsSource="{Binding Items}" 
            ItemTemplate="{StaticResource ComboBoxItemTemplate}"
            SelectedIndex="{Binding SelectedIndex}"/>
    </DataTemplate>
Hyunho
Top achievements
Rank 1
 answered on 16 Apr 2013
3 answers
332 views
There appears to be a memory leak when a DocumentRuler is associated to a RadRichTextBox.  The following is code for a demo WPF Application project that can demonstrate this issue:

MainWindow.Xaml:
<Window x:Class="RulerMemoryLeakDemo.MainWindow"
        Title="MainWindow" Height="350" Width="525">
    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition Height="25"/>
            <RowDefinition Height="*"/>
        </Grid.RowDefinitions>       
        <StackPanel Grid.Row="0" Orientation="Horizontal">
            <Button Click="ButtonBase_OnClick">New Editor</Button>
        </StackPanel>
        <StackPanel Grid.Row="1" Name="editHost"></StackPanel>
    </Grid>
</Window>

MainWindow.xaml.cs:
using System.ComponentModel;
using System.Windows;
 
namespace RulerMemoryLeakDemo
{
    /// <summary>
    /// Interaction logic for MainWindow.xaml
    /// </summary>
    public partial class MainWindow : Window
    {
        public class EditorViewModel : INotifyPropertyChanged
        {
            private string _rtf = @"{\rtf1\ansi\ansicpg1252\deff0\deflang1033{\fonttbl{\f0\fnil\fcharset0 Calibri;}}
{\*\generator Msftedit 5.41.21.2510;}\viewkind4\uc1\pard\sa200\sl276\slmult1\lang9\f0\fs22 RTF File - Hello World\par
}";
            public string Rtf
            {
                get { return _rtf; }
                set
                {
                    _rtf = value;
                    OnPropertyChanged("Rtf");
                }
            }
 
            public event PropertyChangedEventHandler PropertyChanged;
 
            protected virtual void OnPropertyChanged(string propertyName)
            {
                var handler = PropertyChanged;
                if (handler != null)
                    handler(this, new PropertyChangedEventArgs(propertyName));
            }
        }
 
        public MainWindow()
        {
            InitializeComponent();
        }
 
        private void ButtonBase_OnClick(object sender, RoutedEventArgs e)
        {
            editHost.Children.Clear();
            var viewModel = new EditorViewModel();
            var view = new EditorView {DataContext = viewModel};
            editHost.Children.Add(view);           
        }
    }
}

EditorView.xaml:
<UserControl
    x:Class="RulerMemoryLeakDemo.EditorView"
    mc:Ignorable="d"
    d:DesignHeight="300" d:DesignWidth="1000"
    FontFamily="Arial" FontSize="11">   
    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition Height="*"/>
        </Grid.RowDefinitions>   
        <telerik:DocumentRuler Grid.Row="0" AssociatedRichTextBox="{Binding ElementName=editor, Mode=OneTime}"/>
        <telerik:RadRichTextBox x:Name="editor"     
                                Margin="24 24 0 0"
                                Grid.Row="0"
                                LayoutMode="Flow"/>
        <telerik:RtfDataProvider x:Name="rtfProvider"                                 
                                 RichTextBox="{Binding ElementName=editor}"
                                 Rtf="{Binding Path=Rtf, Mode=TwoWay}"  />
    </Grid>
</UserControl>

EditorView.xaml.cs:
using System.Windows.Controls;
namespace RulerMemoryLeakDemo
{
    public partial class EditorView : UserControl
    {
        public EditorView()
        {
            InitializeComponent();         
        }
    }
}


The demo app has a button "New Editor" which will create a new usercontrol with a RadRichTextBox and associated DocumentRuler and add it to the main window.  If you keep pressing the New Editor button you will see that the memory usage of the application keeps growing.  Repeatedly creating new editors on my desktop caused the application memory usage to grow to over 4GB.

However, in EditorView.xaml, if you comment out the DocumentRuler declaration and repeat the test you will find that the memory usage of the application no longer grows unbound.  On my desktop the memory usage of the application after commenting out this line stayed under 400MB.

My desktop is running Win 7 x64, though this problem was observed on a number of different systems.
Boby
Telerik team
 answered on 16 Apr 2013
1 answer
182 views
HI,

 I was wondering if it was possible to use a combination of properties in GroupDescriptor.

For example:

I have the data set: 
new DummyModel { Name = "Bob", Test = "A", Part = "i", Score = 12},
new DummyModel { Name = "Bob", Test = "A", Part = "ii", Score = 11},
new DummyModel { Name = "Bob", Test = "B", Part = "i", Score = 15},
new DummyModel { Name = "Bob", Test = "B", Part = "ii", Score = 16},
new DummyModel { Name = "Sue", Test = "A", Part = "i", Score = 6},
new DummyModel { Name = "Sue", Test = "A", Part = "ii", Score = 14},
new DummyModel { Name = "Sue", Test = "B", Part = "i", Score = 22},
new DummyModel { Name = "Sue", Test = "B", Part = "ii", Score = 18},

I would like to group by Name and Test and show the sum of the two parts (ordered by Name, then Test).

I recently had this working by adding a property to DummyModel that had both a Name and Test Properties and implemented IComparable and overwrote Equals and GetHashCode which allowed the grouping and sorting as I desired.I used this property as the Member property of the GroupDescriptor.

However this stopped working when we upgraded to v4.0.30319.

Any help on this issue would be greatly appreciated.

Thanks,

Steven
Steven
Top achievements
Rank 1
 answered on 16 Apr 2013
3 answers
171 views
Hello,

I'm using a custom DragVisualProvider with the ListBoxDragDropBehavior and I can't seem to figure out how to offset the mouse position within the dragVisual. I know you can get the RelativeStartPoint from DragVisualProviderState, but how do you set that on the newly created dragVisual (ContentControl, in this case). 

Here is my custom DragVisualProvider code:

public FrameworkElement CreateDragVisual(DragVisualProviderState state)
{
     
    var visual = new ContentControl();
     
    var theme = StyleManager.GetTheme(state.Host);
    if (theme != null)
    {
        StyleManager.SetTheme(visual, theme);
    }
 
    var draggedItem = state.DraggedItemContainers.First() as FrameworkElement;
    visual.Height = draggedItem.ActualHeight;
    visual.Width = draggedItem.ActualWidth;
     
    visual.Content = state.DraggedItems.OfType<object>().FirstOrDefault();
    visual.ContentTemplate = this.DragVisualTemplate;
     
    return visual;
}

Thanks in advance
Vladi
Telerik team
 answered on 16 Apr 2013
3 answers
590 views
Hey there. I have a project with a RadMenu and it's menu Items are defined like so:


        <Style x:Key="MenuItemBaseStyle" TargetType="telerik:RadMenuItem">
            <Setter Property="Header" Value="{Binding Content}" />
            <Setter Property="IsSeparator" Value="{Binding IsSeparator}" />
            <Setter Property="ItemsSource" Value="{Binding}" />
        </Style>

        <Style x:Key="MenuItemLinkStyle" TargetType="telerik:RadMenuItem" BasedOn="{StaticResource MenuItemBaseStyle}">
            <Setter Property="Template" Value="{StaticResource MenuItemLinkControlTemplate}" />
            <Setter Property="Margin" Value="4 3 4 2" />
        </Style>

And the Template is defined:

        <ControlTemplate x:Key="MenuItemLinkControlTemplate" TargetType="telerik:RadMenuItem">
            <StackPanel>
                <Button Click="ButtonBase_OnClick" Content="{Binding Content}" Style="{StaticResource LinkButtonMenu}" />
            </StackPanel>
        </ControlTemplate>


I know it looks weird that It's a button, but there's a very specific reason we're doing that due to some issues we had after the last release. It was working fine prior to having to change it and I need it to work with the current Template I have defined for it. I tried setting the StaysOpenOnClick  property to false in the style as well and the issue still persisted. Thanks in advanced for the help.
Rosen Vladimirov
Telerik team
 answered on 16 Apr 2013
1 answer
184 views
Hi,

i want to order my columns in a custom way ("B", "A", "C" for example) Is this possible?

Best Regards,
Thomas
Rosen Vladimirov
Telerik team
 answered on 16 Apr 2013
0 answers
90 views
Hi Experts,

I am doing validation using CurrentCellvalidating event and by using CellEditEnded event i am reloading my Grid's Itemsource. At that time the CurrentCellValidating event gets fired and also the CellEditEnded event gets called once again(both the events are fired 2 times) and after the execution of these events i am getting an null reference exception.

Note: If i didnt reload the Grid ItemSource(Applying new values) then the exception is not occuring.

Please help me anybody, what is going wrong.

Ramesh,
velusamyr@hcl.com
Ramesh
Top achievements
Rank 1
 asked on 16 Apr 2013
3 answers
241 views
Hi Support Team,

I am showing two series data in chartview.I want to show trackball to only one series.
How can i hide the trackball to other(second) series.

Please find attached screenshot for your reference.



Thanks&Regards
Obalesu.N
Todor
Telerik team
 answered on 16 Apr 2013
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?