Telerik Forums
UI for WPF Forum
1 answer
121 views
Hi I have problem, when I set up HorizontalGridLinesBrush to my grid, it gets blurred (when I set top margin to 32 everything is fine)

here is my caml grid row setup:

<ControlTemplate x:Key="GridViewRowTemplate" TargetType="grid:GridViewRow">
        <Border BorderThickness="{TemplateBinding BorderThickness}" BorderBrush="{TemplateBinding BorderBrush}">
            <VisualStateManager.VisualStateGroups>
                <VisualStateGroup x:Name="FocusStates">
                    <VisualState x:Name="Unfocused" />
                    <VisualState x:Name="Focused">
                        <Storyboard>
                            <ObjectAnimationUsingKeyFrames Storyboard.TargetName="NavigatorIndicator" Storyboard.TargetProperty="(UIElement.Visibility)">
                                <DiscreteObjectKeyFrame KeyTime="0">
                                    <DiscreteObjectKeyFrame.Value>
                                        <Visibility>Visible</Visibility>
                                    </DiscreteObjectKeyFrame.Value>
                                </DiscreteObjectKeyFrame>
                            </ObjectAnimationUsingKeyFrames>
                        </Storyboard>
                    </VisualState>
                </VisualStateGroup>
                <VisualStateGroup x:Name="SelectionStates">
                    <VisualState x:Name="Unselected" />
                    <VisualState x:Name="SelectedUnfocused">
                        <Storyboard>
                            <ObjectAnimationUsingKeyFrames Duration="0" Storyboard.TargetName="Background_Over" Storyboard.TargetProperty="(UIElement.Visibility)">
                                <DiscreteObjectKeyFrame KeyTime="0">
                                    <DiscreteObjectKeyFrame.Value>
                                        <Visibility>Visible</Visibility>
                                    </DiscreteObjectKeyFrame.Value>
                                </DiscreteObjectKeyFrame>
                            </ObjectAnimationUsingKeyFrames>
                            <ObjectAnimationUsingKeyFrames Storyboard.TargetName="Background_Over" Storyboard.TargetProperty="Fill">
                                <DiscreteObjectKeyFrame KeyTime="0:0:0">
                                    <DiscreteObjectKeyFrame.Value>
                                        <SolidColorBrush Color="#FF9c9c9c"/>
                                    </DiscreteObjectKeyFrame.Value>
                                </DiscreteObjectKeyFrame>
                            </ObjectAnimationUsingKeyFrames>
                            <ObjectAnimationUsingKeyFrames Storyboard.TargetName="Background_Selected" Storyboard.TargetProperty="Fill">
                                <DiscreteObjectKeyFrame KeyTime="0:0:0">
                                    <DiscreteObjectKeyFrame.Value>
                                        <SolidColorBrush Color="#FF9c9c9c"/>
                                    </DiscreteObjectKeyFrame.Value>
                                </DiscreteObjectKeyFrame>
                            </ObjectAnimationUsingKeyFrames>
                            <DoubleAnimation To="1" Duration="0" Storyboard.TargetName="Background_Over" Storyboard.TargetProperty="(UIElement.Opacity)" />
                        </Storyboard>
                    </VisualState>
                </VisualStateGroup>
                <VisualStateGroup x:Name="CommonStates">
                    <VisualState x:Name="Normal" />
                    <VisualState x:Name="MouseOver">
                        <!--Bez najeti mysi-->
                    </VisualState>
                    <VisualState x:Name="Selected">
                        <Storyboard>
                            <ObjectAnimationUsingKeyFrames Duration="0" Storyboard.TargetName="Background_Selected" Storyboard.TargetProperty="(UIElement.Visibility)">
                                <DiscreteObjectKeyFrame KeyTime="0">
                                    <DiscreteObjectKeyFrame.Value>
                                        <Visibility>Visible</Visibility>
                                    </DiscreteObjectKeyFrame.Value>
                                </DiscreteObjectKeyFrame>
                            </ObjectAnimationUsingKeyFrames>
                        </Storyboard>
                    </VisualState>
                </VisualStateGroup>
                <VisualStateGroup x:Name="ValueStates">
                    <VisualState x:Name="RowValid" />
                    <VisualState x:Name="RowInvalid">
                        <Storyboard>
                            <ObjectAnimationUsingKeyFrames Storyboard.TargetName="Background_Invalid" Storyboard.TargetProperty="(UIElement.Visibility)">
                                <DiscreteObjectKeyFrame KeyTime="0">
                                    <DiscreteObjectKeyFrame.Value>
                                        <Visibility>Visible</Visibility>
                                    </DiscreteObjectKeyFrame.Value>
                                </DiscreteObjectKeyFrame>
                            </ObjectAnimationUsingKeyFrames>
                            <ObjectAnimationUsingKeyFrames Storyboard.TargetName="ErrorIndicator" Storyboard.TargetProperty="Visibility">
                                <DiscreteObjectKeyFrame KeyTime="0">
                                    <DiscreteObjectKeyFrame.Value>
                                        <Visibility>Visible</Visibility>
                                    </DiscreteObjectKeyFrame.Value>
                                </DiscreteObjectKeyFrame>
                            </ObjectAnimationUsingKeyFrames>
                        </Storyboard>
                    </VisualState>
                </VisualStateGroup>
                <VisualStateGroup x:Name="EditStates">
                    <VisualState x:Name="ReadOnlyMode" />
                    <VisualState x:Name="EditMode">
                        <Storyboard>
                            <ObjectAnimationUsingKeyFrames Storyboard.TargetName="EditIndicator" Storyboard.TargetProperty="Visibility">
                                <DiscreteObjectKeyFrame KeyTime="0">
                                    <DiscreteObjectKeyFrame.Value>
                                        <Visibility>Visible</Visibility>
                                    </DiscreteObjectKeyFrame.Value>
                                </DiscreteObjectKeyFrame>
                            </ObjectAnimationUsingKeyFrames>
                        </Storyboard>
                    </VisualState>
                </VisualStateGroup>
            </VisualStateManager.VisualStateGroups>
            <grid:SelectiveScrollingGrid x:Name="grid">
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="Auto" />
                    <ColumnDefinition Width="Auto" />
                    <ColumnDefinition Width="Auto" />
                    <ColumnDefinition Width="*" />
                </Grid.ColumnDefinitions>
                <Grid.RowDefinitions>
                    <RowDefinition Height="*" />
                    <RowDefinition Height="Auto" />
                    <RowDefinition Height="Auto" />
                    <RowDefinition Height="Auto" />
                </Grid.RowDefinitions>
                <Border x:Name="SelectionBackground" Grid.Column="2" Grid.ColumnSpan="2" Background="{TemplateBinding Background}" Margin="{TemplateBinding Margin}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}" Padding="{TemplateBinding Padding}" grid:SelectiveScrollingGrid.SelectiveScrollingClip="True" />
                <Rectangle x:Name="Background_Over" Fill="{telerik:Windows8Resource ResourceKey=StrongBrush}" Opacity="0.1" Grid.ColumnSpan="4" Visibility="Collapsed" grid:SelectiveScrollingGrid.SelectiveScrollingClip="True" />
                <Rectangle x:Name="Background_Selected" Fill="#FF9c9c9c" Visibility="Collapsed" Margin="0,0,0,0" Grid.ColumnSpan="4" grid:SelectiveScrollingGrid.SelectiveScrollingClip="True"/>
                <!--Ramecek pro erroru-->
                <Rectangle x:Name="Background_Invalid" Stroke="#FFe56060" Fill="White" StrokeThickness="1" Grid.ColumnSpan="4" Visibility="Collapsed" grid:SelectiveScrollingGrid.SelectiveScrollingClip="True" />
                <controls:GridViewToggleButton Grid.Column="2" x:Name="PART_HierarchyExpandButton" Width="25" grid:SelectiveScrollingGrid.SelectiveScrollingOrientation="Vertical" Opacity="{Binding IsExpandable, RelativeSource={RelativeSource TemplatedParent}, Converter={StaticResource BooleanToOpacityConverter}}" IsHitTestVisible="{Binding IsExpandable, RelativeSource={RelativeSource TemplatedParent}}" Visibility="{Binding HasHierarchy, RelativeSource={RelativeSource TemplatedParent}, Converter={StaticResource BooleanToVisibilityConverter}}" IsChecked="{Binding IsExpanded, Mode=TwoWay, RelativeSource={RelativeSource TemplatedParent}}" IsTabStop="{TemplateBinding IsTabStop}" />
                <Border Grid.Column="2" grid:SelectiveScrollingGrid.SelectiveScrollingOrientation="Vertical" Visibility="{Binding HasHierarchy, RelativeSource={RelativeSource TemplatedParent}, Converter={StaticResource BooleanToVisibilityConverter}}" />
                <grid:DataCellsPresenter Grid.Column="3" x:Name="PART_DataCellsPresenter" />
                <Border x:Name="PART_RowBorder" SnapsToDevicePixels="True"  ClipToBounds="False" BorderBrush="{TemplateBinding HorizontalGridLinesBrush}" BorderThickness="{Binding HorizontalGridLinesWidth, RelativeSource={RelativeSource TemplatedParent}, Converter={StaticResource GridLineWidthToThicknessConverter}, ConverterParameter=Bottom}" Grid.ColumnSpan="4" Grid.Column="1" Grid.RowSpan="4" VerticalAlignment="Bottom" grid:SelectiveScrollingGrid.SelectiveScrollingClip="True" />
                <Border Grid.Column="2" Grid.Row="2" Grid.ColumnSpan="2" grid:SelectiveScrollingGrid.SelectiveScrollingClip="True">
                    <ContentPresenter x:Name="PART_HierarchyChildPresenter" grid:SelectiveScrollingGrid.SelectiveScrollingClip="True" Visibility="{Binding IsExpanded, RelativeSource={RelativeSource TemplatedParent}, Converter={StaticResource BooleanToVisibilityConverter}}" />
                </Border>
                <grid:DetailsPresenter x:Name="PART_DetailsPresenter" Grid.Column="2" Grid.ColumnSpan="2" Grid.Row="1" DetailsProvider="{TemplateBinding DetailsProvider}" />
                <Border x:Name="PART_IndicatorPresenter" Width="25" VerticalAlignment="Stretch" Visibility="{TemplateBinding RowIndicatorVisibility}" grid:SelectiveScrollingGrid.SelectiveScrollingOrientation="Vertical" Grid.RowSpan="3" Background="{telerik:Windows8Resource ResourceKey=MainBrush}" BorderBrush="{telerik:Windows8Resource ResourceKey=BasicBrush}" BorderThickness="0,0,1,0">
                    <Grid>
                        <Grid x:Name="NavigatorIndicator" HorizontalAlignment="Center" VerticalAlignment="Center" Width="9" Height="9" Visibility="Collapsed">
                            <Path x:Name="plus" Stretch="Fill" Width="8" Height="4" Data="M0,0 L8,2.3841858E-07 L4,4 z" RenderTransformOrigin="0.5,0.5" Fill="{telerik:Windows8Resource ResourceKey=AccentBrush}" StrokeThickness="{TemplateBinding BorderThickness}" Margin="{TemplateBinding Padding}">
                                <Path.RenderTransform>
                                    <TransformGroup>
                                        <ScaleTransform ScaleY="0" />
                                        <SkewTransform />
                                        <RotateTransform Angle="90" />
                                        <TranslateTransform X="9.5006054579016563E-08" Y="-4.6599587300022449E-08" />
                                    </TransformGroup>
                                </Path.RenderTransform>
                            </Path>
                        </Grid>
                        <Border x:Name="EditIndicator" HorizontalAlignment="Center" VerticalAlignment="Center" Width="12" Height="10" Visibility="Collapsed" Background="{telerik:Windows8Resource ResourceKey=MainBrush}" BorderBrush="{telerik:Windows8Resource ResourceKey=StrongBrush}" BorderThickness="0">
                            <Path Fill="Transparent" Stretch="Fill" Data="M3,2 L4,2 L5,2 L6,2 L6,3 L5,3 L5,4 L5,5 L5,6 L5,7 L6,7 L6,8 L5,8 L4,8 L3,8 L3,7 L4,7 L4,6 L4,5 L4,4 L4,3 L3,3 z" HorizontalAlignment="Left" Margin="0,0,0,0" Width="3" Height="6" />
                        </Border>
                        <!--Error pri spatnem vyplneni-->
                        <Grid x:Name="ErrorIndicator" HorizontalAlignment="Center" VerticalAlignment="Center" Visibility="Collapsed">
                            <Ellipse Fill="{telerik:Windows8Resource ResourceKey=MainBrush}" Width="16" Height="16" Stroke="#FFe56060" />
                            <Path Data="M1.0000001,8 C1.5522848,8 2.0000002,8.4477148 2.0000002,9 C2.0000002,9.5522842 1.5522848,10 1.0000001,10 C0.4477154,10 1.527369E-07,9.5522842 1.4901161E-07,9 C1.527369E-07,8.4477148 0.4477154,8 1.0000001,8 z M0,0 L2,0 L2,7 L0,7 z" Fill="#FFe56060" Width="2" Height="10" Stretch="Fill" />
                            <ToolTipService.ToolTip>
                                <ToolTip x:Name="validationTooltip" Placement="Bottom" Content="{TemplateBinding Errors}"></ToolTip>
                            </ToolTipService.ToolTip>
                        </Grid>
                        <Border x:Name="PART_RowResizer" Background="Transparent" Height="4" VerticalAlignment="Bottom" Cursor="SizeNS" />
                    </Grid>
                </Border>
                <grid:IndentPresenter x:Name="PART_IndentPresenter" IndentLevel="{TemplateBinding IndentLevel}" Grid.Column="1" Grid.RowSpan="4" grid:SelectiveScrollingGrid.SelectiveScrollingOrientation="Vertical" />
 
            </grid:SelectiveScrollingGrid>
        </Border>
    </ControlTemplate>
    <Style x:Key="GridViewRowStyle" TargetType="grid:GridViewRow">
        <Setter Property="IsTabStop" Value="False" />
        <Setter Property="Template" Value="{DynamicResource GridViewRowTemplate}" />
        <Setter Property="Background" Value="#FF8a8a8a" />
        <Setter Property="FontWeight" Value="Normal" />
        <Setter Property="AllowDrop" Value="True" />
        <Setter Property="VerticalContentAlignment" Value="Stretch" />
        <Setter Property="HorizontalContentAlignment" Value="Stretch" />
        <Setter Property="Padding" Value="0" />
        <Setter Property="BorderThickness" Value="0" />
        <Setter Property="SnapsToDevicePixels" Value="False" />
    </Style>
    <Style TargetType="grid:GridViewRow" BasedOn="{StaticResource GridViewRowStyle}" />

Vanya Pavlova
Telerik team
 answered on 25 Nov 2013
1 answer
87 views
Firstly with the datepicker just in edit template I wasnt seeing it at all, secondly the formatting of date MMM/yyy isnt showing?

   
<telerik:RadGridView.Columns>
        <telerik:GridViewDataColumn Header="Lot Number" DataMemberBinding="{Binding LotNumber}" />
        <telerik:GridViewDataColumn Header="Expiry Date" DataMemberBinding="{Binding ExpiryDate}" DataFormatString="{} {0: MMM/yyyy}">
            <telerik:GridViewDataColumn.CellTemplate>
                <DataTemplate>
                    <telerik:RadDatePicker x:Name="datePicker" DateTimeWatermarkContent="Select a date" SelectedValue="{Binding ExpiryDate, Mode=OneWay}"  DateSelectionMode="Month"/>
                </DataTemplate>
            </telerik:GridViewDataColumn.CellTemplate>
            <telerik:GridViewDataColumn.CellEditTemplate>
                <DataTemplate>
                    <telerik:RadDatePicker x:Name="datePickerEdit" DateTimeWatermarkContent="Select a date" SelectedValue="{Binding ExpiryDate, Mode=TwoWay}" DateSelectionMode="Month"  />
                </DataTemplate>
            </telerik:GridViewDataColumn.CellEditTemplate>
        </telerik:GridViewDataColumn>
         
    </telerik:RadGridView.Columns>
</telerik:RadGridView>
Yoan
Telerik team
 answered on 25 Nov 2013
1 answer
52 views

 I have a radgridview that has a unbounded column that I would like to set the value based on another column's value.
Ex. If column 1 is true set column 2 to "T"

I have  this code so far

Private Sub RadGridView_RowLoaded(sender As Object, e As RowLoadedEventArgs) Handles RadGridView.RowLoaded

Dim currentTrans As Trans

If TypeOf e.Row Is GridViewRow AndAlso Not (TypeOf e.Row Is GridViewNewRow) Then

Dim Trans As Trans = TryCast(e.DataElement, Trans)

If Trans.Transmit = True Then

 ????????????????????

 

 

End If

 

End If


I can go thru each row and check the value of column 1 but I cannot find how to set the value of column 2
Thank you

 

Dimitrina
Telerik team
 answered on 25 Nov 2013
7 answers
217 views
Hi there,

We're moving from a single-selection model to a multi-selection model.  Using property sets with PropertySetMode of Intersection mostly works well for us, but I'm not sure how to change the following case.

The important points are:
- the business object exposes, for instance, Width and Height.
- we use a small wrapper class for each type of business object we have in the property grid.
- we'd like these two properties to appear together in the same line of the property grid as Size (see attached image).
- we want to have a more complicated view of the properties.  In this case, we want to have a little check box indicating whether the aspect ratio of Width/Height should be maintained.  We specify the DataTemplate for this view with the auto-generating-property process; however, parts of the DataTemplate no long have the correct binding.  We previously bound some parts of these DataTemplates to properties marked Browsable[false] -- these properties were so marked to prevent them from showing up as properties in the PropertyGrid but to have them available for binding in the DataTemplates we specify in the auto-generation process.  However, they don't show up in CurrentPropertySet.


here's some example pseudo-code.  PropertyChanged implementation elided.  As an aside, the main purpose of the business-object wrapper for the property grid is to capture and memento-ize property-grid changes for undo/redo (i show that here only to show why we will continue to have a wrapper).

public class BusinessObject : INotifyPropertyChanged
{
   public double Width { get; set; }
   public double Height { get; set; }
}

public class PropertyGridWrapper_for_BusinessObject : INotifyPropertyChanged
{
private BusinessObject m_BusinessObject = ...;
private Size m_Size = ...;
       
[Browsable(false)]
public double Width
{
get { return m_BusinessObject.Width; }
set
{
if (m_BusinessObject.Width != value)
{
if (PreserveAspect)
// change Height, as well
else
// change Width
}
}
}
 
[Browsable(false)]
public double Height { ... similar to Width ... }
 
public Size Size { get { return m_Size; } }
 
[Browsable(false)]
public bool PreserveAspect { get; set; }
}

then, when auto-generating property definitions, we specify the following DataTemplate for the Size property:

<DataTemplate x:Key="BusinessObjectSizePropertyGridTemplate">
<Grid>
<Grid.RowDefinitions>
<RowDefinition />
<RowDefinition />
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="*" />
<ColumnDefinition Width="Auto" />
</Grid.ColumnDefinitions>
<TextBlock Grid.Row="0" Grid.Column="0" HorizontalAlignment="Right" VerticalAlignment="Center" Text="Height:  " />
<TextBox Grid.Row="0" Grid.Column="1" VerticalAlignment="Center" Text="{Binding Height}" />
<TextBlock Grid.Row="1" Grid.Column="0" HorizontalAlignment="Right" VerticalAlignment="Center" Text="Width:  " />
<TextBox Grid.Row="1" Grid.Column="1" VerticalAlignment="Center" Text="{Binding Width}" />
<Grid Grid.Row="0" Grid.Column="2" Grid.RowSpan="2" Margin="4">
<Grid.RowDefinitions>
<RowDefinition />
<RowDefinition />
<RowDefinition />
</Grid.RowDefinitions>
<TextBlock Grid.Row="0" FontFamily="Arial" Text="┐" VerticalAlignment="Bottom" Margin="0,0,0,5" />
<CheckBox Grid.Row="1" VerticalAlignment="Center" IsChecked="{Binding PreserveAspect}" />
<TextBlock Grid.Row="2" FontFamily="Arial" Text="┘" VerticalAlignment="Top" Margin="0,5,0,0" />
</Grid>
</Grid>
</DataTemplate>

using CurrentPropertySet as part of the bindings in this template doesn't work.  The bound Text property ends up being null when bound as, e.g., "CurrentPropertySet[Height]".  Do I infer correctly that the property-sets mechanism generates a dynamic object with only the browsable properties?

So, given the above example, how can we structure things to look like the image while using property sets, please?

Edit:  formatted code area
Ivan Ivanov
Telerik team
 answered on 25 Nov 2013
1 answer
115 views
Hi all,

In my application i am using the themes concept to load at runtime am able to do that,when changing from one theme to the other its taking much time i want to show some progress bar or busy indicator till the theme is loaded how can i achieve this scenario?

Thanks in Advance
Ruth
Vladi
Telerik team
 answered on 25 Nov 2013
6 answers
285 views
Hi,
By defaut CartesianPlotBandAnnotation draw the annotation from -> to plot value

I have a RadCartesianChart using a BarSeries and CategoricalAxis as HorizontalAxis. The categories represent hours (in 24 hours format) : 0 1 2 3 ... 23

If settings CartesianPlotBandAnnotation with parameters From : 6 and To : 23 the annotation starts at the middle of the 6 hour bar et 23 hour bar.

I'm searching a solution to force CartesianPlotBandAnnotation to fill 6 and 23 hours bar drawing zone.

Thanks a lot ! :)
Petar Marchev
Telerik team
 answered on 25 Nov 2013
3 answers
290 views
Hi, 

I wonder does AutocompleteBox support displaying Subscript and superscript if the autocomplete dropdown contains these values?

How to achieve that? thank you.

Vladi
Telerik team
 answered on 25 Nov 2013
0 answers
95 views
I am trying to use the grid with about 10 columns and 1000 rows.  I am bound to an Observable collection for this, though in production I'd like to move to an IQueryable binding with paging via the datapager.  Autogenerated columns are a requirement as well as the user being able to resize/move columns.  In production, we will have anywhere from 5 to 120 columns with 1000 rows and hopefully paging.  All rows are read only and the user cannot add/remove rows or edit any cells.  When clicking the scroll handle and dragging with the mouse, the scroll behavior is very very jumpy instead of being smooth.  If you scroll VERY slowly, then it's mostly smooth, but still not quite where it should be.  Even horizontal scrolling with 2 or 3 columns off the side is clunkier than it should be.  All of the demos I've seen have very smooth scrolling and that behavior is very desirable.  I have read the degraded performance articles and have put sizes on the grid row containing the radgridview so that it does not size to "infinity".  Please point me in the right direction to get smooth performance.  Below is my View, ViewModel and Model being represented.

Thank you in advance,
Mark

MainWindow.xaml
<Window
        xmlns:my="clr-namespace:TelerikGridPrototype"
        xmlns:telerik="http://schemas.telerik.com/2008/xaml/presentation" x:Class="TelerikGridPrototype.MainWindow"
        Title="MainWindow" Height="720" Width="1280" WindowStartupLocation="CenterScreen"
        DataContext="{Binding MainPageViewModel, Source={StaticResource Locator}}">
    <telerik:RadBusyIndicator IsBusy="{Binding Busy}">
 
    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition Height="660"/>
            <RowDefinition Height="30"/>
        </Grid.RowDefinitions>
        <telerik:RadGridView Name="gridView" ShowGroupPanel="False" IsReadOnly="True" CanUserInsertRows="False" CanUserDeleteRows="False" AreRowDetailsFrozen="True"  Grid.Row="0" ItemsSource="{Binding Records}"  HorizontalAlignment="Stretch" VerticalAlignment="Stretch"/>
        <Button HorizontalAlignment="Center" VerticalAlignment="Center" Grid.Row="1" Content="Load" Name="btnLoad" Width="100">
            <i:Interaction.Triggers>
                <i:EventTrigger EventName="Click">
                    <ei:CallMethodAction
                    TargetObject="{Binding}"
                    MethodName="LoadDataAsync"/>
                </i:EventTrigger>
            </i:Interaction.Triggers>
        </Button>
    </Grid>
    </telerik:RadBusyIndicator>
</Window>

MainPageViewModel.cs
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Linq;
using System.Threading.Tasks;
using System.Windows;
using PhoenixDAL.Models;
using SimpleMvvmToolkit;
using TelerikGridPrototype.Models;
 
namespace TelerikGridPrototype
{
    public class MainPageViewModel : ViewModelBase<MainPageViewModel>
    {
        public MainPageViewModel()
        {
            Records = new ObservableCollection<record>();
        }
 
        public ObservableCollection<record> Records { get; set; }
 
        private bool busy;
        public bool Busy
        {
            get { return busy; }
            set
            {
                busy = value;
                NotifyPropertyChanged(m => m.Busy);
            }
        }
 
        public event EventHandler<NotificationEventArgs<Exception>> ErrorNotice;
 
        public async void LoadDataAsync()
        {
            Busy = true;
            var q = await Task<List<record>>.Factory.StartNew
                (
                 
                    () => DAL.Instance.Phoenix.records.Take(1000).OrderByDescending(a => a.StartTime).ToList()
                );
 
            foreach (var v in q)
            {
                Records.Add(v);
            }
            Busy = false;
        }
 
        // Helper method to notify View of an error
        private void NotifyError(string message, Exception error)
        {
            Notify(ErrorNotice, new NotificationEventArgs<Exception>(message, error));
        }
    }
}

record.cs
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
 
namespace PhoenixDAL.Models
{
    public partial class record
    {
        [DisplayAttribute(AutoGenerateField = false)]
        public long RecordID { get; set; }
        [DisplayAttribute(Name = "Channel Name")]
        public string ChannelName { get; set; }
        [DisplayAttribute(AutoGenerateField = false)]
        public long StartTime { get; set; }
        [DisplayAttribute(AutoGenerateField = false)]
        public long StartEMCRef { get; set; }
        [DisplayAttribute(AutoGenerateField = false)]
        public int StartPageIndex { get; set; }
        [DisplayAttribute(AutoGenerateField = false)]
        public int StartBlockOffset { get; set; }
        [DisplayAttribute(AutoGenerateField = false)]
        public long EndTime { get; set; }
        [DisplayAttribute(AutoGenerateField = false)]
        public long EndEMCRef { get; set; }
        [DisplayAttribute(AutoGenerateField = false)]
        public int EndPageIndex { get; set; }
        [DisplayAttribute(AutoGenerateField = false)]
        public int EndBlockOffset { get; set; }
        [DisplayAttribute(Name = "Duration")]
        public long Duration { get; set; }
        [DisplayAttribute(Name = "Source ID")]
        public int SourceID { get; set; }
        [DisplayAttribute(AutoGenerateField = false)]
        public int SequenceIndex { get; set; }
        [DisplayAttribute(AutoGenerateField = false)]
        public Nullable<int> IntegrationID { get; set; }
        [DisplayAttribute(Name = "Transmission ID")]
        public string Transmission_ID { get; set; }
        [DisplayAttribute(Name = "Storage Alias")]
        public string StorageAlias { get; set; }
        [DisplayAttribute(Name = "Media Tag")]
        public Nullable<int> Media_Tag { get; set; }
        [DisplayAttribute(Name = "Media Description")]
        public string Media_Description { get; set; }
        [DisplayAttribute(Name = "Trigger Event")]
        public string Trigger_Event { get; set; }
        [DisplayAttribute(Name = "Termination Event")]
        public string Termination_Event { get; set; }
        [DisplayAttribute(Name = "Start Time")]
        public Nullable<System.DateTime> Start_Time { get; set; }
        [DisplayAttribute(Name = "End Time")]
        public Nullable<System.DateTime> End_Time { get; set; }
        [DisplayAttribute(Name = "Total Seconds")]
        public Nullable<double> Total_Seconds { get; set; }
    }
}

There is no code-behind in the xaml.cs file.
Mark
Top achievements
Rank 1
 asked on 22 Nov 2013
14 answers
302 views
Hi all,


We have a WPF application that gets deployed using click once.
This applications uses the Telerik WPF control suite. Everything runs just fine.

..except when, after installing our application, a client installs the Telerik WPF demos on his machine.
Then, for whatever reason, our application seems to load the Telerik binaries from the Telerik WPF demos,
NOT from the deployed application (license warning appears, theming is gone, ..).

Any idea why this happens?
The Telerik WPF demos do not install assemblies into the GAC, right?
(note that after uninstalling the Telerik WPF demos & re-installing our application, everything works just fine again)

Thanks for your time,
Koen
Dimitrina
Telerik team
 answered on 22 Nov 2013
2 answers
277 views
I work in an application that the user has the option to change the language of the application at any time. I need to be able to change the text of the filter menu(ex. "show rows with value that") to spanish or whatever other language we have available. We already have the power to make these translations I am just not sure how to grab the property of this text in order to change it. I know that the localization manager is how you would initially tell me how to fix this problem, however that approach is not optimal for our particular application. Is there any other way to grab that text properties and change its value other than using the localization manager? Any sort of work around? Any help would be appreciated.
Tyler
Top achievements
Rank 1
 answered on 22 Nov 2013
Narrow your results
Selected tags
Tags
+? more
Top users last month
Rob
Top achievements
Rank 3
Iron
Iron
Iron
Atul
Top achievements
Rank 1
Iron
Iron
Iron
Alexander
Top achievements
Rank 1
Veteran
Iron
Serkan
Top achievements
Rank 1
Iron
Shawn
Top achievements
Rank 1
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Rob
Top achievements
Rank 3
Iron
Iron
Iron
Atul
Top achievements
Rank 1
Iron
Iron
Iron
Alexander
Top achievements
Rank 1
Veteran
Iron
Serkan
Top achievements
Rank 1
Iron
Shawn
Top achievements
Rank 1
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?