Telerik Forums
UI for WPF Forum
1 answer
123 views
Hi!,

How do I show the value of a bar when I'm hovering over the bar's legend? Just as the value is displayed when you hover over the bar itself.

I'm am using this to highlight the bar I'm hovering on:

productionSeriesMapping.SeriesDefinition.InteractivitySettings.HoverScope = InteractivityScope.Series


Thanks, Jose
Evgenia
Telerik team
 answered on 07 Oct 2011
1 answer
130 views
Hi, I've tried to reproduce the "Getting Started" example of DragAndDrop but I can't make it work (drag event not fired).

Here my XAML code:

<UserControl xmlns:telerik="http://schemas.telerik.com/2008/xaml/presentation"  x:Class="WpfApplication5.GettingStarted"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
             mc:Ignorable="d"
             d:DesignHeight="300" d:DesignWidth="300">
    <UserControl.Resources>
         
        <DataTemplate x:Key="ApplicationDragTemplate">
 
            <Image Source="{Binding IconPath}"
               Stretch="None"
               VerticalAlignment="Top" />
        </DataTemplate>
        <Style TargetType="ListBoxItem"
           x:Key="draggableItemStyle">
            <Setter Property="HorizontalContentAlignment"
               Value="Stretch" />
            <Setter Property="telerik:RadDragAndDropManager.AllowDrag"
               Value="True" />
 
        </Style>
    </UserControl.Resources>
    <Grid x:Name="LayoutRoot"
       Background="White">
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="200" />
            <ColumnDefinition Width="150" />
            <ColumnDefinition Width="200" />
        </Grid.ColumnDefinitions>
        <ListBox x:Name="allApplicationsBox"
               telerik:RadDragAndDropManager.AllowDrop="True"
               ItemContainerStyle="{StaticResource draggableItemStyle}">
             
            <ListBox.ItemTemplate>
                <DataTemplate>
                    <Grid Width="150">
                        <Grid.RowDefinitions>
                            <RowDefinition />
                            <RowDefinition />
                            <RowDefinition />
                        </Grid.RowDefinitions>
                        <Image Grid.Row="0"
                           HorizontalAlignment="Center"
                           Source="{Binding IconPath}"
                           Width="32"
                           Height="32"
                           Margin="0 0 5 0" />
                        <TextBlock Grid.Row="1"
                               Text="{Binding Name}"
                               FontWeight="Bold"
                               HorizontalAlignment="Center" />
                        <TextBlock Text="{Binding Author}"
                               Grid.Row="2"
                               HorizontalAlignment="Center" />
                    </Grid>
                </DataTemplate>
            </ListBox.ItemTemplate>
        </ListBox>
        <!--My Applications-->
        <ListBox x:Name="myApplicationsBox"
               telerik:RadDragAndDropManager.AllowDrop="True"
               ItemContainerStyle="{StaticResource draggableItemStyle}"
               Grid.Column="2">
            <ListBox.ItemTemplate>
                <DataTemplate>
                    <StackPanel VerticalAlignment="Stretch"
                           HorizontalAlignment="Stretch">
                        <Image Source="{Binding IconPath}"
                           Margin="0 0 3 0"
                           HorizontalAlignment="Center" />
                        <TextBlock Text="{Binding Name}"
                               HorizontalAlignment="Center" />
                    </StackPanel>
                </DataTemplate>
            </ListBox.ItemTemplate>
            <ListBox.ItemsPanel>
                <ItemsPanelTemplate>
                    <telerik:RadUniformGrid Columns="3"
                                       HorizontalAlignment="Left"
                                       VerticalAlignment="Top" />
                </ItemsPanelTemplate>
            </ListBox.ItemsPanel>
        </ListBox>
    </Grid>
</UserControl>

And here my C# code:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
using System.Collections.ObjectModel;
using Telerik.Windows.Controls.DragDrop;
using Telerik.Windows.Controls;
 
namespace WpfApplication5
{
 
    public class ApplicationInfo
    {
        public ApplicationInfo(string iconPath, string name, string author)
        {
            this.IconPath = iconPath;
            this.Name = name;
            this.Author = author;
        }
        public String IconPath
        {
            get;
            set;
        }
        public String Name
        {
            get;
            set;
        }
        public String Author
        {
            get;
            set;
        }
    }
 
    public partial class GettingStarted : UserControl
    {
        public static ObservableCollection<ApplicationInfo> GenerateApplicationInfos()
        {
            ObservableCollection<ApplicationInfo> data = new ObservableCollection<ApplicationInfo>();
            for (int i = 1; i <= 5; i++)
            {
                data.Add(new ApplicationInfo("Images/nature" + i + ".jpg", "Nome" + i, "Autore" + 1));
            }
            return data;
        }
        private ObservableCollection<ApplicationInfo> allApplications = GenerateApplicationInfos();
        private ObservableCollection<ApplicationInfo> myApplications = new ObservableCollection<ApplicationInfo>();
        public GettingStarted()
        {
            InitializeComponent();
            allApplicationsBox.ItemsSource = allApplications;
            myApplicationsBox.ItemsSource = myApplications;
 
 
            RadDragAndDropManager.AddDragQueryHandler(this, OnDragQuery);
            RadDragAndDropManager.AddDragInfoHandler(this, OnDragInfo);
            RadDragAndDropManager.AddDropQueryHandler(this, OnDropQuery);
            RadDragAndDropManager.AddDropInfoHandler(this, OnDropInfo);
        }
        // OnDragQuery event handler
        private void OnDragQuery(object sender, DragDropQueryEventArgs e)
        {
            ListBoxItem listBoxItem = e.Options.Source as ListBoxItem;
            ListBox box = ItemsControl.ItemsControlFromItemContainer(listBoxItem) as ListBox;
            if (e.Options.Status == DragStatus.DragQuery && box != null)
            {
                e.Options.Payload = box.SelectedItem;
                ContentControl cue = new ContentControl();
                cue.ContentTemplate = this.Resources["ApplicationDragTemplate"] as DataTemplate;
                cue.Content = box.SelectedItem;
                e.Options.DragCue = cue;
                e.Options.ArrowCue = RadDragAndDropManager.GenerateArrowCue();
            }
            e.QueryResult = true;
        }
        // OnDropQuery event handler
        private void OnDropQuery(object sender, DragDropQueryEventArgs e)
        {
            ItemsControl box = e.Options.Destination as ItemsControl;
            IList<ApplicationInfo> itemsSource = box.ItemsSource as IList<ApplicationInfo>;
            ApplicationInfo payload = e.Options.Payload as ApplicationInfo;
            e.QueryResult = payload != null && !itemsSource.Contains(payload);
        }
        // OnDropInfo event handler
        private void OnDropInfo(object sender, DragDropEventArgs e)
        {
            ItemsControl box = e.Options.Destination as ItemsControl;
            IList<ApplicationInfo> itemsSource = box.ItemsSource as IList<ApplicationInfo>;
            ApplicationInfo payload = e.Options.Payload as ApplicationInfo;
            if (e.Options.Status == DragStatus.DropComplete)
                if (!itemsSource.Contains(payload))
                    itemsSource.Add(payload);
        }
        // OnDragInfo event handler
        private void OnDragInfo(object sender, DragDropEventArgs e)
        {
            ListBoxItem listBoxItem = e.Options.Source as ListBoxItem;
            ListBox box = ItemsControl.ItemsControlFromItemContainer(listBoxItem) as ListBox;
            IList<ApplicationInfo> itemsSource = box.ItemsSource as IList<ApplicationInfo>;
            ApplicationInfo payload = e.Options.Payload as ApplicationInfo;
            if (e.Options.Status == DragStatus.DragComplete)
            {
                if (payload != null && itemsSource.Contains(payload))
                {
                    itemsSource.Remove(payload);
                }
            }
        }
    }
}


 Can anyone help me?

Thank You
Sergio
Maya
Telerik team
 answered on 07 Oct 2011
0 answers
200 views
Hi,

I am using this solution : http://www.telerik.com/community/forums/wpf/gridview/binding-to-the-isexpandable-proeprty.aspx 
An i want to show a unique HierarchyItem expanded.

And when I use this code, the IsExpanded property is reseted :

private void MyGrid_RowIsExpandedChanged(object sender, RowEventArgs e)
        {
            if (changing)
                return;
 
            this.changing = true;
 
            if ((e.Row as GridViewRow).IsExpanded)
            {
                this.MyGrid.CollapseAllHierarchyItems();
                this.MyGrid.ExpandHierarchyItem(e.Row.DataContext);
 
            }
 
            this.changing = false;
        }
 
        private void AttributesGrid_MouseDoubleClick(object sender, System.Windows.Input.MouseButtonEventArgs e)
        {
            ExpandHierarchyItem((RadGridView)sender);
        }
 
        private void ExpandHierarchyItem(RadGridView sender)
        {
            sender.CollapseAllHierarchyItems();
            sender.ExpandHierarchyItem(sender.SelectedItem);
        }
 
        private void MyGrid_BeginningEdit(object sender, GridViewBeginningEditRoutedEventArgs e)
        {
            ExpandHierarchyItem((RadGridView)sender);
        }

Do you have a way for to resolve this problem

Thanks
Regards

rad
Top achievements
Rank 1
 asked on 07 Oct 2011
1 answer
171 views
Currently using RadControls for WPF Q2 2011.  It seems that the sparkline normal r4ange is not rendered when the NormalRangeTop and NormalRangeBottom are BOTH set to values that lie outside the range of data points. 

So, for example, if my data points range from 20 to 40, then

When Top and Bottom are:
39 and 0, normal range appears
41 and 0, does not appear
70 and 20, normal range appears
70 and 10, doea not appear

Is this by design?  Or is this a bug?  Or am I missing a property setting?  If by design, plase explain.
Thanks
Dan
Yavor
Telerik team
 answered on 07 Oct 2011
2 answers
277 views
Hi,

I have a gridview and the gridview has as SelectionMode="Multiple" and SelectionUnit="Cell".
My problem is now that the selection of the cells disappears after sorting or filtering the grid.  But I want that the selected cells stay selected also after sorting the grid.
If I use SelectionUnit="FullRow", then the selection of the rows don't disappear.

Why does the gridview act like this? Do I have to set some properties or do You know an easy way to implement this functionality on my own?

Thanks
Walter
Walter
Top achievements
Rank 1
 answered on 07 Oct 2011
3 answers
80 views
I want to set the Start visibility Indicator for the appointment as visible when the current date of the timelinecontrol  is greater than the start date of the appointment. Which means the start date of the appointment is not in the visible region of the timeline control, i want to see the indicators. Is it possible to achieve this?

The indicators work as I desire when there are no resources. I mean the status indicators are visible. Refer to the screenshot.Here there are no resources and we can see the indicators.




In the following screenshot we have resources but no continuation indicators

Boyan
Telerik team
 answered on 07 Oct 2011
1 answer
215 views
Hi,

I am using Self Referencing GridView. In that in have a problem that if I am selecting new cells (in parent and also in child) by holding the control key. Now if I click particular cell without holding the control key, then all the selected cells should be deselected. But its happening only the corresponding child/parent grid.

Also by holding the mouse left button how to select the parent and child grid columns without holding control keys.

Thanks,
Ramasamy
Maya
Telerik team
 answered on 07 Oct 2011
5 answers
329 views
Hi all,

I am facing some performance issues and am a bit puzzled. I am sure I am missing something and would appreciate any suggestions.
I am using telerik WPF dlls with version 2009.2.0813.35.

The scenario is I am loading around 2000 objects. It takes almost 30 seconds to render. I assume by default it is using the virtualizing panel and looking at the profiler that seems to be the case. 

I am pasting the profiler output here. The problem seems to be the UpdateRowHeight call in the GridViewVirtualizingPanel where it seems to go through all the records even though the UI is virtualized.

61.08 % MeasureOverride - 18728 ms - 0 calls - Telerik.Windows.Controls.GridView.BaseVirtualizingPanel.MeasureOverride(Size)
  61.08 % UpdateRowHeight - 18728 ms - 0 calls - Telerik.Windows.Controls.GridView.GridViewVirtualizingPanel.UpdateRowHeight(IRowItem)
    61.08 % OnRefreshScrollExtent - 18728 ms - 0 calls - Telerik.Windows.Controls.GridView.GridViewVirtualizingPanel.OnRefreshScrollExtent()
      61.08 % RefreshItemsPhysicalHeightsCache - 18728 ms - 0 calls - Telerik.Windows.Controls.GridView.GridView.Scrolling.PhysicalHeightsCache.RefreshItemsPhysicalHeightsCache()
        61.08 % CreateDataRecordsHeightsCache - 18728 ms - 0 calls - Telerik.Windows.Controls.GridView.GridView.Scrolling.PhysicalHeightsCache.CreateDataRecordsHeightsCache(IList<Record>, Double, Int32, Int32)
          61.08 % InsertItem - 18728 ms - 0 calls - Telerik.Windows.Controls.GridView.GridView.Scrolling.RadKeyedCollection<TKey, TItem>.InsertItem(Int32, TItem)
            61.08 % AddKey - 18728 ms - 0 calls - Telerik.Windows.Controls.GridView.GridView.Scrolling.RadKeyedCollection<TKey, TItem>.AddKey(TKey, Int32)
              30.93 % System.Collections.Generic.Dictionary<TKey, TValue>.FindEntry... - 9484 ms - 0 calls
              30.15 % System.Collections.Generic.Dictionary<TKey, TValue>.Insert... - 9245 ms - 0 calls

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

Is this a known thing or am I doing something wrong? The xaml fragment is below:

<telerik:RadGridView Name="OfficerGrid" AutoGenerateColumns="False" IsReadOnly="True"
                                 MultipleSelect="False" ShowGroupPanel="False"
                                 IsFilteringAllowed="False"
                                 SelectionChanged="OnSelectionChanged" DataLoadMode="Asynchronous"
                                 GridLinesVisibility="None"
                                 MouseDoubleClick="OfficerGrid_MouseDoubleClick">
                <telerik:RadGridView.Columns>
                    <telerik:GridViewDataColumn Header="Name" DataMemberBinding="{Binding Path=Name, Mode=OneWay}"/>
                    <telerik:GridViewDataColumn Header="Office" DataMemberBinding="{Binding Path=Office, Mode=OneWay}"/>
                    <telerik:GridViewDataColumn Header="Job Title" DataMemberBinding="{Binding Path=JobTitle, Mode=OneWay}"/>
                </telerik:RadGridView.Columns>
            </telerik:RadGridView>

Thanks for any help,
Kashi





Vlad
Telerik team
 answered on 07 Oct 2011
1 answer
110 views
I have a GridView's itemsource bound to a dataset with a table "xyz" as it's DataMember. When I add a new row to a .net listview bound to the same table, the GridView does not display the new row. However, when I click on the filter icon on the first column of the GridView, I can see the new row value. Any ideas?
Rod
Vlad
Telerik team
 answered on 07 Oct 2011
3 answers
128 views
I am supporting some Telerik code that has a GridView with 30 columns of GridViewDataColumn type.  As part of the GridView, there is a RadGridView.RowDetailsTemplate that includes a UserControl that is basically an editor of the columns of the GridView. 

Bindings seems to be refreshing the GridView columns just fine when the columns of the GridView are visible to the user.  Since this GridView has about 30 columns, only about 10 columns are visible to the user at any given time.  As user scrolls horizontally, he can see the other columns.   If the columns being edited by the user are not visible at the time of editing, those values are not updated 50% of the time when he scrolls the grid columns into view.   Some columns are being updated correctly and some columns would not be updated correctly.  If the columns are visible at the time of editing, we have not noticed the cells not be updated correctly.
 
To test out our viewmodel, I rewrote part of the grid using the same bindings with a non-Telerik grid, everything seems to refresh just fine as the values are being edited and the gridview being scrolled.

We are using the current Telerik control for WPF 4.

Any suggestions would be appreciated.

Thanks,
Milt
Milt
Top achievements
Rank 1
 answered on 06 Oct 2011
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
Bohdan
Top achievements
Rank 3
Iron
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Elliot
Top achievements
Rank 1
Iron
Iron
Iron
Sunil
Top achievements
Rank 1
Cynthia
Top achievements
Rank 1
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Bohdan
Top achievements
Rank 3
Iron
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Elliot
Top achievements
Rank 1
Iron
Iron
Iron
Sunil
Top achievements
Rank 1
Cynthia
Top achievements
Rank 1
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?