or
taskBoardScheduleView.TimeRulerItemStyleSelector = new CustomTimeRulerItemStyleSelector();public class CustomTimeRulerItemStyleSelector : OrientedTimeRulerItemStyleSelector { public Style MinorTickLineStyle { get; set; } public Style MajorTickLineStyle { get; set; } public override Style SelectStyle(object item, DependencyObject container, ViewDefinitionBase activeViewDeifinition) { if (container is TimeRulerLine) { TickData tick = item as TickData; if (tick.Type == TickType.Minor || tick.Type == TickType.Major) { return Application.Current.FindResource("TransparentTickLineStyle") as Style; } return base.SelectStyle(item, container, activeViewDeifinition); } return base.SelectStyle(item, container, activeViewDeifinition); } }<Style x:Key="TransparentTickLineStyle" TargetType="{x:Type telerik:TimeRulerLine}"> <Setter Property="BorderBrush" Value="Transparent"/> <Setter Property="Background" Value="White"/> <Setter Property="Template"> <Setter.Value> <ControlTemplate TargetType="{x:Type telerik:TimeRulerLine}"> <Border x:Name="LineVisual" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="0,1,0,0" Background="{TemplateBinding Background}"/> <ControlTemplate.Triggers> <Trigger Property="Orientation" Value="Horizontal"> <Setter Property="BorderThickness" TargetName="LineVisual" Value="1,0,0,0"/> </Trigger> </ControlTemplate.Triggers> </ControlTemplate> </Setter.Value> </Setter> </Style>
<telerik:RadGridView Name="sourcegrid" Grid.Row="1" ItemsSource="{Binding Items}" AutoGenerateColumns="False" IsReadOnly="True" SelectionMode="Single" SelectedItem="{Binding SelectedItem, Mode=TwoWay}" ContextMenu="{StaticResource gridmenu}" IsBusy="{Binding IsLoading}"> <telerik:RadGridView.Columns> <telerik:GridViewBoundColumnBase Header="Account Number" DataMemberBinding="{Binding AccountNumber}" ShowDistinctFilters="False" > <telerik:GridViewBoundColumnBase.CellTemplate> <DataTemplate> <TextBlock><Hyperlink Command="{Binding DataContext.SelectCommand, RelativeSource={RelativeSource AncestorType={x:Type telerik:RadGridView}}}" CommandParameter="{Binding}"> <TextBlock Text="{Binding AccountNumber}"/> </Hyperlink></TextBlock> </DataTemplate> </telerik:GridViewBoundColumnBase.CellTemplate> <telerik:GridViewBoundColumnBase.AggregateFunctions> <telerik:CountFunction Caption="Count:" /> </telerik:GridViewBoundColumnBase.AggregateFunctions> </telerik:GridViewBoundColumnBase> <telerik:GridViewDataColumn Header="Account Name" DataMemberBinding="{Binding AccountName}" Width="*" ShowDistinctFilters="False" FooterCellStyle="{StaticResource GridNoLinesFooterStyle}"/> <telerik:GridViewDataColumn Header="Association" DataMemberBinding="{Binding AssociationName}" FooterCellStyle="{StaticResource GridNoLinesFooterStyle}"/> <telerik:GridViewDataColumn Header="Status" DataMemberBinding="{Binding AccountStatusName}" FooterCellStyle="{StaticResource GridNoLinesFooterStyle}" /> </telerik:RadGridView.Columns> </telerik:RadGridView>grid.FilterDescriptors.Add(fieldName, FilterOperator.IsEqualTo, fieldValue) { MemberType = column.DataType })
- or -
grid.FilterDescriptors.Add(fieldName, FilterOperator.IsNotEqualTo, fieldValue) { MemberType = column.DataType })
<telerik:RadGridView HorizontalAlignment="Stretch" Margin="10,10,10,0" x:Name="ProjectGrid" VerticalAlignment="Stretch" AutoGenerateColumns="False" AlternateRowBackground="#FFEEEEEE" RowIndicatorVisibility="Collapsed" CanUserSortColumns="True" IsReadOnly="True" CanUserFreezeColumns="False" SelectionUnit="FullRow" CanUserResizeColumns="False" IsFilteringAllowed="True" ItemsSource="{Binding Path=CurrentUser.Quotes, Source={StaticResource applicationViewModel}}"> <telerik:RadGridView.Columns> <telerik:GridViewDataColumn Header="Project Date" Width=".15*" DataMemberBinding="{Binding Path=ProjectDate}" DataFormatString="{}{0:MM/dd/yyyy}" /> <telerik:GridViewDataColumn Header="Customer" Width=".2*" DataMemberBinding="{Binding Path=CustomerName}" /> <telerik:GridViewDataColumn Header="PO #" Width=".1*" DataMemberBinding="{Binding Path=POnumber}" /> <telerik:GridViewDataColumn Header="Quote #" Width=".1*" DataMemberBinding="{Binding Path=QuoteNumber}" /> <telerik:GridViewDataColumn Header="Quote Type" Width=".15*" DataMemberBinding="{Binding Path=QuoteType.Description}" /> <telerik:GridViewDataColumn Header="User" Width=".2*"> <telerik:GridViewDataColumn.CellTemplate> <DataTemplate> <StackPanel Orientation="Horizontal"> <TextBlock Text="{Binding Path=User.FirstName}" Width="Auto"></TextBlock> <TextBlock Text="{Binding Path=User.LastName}" Margin="5,0,0,0" Width="Auto"></TextBlock> </StackPanel> </DataTemplate> </telerik:GridViewDataColumn.CellTemplate> </telerik:GridViewDataColumn> <telerik:GridViewDataColumn Header="Items" Width=".1*" DataMemberBinding="{Binding QuoteProducts.Count}" /> </telerik:RadGridView.Columns> <mcmds:CommandBehaviorCollection.Behaviors> <mcmds:BehaviorBinding Event="MouseDoubleClick" Command="{Binding DoubleClick}" CommandParameter="{Binding SelectedItem, ElementName=ProjectGrid}" /> </mcmds:CommandBehaviorCollection.Behaviors> </telerik:RadGridView>System.NullReferenceException was unhandled Message="Object reference not set to an instance of an object." Source="Telerik.Windows.Controls.DataVisualization" StackTrace: at Telerik.Windows.Controls.Map.MapBaseControl.FindResource[TResourceType](String resourceKey) in c:\TB\101\WPF_Scrum\Release_WPF\Sources\Development\Controls\DataVisualization\Map\Controls\MapBaseControl.cs:line 115 at Telerik.Windows.Controls.Map.MapBaseControl.RetrieveResource[TResourceType](Object resourceKey) in c:\TB\101\WPF_Scrum\Release_WPF\Sources\Development\Controls\DataVisualization\Map\Controls\MapBaseControl.cs:line 58 at Telerik.Windows.Controls.Map.MapZoomBar.AddDefaultZoomCommands() in c:\TB\101\WPF_Scrum\Release_WPF\Sources\Development\Controls\DataVisualization\Map\Controls\MapZoomBar.cs:line 295 at Telerik.Windows.Controls.Map.MapZoomBar.OnMapInitialize(RadMap oldMapControl, RadMap newMapControl) in c:\TB\101\WPF_Scrum\Release_WPF\Sources\Development\Controls\DataVisualization\Map\Controls\MapZoomBar.cs:line 276 at Telerik.Windows.Controls.Map.MapBaseControl.MapControlChanged(DependencyObject source, DependencyPropertyChangedEventArgs eventArgs) in c:\TB\101\WPF_Scrum\Release_WPF\Sources\Development\Controls\DataVisualization\Map\Controls\MapBaseControl.cs:line 79 at System.Windows.DependencyObject.OnPropertyChanged(DependencyPropertyChangedEventArgs e) at System.Windows.FrameworkElement.OnPropertyChanged(DependencyPropertyChangedEventArgs e) at System.Windows.DependencyObject.NotifyPropertyChange(DependencyPropertyChangedEventArgs args) at System.Windows.DependencyObject.UpdateEffectiveValue(EntryIndex entryIndex, DependencyProperty dp, PropertyMetadata metadata, EffectiveValueEntry oldEntry, EffectiveValueEntry& newEntry, Boolean coerceWithDeferredReference, OperationType operationType) at System.Windows.DependencyObject.SetValueCommon(DependencyProperty dp, Object value, PropertyMetadata metadata, Boolean coerceWithDeferredReference, OperationType operationType, Boolean isInternal) at System.Windows.DependencyObject.SetValue(DependencyProperty dp, Object value) at Telerik.Windows.Controls.Map.MapBaseControl.set_MapControl(RadMap value) in c:\TB\101\WPF_Scrum\Release_WPF\Sources\Development\Controls\DataVisualization\Map\Controls\MapBaseControl.cs:line 35 at Telerik.Windows.Controls.RadMap.Initialize() in c:\TB\101\WPF_Scrum\Release_WPF\Sources\Development\Controls\DataVisualization\Map\RadMap.cs:line 1475 at Telerik.Windows.Controls.RadMap.OnApplyTemplate() in c:\TB\101\WPF_Scrum\Release_WPF\Sources\Development\Controls\DataVisualization\Map\RadMap.cs:line 1285 at System.Windows.FrameworkElement.ApplyTemplate() at System.Windows.FrameworkElement.MeasureCore(Size availableSize) at System.Windows.UIElement.Measure(Size availableSize) at System.Windows.Controls.DockPanel.MeasureOverride(Size constraint) at System.Windows.FrameworkElement.MeasureCore(Size availableSize) at System.Windows.UIElement.Measure(Size availableSize) at System.Windows.ContextLayoutManager.UpdateLayout() at System.Windows.ContextLayoutManager.UpdateLayoutCallback(Object arg) at System.Windows.Media.MediaContext.InvokeOnRenderCallback.DoWork() at System.Windows.Media.MediaContext.FireInvokeOnRenderCallbacks() at System.Windows.Media.MediaContext.RenderMessageHandlerCore(Object resizedCompositionTarget) at System.Windows.Media.MediaContext.RenderMessageHandler(Object resizedCompositionTarget) at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Boolean isSingleParameter) at System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Boolean isSingleParameter, Delegate catchHandler) at System.Windows.Threading.Dispatcher.WrappedInvoke(Delegate callback, Object args, Boolean isSingleParameter, Delegate catchHandler) at System.Windows.Threading.DispatcherOperation.InvokeImpl() at System.Windows.Threading.DispatcherOperation.InvokeInSecurityContext(Object state) at System.Threading.ExecutionContext.runTryCode(Object userData) at System.Runtime.CompilerServices.RuntimeHelpers.ExecuteCodeWithGuaranteedCleanup(TryCode code, CleanupCode backoutCode, Object userData) at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state) at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state) at System.Windows.Threading.DispatcherOperation.Invoke() at System.Windows.Threading.Dispatcher.ProcessQueue() at System.Windows.Threading.Dispatcher.WndProcHook(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled) at MS.Win32.HwndWrapper.WndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled) at MS.Win32.HwndSubclass.DispatcherCallbackOperation(Object o) at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Boolean isSingleParameter) at System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Boolean isSingleParameter, Delegate catchHandler) at System.Windows.Threading.Dispatcher.WrappedInvoke(Delegate callback, Object args, Boolean isSingleParameter, Delegate catchHandler) at System.Windows.Threading.Dispatcher.InvokeImpl(DispatcherPriority priority, TimeSpan timeout, Delegate method, Object args, Boolean isSingleParameter) at System.Windows.Threading.Dispatcher.Invoke(DispatcherPriority priority, Delegate method, Object arg) at MS.Win32.HwndSubclass.SubclassWndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam) at System.Windows.Forms.UnsafeNativeMethods.DispatchMessageW(MSG& msg) at System.Windows.Forms.Application.ComponentManager.System.Windows.Forms.UnsafeNativeMethods.IMsoComponentManager.FPushMessageLoop(Int32 dwComponentID, Int32 reason, Int32 pvLoopData) at System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(Int32 reason, ApplicationContext context) at System.Windows.Forms.Application.ThreadContext.RunMessageLoop(Int32 reason, ApplicationContext context) at System.Windows.Forms.Application.Run(ApplicationContext context) at Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.OnRun() at Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.DoApplicationModel() at Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.Run(String[] commandLine) at WindowsApplication1.My.MyApplication.Main(String[] Args) in 17d14f5c-a337-4978-8281-53493378c1071.vb:line 81 at System.AppDomain._nExecuteAssembly(Assembly assembly, String[] args) at System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence assemblySecurity, String[] args) at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly() at System.Threading.ThreadHelper.ThreadStart_Context(Object state) at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state) at System.Threading.ThreadHelper.ThreadStart() InnerException: