Telerik Forums
UI for WPF Forum
1 answer
111 views
When a chart is first populated with data, the series are drawn with animation.

I would like to repeat this animation when the chart comes back into focus (e.g. if the form is minimised, then I would like to show the animation again when the form is maximised).

Does anyone know how to replay the animation?

Thanks.
Sia
Telerik team
 answered on 28 Nov 2011
1 answer
174 views
Hi,

I'm using trial version of Telerik WPF controls (Q3 2011) and trying to create my own theme for ScheduleView using following article as a guide Creating a Custom Theme Project (I know it is written for Silverlight control but I can't find something similar for WPF)
I used SchedulerView.xaml from OfficeBlue theme as a starting point for my modification. And it looks like I almost successfully applied my custom theme to the RadScheduleView controls. My problem is that some "parts" of the control are missing in the custom theme, you can see it on the screenshot attached bellow.
It is obvious I'm doing something wrong but I can't figure out what is exactly wrong, so could you please help me with it.

Here is the link to my demo project http://dl.dropbox.com/u/3950376/TelerikScheduleView.zip (I don't know how to attach zip files to my message here)

Thanks,
Alexander
Dani
Telerik team
 answered on 28 Nov 2011
1 answer
97 views

I have two sources for dragging and dropping appointments onto the ScheduleView. Both consist of dragging custom appt objects so they both utilize a custom dragdrop handler class and use the override of the ConvertDraggedData method. I am wondering if it would be possible to arrange the appts in such a way that if I grabbed appts from all over the view and then dragged them to a specific resource at a specific time, If I could then just have them updated in such a way that the appts were dropped one after another in the view (stacked horizontally in timeline view for example). I think the issue I am having is that destination slots need to be updated somehow to reflect where I want the appts to eventually be. Hopefully this isn't too confusing and someone can lead me in the right direction. Here is a bit of code that I wrote but obviously it isn't working like I expect at this point. I am basically trying to re-arrange the appts so that one comes right after another when they are dropped. The collection looks like I expect when it comes out of my ArrageTasks, but the result is the appts still end up in slots all over the view.

public override IEnumerable<IOccurrence> ConvertDraggedData(object data)
        {
            if (data.GetType() == typeof(DataObject))
            {
                return ArrangeTasks(data);
                //return (data as DataObject).GetData("MetrixTaskAppointments") as IList<IOccurrence>;
            }
 
            return base.ConvertDraggedData(data);
        }
 
        private IEnumerable<IOccurrence> ArrangeTasks(object data)
        {
            IList<IOccurrence> appts = (data as DataObject).GetData("MetrixTaskAppointments") as IList<IOccurrence>;
            IEnumerable<IOccurrence> sortedAppts = appts.OrderBy(f => f.Start);
 
            IEnumerator apptEnumerator = sortedAppts.GetEnumerator();
            DateTime savedPlanTravelEndDttm = DateTime.Now;
            bool firstTask = true;
            while (apptEnumerator.MoveNext())
            {
                MetrixTaskAppointment mAppt = (MetrixTaskAppointment)apptEnumerator.Current;
                IAppointment appt = (Appointment)apptEnumerator.Current;
 
                if (firstTask == true)
                {
                    firstTask = false;
                }
                else
                {                   
                    mAppt.PlanTravelStartDttm = savedPlanTravelEndDttm;
                    mAppt.PlanStartDttm = mAppt.PlanTravelStartDttm.AddMinutes(mAppt.PlanTravelToMin);
                    mAppt.PlanEndDttm = mAppt.PlanStartDttm.AddMinutes(mAppt.PlanTaskDurMin);
                    mAppt.PlanTravelEndDttm = mAppt.PlanEndDttm.AddMinutes(mAppt.PlanTravelReturnMin);
                    appt.Start = mAppt.PlanStartDttm;
                    appt.End = mAppt.PlanEndDttm;
                }
                 
                savedPlanTravelEndDttm = mAppt.PlanTravelEndDttm;
            }
 
            return sortedAppts;
  
        }

Yana
Telerik team
 answered on 28 Nov 2011
3 answers
78 views
If I created a CustomControl derived from a RadComboBox, I have to explicitly load my xaml file in the App.xaml of the final application.

Apparently, the native style of Telerik to replace my style. That is why I have to recharge it back.
Pana
Telerik team
 answered on 28 Nov 2011
4 answers
141 views
Hi all!

I have successfully implemented custom themes (telerik approach) for 2011 Q2 version
of gauges in VS 2010. I was using "Creating and applying a custom theme for RadScheduler for WPF" as help.

Yesterday I installed 2011 Q3 RAD controls and tried to implement new gauges and they are looking
beautiful and are working fine. I also created another custom theme project for new gauges, but I'm
having problems with resources files :( I used templates from Telerik theme samples.
I tried different approaches defining Resources in custom themes library. But I was either getting error
"invalid ThemeType" or "Cannot locate resource 'themes/gauge/customdarkq3/styles.xaml'".

Has procedure for custom themes changed for Q3 version of controls? I noticed there are now 2
gauges xaml files (Gauge.xaml and Gauge_New.xaml). Any suggestion on how to approach this problem?

Regards, Max

Max
Top achievements
Rank 1
 answered on 28 Nov 2011
1 answer
80 views
hello

I have a line graph in WPF and I want to do is just leave the points as you can get an example in the picture.

thanks
Evgenia
Telerik team
 answered on 28 Nov 2011
3 answers
578 views
I'm using RadMap in an MVVM pattern, so I'm not able to get a reference to the map or the InformationLayer so that I can get the best possible LocationRect based on information in the view as mentioned in the first response in this thead:

http://www.telerik.com/community/forums/wpf/map/how-to-get-best-possible-map-view-when-considering-all-poi-s.aspx

I attempted to use the second approach (the method posted at the end of the post), but it too is giving me some problems. I'm able to get a LocationRect, but I'm not able to call the SetView method to center/zoom the map appropriately.

I created properties in my view model for center and zoom. The MapCenter property seems to be working fine, but I'm having a hard time with the zoom property.

List<Telerik.Windows.Controls.Map.Location> locations = this.MyPushpins.Select(pin => pin.Location).ToList();
LocationRect rect = this.GetBestView(locations, new Size(0.01, 0.01));
 
MapCenter = rect.Center;
MapZoomLevel = rect.ZoomLevel;

The problem is the LocationRect.ZoomLevel property isn't set and I don't know how to set it without having more information from the map, itself.

For reference, here is the method posted in the original thread:

public LocationRect GetBestView(IEnumerable<PointOfInterest> itemsList, Size defaultSize)
{
    LocationRect bestView = new LocationRect();
    Location northEast = Location.Empty;
    Location southWest = Location.Empty;
   
    foreach (PointOfInterest item in itemsList)
    {
        Location location = item.Location;
   
        if (northEast.IsEmpty)
        {
            northEast = location;
        }
        else
        {
            if (!location.IsEmpty)
            {
                northEast.Latitude = Math.Max(northEast.Latitude, location.Latitude);
                northEast.Longitude = Math.Max(northEast.Longitude, location.Longitude);
            }
        }
   
        if (southWest.IsEmpty)
        {
            southWest = location;
        }
        else
        {
            if (!location.IsEmpty)
            {
                southWest.Latitude = Math.Min(southWest.Latitude, location.Latitude);
                southWest.Longitude = Math.Min(southWest.Longitude, location.Longitude);
            }
        }
    }
   
    if (!northEast.IsEmpty && !southWest.IsEmpty)
    {
        bestView = new LocationRect(northEast, southWest);
   
        if (bestView.IsEmpty)
        {
            bestView = new LocationRect(
                new Location(bestView.North + defaultSize.Height / 2.0, bestView.West - defaultSize.Width / 2.0),
                new Location(bestView.North - defaultSize.Height / 2.0, bestView.West + defaultSize.Width / 2.0));
        }
    }
   
    return bestView;
}
Andrey
Telerik team
 answered on 28 Nov 2011
4 answers
280 views
I'm trying to display polygons, polylines and ellipses on the map using a template selector.  The ellipse data template is defined to hotspot to center the ellipse at the MapLayer.Location, but this is getting ignored and the location is still applied to the top-left of the ellipse.

The only way I can get a HotSpot to work on an ellipse is to add the control directly to an information layer and not use a template.  Is there any reason the HotSpot shouldn't work in a templated item?

public class ViewModel
{
    public List<Location> Locations { get { return new List<Location>() {new Location(0, 0)}; } }
}

<Window x:Class="TelerikMapTest.MainWindow"
        xmlns:TelerikMapTest="clr-namespace:TelerikMapTest"
        Title="MainWindow" Height="350" Width="525">
     
    <Window.DataContext>
        <TelerikMapTest:ViewModel />
    </Window.DataContext>
     
    <Window.Resources>
        <DataTemplate x:Key="template">
            <telerik:MapEllipse Width="1000" Height="1000"
                        Fill="Blue" Opacity="0.6"
                        telerik:MapLayer.Location="{Binding}">
                <telerik:MapLayer.HotSpot>
                    <telerik:HotSpot X="0.5" Y="0.5"
                              XUnits="Fraction" YUnits="Fraction" />
                </telerik:MapLayer.HotSpot>
            </telerik:MapEllipse>
        </DataTemplate>   
    </Window.Resources>
     
    <Grid>
        <telerik:RadMap>
            <telerik:RadMap.Provider>
                <telerik:OpenStreetMapProvider />
            </telerik:RadMap.Provider>
             
            <telerik:InformationLayer ItemsSource="{Binding Locations}"
                            ItemTemplate="{StaticResource template}" />
            <telerik:InformationLayer>
                <telerik:MapEllipse Width="1000" Height="1000"
                            Fill="Yellow" Opacity="0.6"
                            telerik:MapLayer.Location="0,0">
                    <telerik:MapLayer.HotSpot>
                        <telerik:HotSpot X="0.5" Y="0.5"
                                  XUnits="Fraction" YUnits="Fraction" />
                    </telerik:MapLayer.HotSpot>
                </telerik:MapEllipse>
            </telerik:InformationLayer>
        </telerik:RadMap>
    </Grid>
</Window>
Andrey
Telerik team
 answered on 28 Nov 2011
4 answers
180 views
Hi guys

I'm having a radgrid and a DateTime column

Nevertheless, i only want to display the date (without time)
<tcg:GridViewDataColumn DataMemberBinding="{Binding ITEM.Deliverydate}" DataFormatString="{}{0:dd/MM/yyyy}" Header="Delivery Date"  >
This also works fine so far, but when i comes to grouping this column it's not working.

Somehow it looks for me that the grouping in the background also uses the time, thats why i get different groups per item with always the same date.
This looks a little bit weired because the grouping text is always the same. If i have three entries with Deliverydate 20.11.2010 then the group looks like
20.11.2010    aggregate function: 1 item
20.11.2010    aggregate function: 1 item
20.11.2010    aggregate function: 1 item

correct would be
20.11.2010     aggregate function: 3 item

any suggestions?
thanks
Mohammad
Top achievements
Rank 1
 answered on 26 Nov 2011
0 answers
134 views
i am displaying two columns in the grid view and their visibilities (i.e. IsVisible Property) are controlled by corresponding check boxes. Also i have applied a count function in first column to show the total number of rows in the column footer
public partial class PlaybackView : UserControl, INotifyPropertyChanged
    {
  
        int _count = 0;
  
        public PlaybackView()
        {
            InitializeComponent();
        }
  
  
        #region Properties
  
        public DataTable PlaybackTable
        {
            get { return (DataTable)GetValue(PlaybackTableProperty); }
            set
            {
                SetValue(PlaybackTableProperty, value);
            }
  
        }
  
        // Using a DependencyProperty as the backing store for DataTable.  This enables animation, styling, binding, etc...
        public static readonly DependencyProperty PlaybackTableProperty = DependencyProperty.Register("PlaybackTable", typeof(DataTable), typeof(PlaybackView));
  
        //private static void OnPresentableTableChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
        //{
        //    PlaybackView playbackView = d as PlaybackView;
  
        //    if (playbackView != null)
        //    {
  
        //        playbackView.PlaybackLogView = new ListCollectionView(playbackView.PlaybackTable.DefaultView);
        //    }
        //}
  
  
        public List<string> GroupBy
        {
            get { return (List<string>)GetValue(GroupByTextProperty); }
            set
            {
                SetValue(GroupByTextProperty, value);
  
            }
        }
  
        public static readonly DependencyProperty GroupByTextProperty = DependencyProperty.Register("GroupBy", typeof(List<string>), typeof(PlaybackView), new UIPropertyMetadata(null, OnGroupByPropertyChanged));
  
        private static void OnGroupByPropertyChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
        {
            //PlaybackView playbackView = d as PlaybackView;
  
            //if (playbackView != null)
            //{
            //    playbackView.PlaybackLogView.GroupDescriptions.Add(new PropertyGroupDescription(playbackView.GroupBy));
                 
            //}
        }
  
        #endregion
  
  
  
        #region INotifyPropertyChanged Members
  
        public event PropertyChangedEventHandler PropertyChanged;
  
        protected void OnPropertyChanged(string name)
        {
            PropertyChangedEventHandler handler = PropertyChanged;
            if (handler != null)
            {
                handler(this, new PropertyChangedEventArgs(name));
            }
        }
  
        #endregion
  
        private void telrikDataGrid_DataLoading(object sender, Telerik.Windows.Controls.GridView.GridViewDataLoadingEventArgs e)
        {
            if (GroupBy.Count > 0)
            {
                if (_count > 0)
                {
                    this.telrikDataGrid.GroupDescriptors.Clear();
                }
  
                ColumnGroupDescriptor descriptor = new ColumnGroupDescriptor();
                descriptor.Column = this.telrikDataGrid.Columns[GroupBy[0]];
                this.telrikDataGrid.GroupDescriptors.Add(descriptor);
                ++_count;
  
            }
  
        }
  
    }
  
  
-------------------------------------------XAMl Code----------------------------------------------
  
 <Grid>
  
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto"/>
            <RowDefinition Height="Auto"/>
            <RowDefinition Height="*"/>
        </Grid.RowDefinitions>
  
        <Button  Content="Load Data" HorizontalAlignment="Right" Click="Button_Click" />
        <CheckBox x:Name="_check" Grid.Row="1" Content="Visibility" IsChecked="True"/>
  
        <telerik:RadGridView  Grid.Row="2" x:Name="_telerikGrid" ShowColumnFooters="True"  AutoGenerateColumns="False" ItemsSource="{Binding RelativeSource={RelativeSource AncestorType={x:Type Window}}, Path=Table}">
  
            <telerik:RadGridView.Columns>
  
  
                <telerik:GridViewDataColumn Header="PresentationName" DataMemberBinding="{Binding PresentationName}">
                </telerik:GridViewDataColumn>
  
                <telerik:GridViewDataColumn Header="LogLevel" DataMemberBinding="{Binding LogLevel}" IsVisible="{Binding ElementName=_check, Path=IsChecked}">
                    <telerik:GridViewDataColumn.AggregateFunctions>
                        <telerik:CountFunction Caption="Total Rows"/>
                    </telerik:GridViewDataColumn.AggregateFunctions>
                </telerik:GridViewDataColumn>
  
            </telerik:RadGridView.Columns>
        </telerik:RadGridView>
  
  
    </Grid>
. so first time when i run the application it showing all the columns successfully but if i do Isvisible property of first column to false and then load the gridview with new data it shows an error in the handler of the INotifyPropertyCanhged Interface.

And the error is: "Object reference not set to an instance of an object."


please help me out.,....
Vinod
Top achievements
Rank 1
 asked on 26 Nov 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
Slider
Expander
TileList
PersistenceFramework
DataPager
Styling
TimeBar
OutlookBar
TransitionControl
Book
FileDialogs
ToolBar
ColorPicker
TimePicker
SyntaxEditor
MultiColumnComboBox
VirtualGrid
Wizard
ExpressionEditor
NavigationView (Hamburger Menu)
DesktopAlert
WatermarkTextBox
BarCode
SpellChecker
DataServiceDataSource
EntityFrameworkDataSource
RadialMenu
ChartView3D
Data Virtualization
BreadCrumb
ProgressBar
Sparkline
LayoutControl
TabbedWindow
ToolTip
CloudUpload
ColorEditor
TreeMap and PivotMap
EntityFrameworkCoreDataSource (.Net Core)
HeatMap
Chat (Conversational UI)
VirtualizingWrapPanel
Calculator
NotifyIcon
TaskBoard
TimeSpanPicker
BulletGraph
WebCam
CardView
DataBar
Licensing
FilePathPicker
PasswordBox
Rating
SplashScreen
Accessibility
Callout
CollectionNavigator
Localization
AutoSuggestBox
HighlightTextBlock
Security
TouchManager
StepProgressBar
VirtualKeyboard
Badge
OfficeNavigationBar
ExpressionParser
CircularProgressBar
SvgImage
PipsPager
SlideView
AI Coding Assistant
+? more
Top users last month
Jay
Top achievements
Rank 3
Bronze
Iron
Iron
yw
Top achievements
Rank 2
Iron
Iron
Stefan
Top achievements
Rank 2
Iron
Iron
Iron
Kao Hung
Top achievements
Rank 1
Iron
Bohdan
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Jay
Top achievements
Rank 3
Bronze
Iron
Iron
yw
Top achievements
Rank 2
Iron
Iron
Stefan
Top achievements
Rank 2
Iron
Iron
Iron
Kao Hung
Top achievements
Rank 1
Iron
Bohdan
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?