Telerik Forums
UI for WPF Forum
1 answer
97 views
Hello,

I'm working with the ScheduleView and i need to have my appointments with two different backgroug colors. For example, the first hour of the appointment is yellow and the remaining hours are green. How can i do this?


Regards,
Masha
Telerik team
 answered on 09 Apr 2013
2 answers
95 views
Since applying the aforementioned update I can no longer get my RadExpander to display in the designer.  
I get a Design Time warning of "cannot locate resource 'themes/genericwindows8touch.xaml'".  

I am using the Windows8 Theme(non touch version) implicitly, which was working as expected prior to this update.
Patrick
Top achievements
Rank 2
 answered on 08 Apr 2013
9 answers
394 views
Hi.

Can I use an OGC Web Map Service as datasource for the WPF Map control?

/Thomas
David
Top achievements
Rank 1
 answered on 08 Apr 2013
4 answers
433 views
Hello,

I have a RadGridView that will be populated by a dynamically generated DataTable. I have therefore set the RadGridView property as follows: AutoGenerateColumns="True". My DataTable will contain dates, strings and integers. I want to be able to use a DataTemplate for each data type in the automatically generated columns of the grid. For instance, for string columns, I will want to use a TextBox with text wrapping, which accepts returns and has a certain maximum width.

For the purpose of this question, my datatable will be created and bound to the RadGridView as follows:

DataTable table = new DataTable();
table.Columns.Add(
new DataColumn("Date Column 1", typeof(DateTime)));
table.Columns.Add(
new DataColumn("Date Column 2", typeof(DateTime)));
table.Columns.Add(
new DataColumn("String Column 1", typeof(string)));
table.Columns.Add(
new DataColumn("String Column 2", typeof(string)));

DataRow row1 = table.NewRow();
row1[table.Columns[0]] = DateTime.Now;
row1[table.Columns[1]] = DateTime.Now.AddDays(10);
row1[table.Columns[2]] =
"some string";
row1[table.Columns[3]] =
"some other string";

table.Rows.Add(row1);
radGridView1.ItemsSource = table;

And my RadGridView currently looks like:

<telerik:RadGridView HorizontalAlignment="Stretch" Name="radGridView1" VerticalAlignment="Stretch" AutoGenerateColumns="True">
    <telerik:RadGridView.Resources>
        <DataTemplate x:Key="TextCellEditorTemplate">
            <TextBox Background="LightYellow" MaxWidth="250" TextWrapping="Wrap" AcceptsReturn="True"
                        Text="{Binding WHAT_GOES_HERE?}" />
        </DataTemplate>
        <DataTemplate x:Key="DateTimeCellEditorTemplate">
            ...
        </DataTemplate>
        <DataTemplate x:Key="IntegerCellEditorTemplate">
            ...
        </DataTemplate>
    </telerik:RadGridView.Resources>
</telerik:RadGridView>

Can you help me specify the binding of the text property of the DataTemplate that uses a TextBox? It should be a two-way binding with the underlying cell in the DataTable. Could you provide me with a basic working example of what I am trying to achieve? This would be greatly appreciated.

Thanks!
Nedyalko Nikolov
Telerik team
 answered on 08 Apr 2013
2 answers
346 views
How do you set the style for all cells in an autogenerated GridView in a designer friendly manner?

ItemContainerStyle has no effect.

it is possible to handle Columns.CollectionChanged and set Column.CellStyle there, but that approach requires code behind and is invisible at design time.

Martin
Top achievements
Rank 1
 answered on 08 Apr 2013
3 answers
227 views
Hi

I am using a RadMenu as content for RadRibbonDropDownButton.  I want the user to be able to select multiple RadMenuItems so I set StaysOpenOnClick=true but the menu doesn't stay open.  I also tried it as a sub menu with the same result.  See xaml below.

Thanks
Rich


                        <telerik:RadRibbonDropDownButton CollapseToMedium="WhenGroupIsMedium"
                                SmallImage="/Icons/16/find.png"                                                  
LargeImage="/Icons/32/twitter.png" Size="Large" Text="Panes">
                            <telerik:RadRibbonDropDownButton.DropDownContent>
                                <telerik:RadMenu Name="panes" Orientation="Vertical"> 
                                    <telerik:RadMenuItem Header="Navigation"
                                       Uid="1"
                                       IsCheckable="True"
                                       IsChecked="True" 
                                       Checked="RadMenuItem_Checked"
                                       Unchecked="RadMenuItem_Unchecked"
                                       StaysOpenOnClick="True" />
                                    <telerik:RadMenuItem Header="Available Tables"
                                       Uid="2"
                                       IsCheckable="True"
                                       IsChecked="True"
                                       Checked="RadMenuItem_Checked"
                                       Unchecked="RadMenuItem_Unchecked"
                                       StaysOpenOnClick="True" />
                                    <telerik:RadMenuItem IsSeparator="True" />
                                    <telerik:RadMenuItem Header="Criteria Columns"
                                       Uid="3"
                                       IsCheckable="True"
                                       IsChecked="True"
                                       Checked="RadMenuItem_Checked"
                                       Unchecked="RadMenuItem_Unchecked"
                                       StaysOpenOnClick="True" />                                 
                                    <telerik:RadMenuItem Header="Sql Statement"
                                       Uid="4"
                                       IsCheckable="True"
                                       IsChecked="True" 
                                       Checked="RadMenuItem_Checked"
                                       Unchecked="RadMenuItem_Unchecked"
                                       StaysOpenOnClick="True" />
                                    <telerik:RadMenuItem Header="Data Sheet"
                                       Uid="5"
                                       IsCheckable="True"
                                       IsChecked="True" 
                                       Checked="RadMenuItem_Checked"
                                       Unchecked="RadMenuItem_Unchecked"
                                       StaysOpenOnClick="True" />
                                    <telerik:RadMenuItem Header="Data Filter and Expression"
                                       Uid="6"
                                       IsCheckable="True"
                                       IsChecked="True"
                                       Checked="RadMenuItem_Checked"
                                       Unchecked="RadMenuItem_Unchecked"
                                       StaysOpenOnClick="True" />
                                </telerik:RadMenu>
                            </telerik:RadRibbonDropDownButton.DropDownContent>
                        </telerik:RadRibbonDropDownButton>
Pavel R. Pavlov
Telerik team
 answered on 08 Apr 2013
1 answer
414 views
Hi I am trying to customize the look of the group header with the use of data templates. When ever I do this no group header is displayed. I have tried to to use the Group Header template selector and to modify content template within the style selector both have th same results.  Here is the xmal I am trying to use. I have verified that the event creation style is being applied.
<ecu:GroupHeaderStyleSelector x:Key="GroupHeaderStyleSelector">
            <ecu:GroupHeaderStyleSelector.DateStyle>
                <Style TargetType="telerik:GroupHeader">
                    <Setter Property="Visibility" Value="Collapsed"/>
                </Style>
            </ecu:GroupHeaderStyleSelector.DateStyle>
            <ecu:GroupHeaderStyleSelector.EventCreationStyle>
                <Style TargetType="telerik:GroupHeader">
                    <Setter Property="Visibility" Value="Visible"/>
                    <Setter Property="Height" Value="100"></Setter>
                    <Setter Property="VerticalAlignment" Value="Top">
                    </Setter>
                    <Setter Property="ContentTemplate">
                        <Setter.Value>
                            <DataTemplate>
                                <TextBlock>Audio</TextBlock>
                            </DataTemplate>
                        </Setter.Value>
                    </Setter>
                    <!--<Setter Property="Template" Value="{StaticResource Testing}"></Setter>-->
                </Style>
            </ecu:GroupHeaderStyleSelector.EventCreationStyle>
        </ecu:GroupHeaderStyleSelector>

On the control I am doing the following 
<telerik:RadScheduleView Grid.Row="2"
                                 DialogClosing="eventsTimeline_DialogClosing_1"
                                  
                             AppointmentsSource="{Binding Events, Mode=TwoWay}"
                             NavigationHeaderVisibility="Collapsed"
                             ShowDialog="RadScheduleView_ShowDialog"
                             ResourceTypesSource="{Binding EventTypes}"                            
                             TimeRulerItemStyleSelector="{StaticResource TimeRulerItemStyleSelector}"
                             GroupHeaderStyleSelector="{StaticResource GroupHeaderStyleSelector}"
                             
                             AppointmentEditing="RadScheduleView_AppointmentEditing"
                             AppointmentSaving="eventsTimeline_AppointmentSaving" 
                             AppointmentCreating="eventsTimeline_AppointmentCreating_1"
                             AppointmentCreated="eventsTimeline_AppointmentCreated"
                             AppointmentSelectionChanged="eventsTimeline_AppointmentSelectionChanged_1"
                             AppointmentDeleting="eventsTimeline_AppointmentDeleting_1"
                             AppointmentDeleted="eventsTimeline_AppointmentDeleted_1"
                             DeleteAppointmentConfirmDialogStyle="{StaticResource DeleteEventConfirmDialogStyle}"
                             ResizeHighlightStyle="{StaticResource EventResizeHighlightStyle}"
                             Name="eventsTimeline" VerticalAlignment="Top">
            <telerik:RadScheduleView.ViewDefinitions>
                <telerik:DayViewDefinition
                    VisibleDays="1"
                    MajorTickLength="5min"
                    MinorTickLength="1min"
                    MinTimeRulerExtent="5000"
                    TimerulerMajorTickStringFormat="{}{0: HHmm}"
                    DayStartTime="00:00:00" DayEndTime="3:00:00" Orientation="Horizontal">
                </telerik:DayViewDefinition>
            </telerik:RadScheduleView.ViewDefinitions>
 
            <telerik:RadScheduleView.DragDropBehavior>
                <ecu:EventCreationDragDropBehavior />
            </telerik:RadScheduleView.DragDropBehavior>
 
            <telerik:RadScheduleView.AppointmentStyleSelector>
                <ecu:EventStyleSelector
                        AudioEventStyle="{StaticResource AudioEvent}"
                        OdorEventStyle="{StaticResource OdorEvent}"
                        LightingEventStyle="{StaticResource LightingEvent}"
                        SmokeEventStyle="{StaticResource SmokeEvent}"/>
            </telerik:RadScheduleView.AppointmentStyleSelector>
 
            <telerik:RadScheduleView.GroupDescriptionsSource>
                <telerik:GroupDescriptionCollection>
                    <telerik:ResourceGroupDescription ResourceType="Event Types" />
                </telerik:GroupDescriptionCollection>
            </telerik:RadScheduleView.GroupDescriptionsSource>
        </telerik:RadScheduleView>

Everything worked as intended until I tried to modify the control template. When I tried using the template selector I got the exact same results.
Vladi
Telerik team
 answered on 08 Apr 2013
1 answer
139 views
Hello, Telerik team!
I'm stumbled into some little UI inconveniences using RadGridView.
I use checkbox column bound to IsSelected property of my Model.
Item source of RadGRidView is of ObservableCollection<Model> class:

<controls3:RadGridView x:Name="Sports" ShowGroupPanel="False" ItemsSource="{Binding AllSports}"
    AutoGenerateColumns="False" RowIndicatorVisibility="Collapsed" CanUserSelect="False" ScrollViewer.HorizontalScrollBarVisibility="Disabled">
    <controls3:RadGridView.Columns>
        <controls3:GridViewCheckBoxColumn DataMemberBinding="{Binding IsSelected}" Header="Chosen" ForceCursor="True" IsThreeState="False" />
        <controls3:GridViewDataColumn Width="239" DataMemberBinding="{Binding name}" Header="Name"/>
    </controls3:RadGridView.Columns>
</controls3:RadGridView>
when I want to check the checkbox, it takes three clicks to make it checked: first accordin row is selected, second click select a cell, and only on third click the box is checked.
I understand that it should be a lame problem, but nevertheless,  it would be very kinf of you if you help me!
Dimitrina
Telerik team
 answered on 08 Apr 2013
3 answers
881 views
Hello,

I am trying to two-way bind to a List<Stores> in order to pre-populate the auto suggest box and get its updated values. I tried using the following:

<telerik:RadAutoCompleteBox Name="radAutoCompleteBox1" Grid.Column="2" Grid.Row="0"
                            DataContext="{Binding DetailViewModel}"
                            SelectionMode="Multiple"
                            WatermarkContent="Type a name"
                            TextSearchMode="Contains"
                            ItemsSource="{Binding BookstoreLookup}"
                            DisplayMemberPath="ShortName"
                            TextSearchPath="ShortName"
                            AutoCompleteMode="Suggest"
                            SelectedItems="{Binding SelectedNoticeItem.Bookstores, Mode=TwoWay}"
                            />


However, I keep getting "Collection was of a fixed size" exceptions. I've tried no Mode too.

BookstoreLookup is an ObservableCollection<BookstoreModel> and SelectedNoticeItem.Bookstores is a List<BookstoreModel> (I also tried ObservableCollection).

Thanks for your help.

John
Vladi
Telerik team
 answered on 08 Apr 2013
4 answers
124 views
Hello,
I have a problem with the Q1 2013 version that was not in the previous, Q3 2012 SP1. I'm using Gridview with a GroupDescriptor 
, my gridview is in a telerik tabItem, when i switch from tabitem, and I'm back on my grid I have this error :


Column cannot be null
Nom du paramètre : newColumn

Stack Trace :

à Telerik.Windows.Controls.GridView.ColumnGroupDescriptor.OnColumnChanged(GridViewColumn oldColumn, GridViewColumn newColumn)
à Telerik.Windows.Controls.GridView.ColumnGroupDescriptor.OnColumnPropertyChanged(DependencyObject sender, DependencyPropertyChangedEventArgs args)
à System.Windows.DependencyObject.OnPropertyChanged(DependencyPropertyChangedEventArgs e)
à System.Windows.Freezable.OnPropertyChanged(DependencyPropertyChangedEventArgs e)
à System.Windows.DependencyObject.NotifyPropertyChange(DependencyPropertyChangedEventArgs args)
à System.Windows.DependencyObject.UpdateEffectiveValue(EntryIndex entryIndex, DependencyProperty dp, PropertyMetadata metadata, EffectiveValueEntry oldEntry, EffectiveValueEntry& newEntry, Boolean coerceWithDeferredReference, Boolean coerceWithCurrentValue, OperationType operationType)
à System.Windows.DependencyObject.InvalidateProperty(DependencyProperty dp, Boolean preserveCurrentValue)
à System.Windows.Data.BindingExpressionBase.Invalidate(Boolean isASubPropertyChange)
à System.Windows.Data.BindingExpression.TransferValue(Object newValue, Boolean isASubPropertyChange)
à System.Windows.Data.BindingExpression.ScheduleTransfer(Boolean isASubPropertyChange)
à MS.Internal.Data.ClrBindingWorker.NewValueAvailable(Boolean dependencySourcesChanged, Boolean initialValue, Boolean isASubPropertyChange)
à MS.Internal.Data.PropertyPathWorker.UpdateSourceValueState(Int32 k, ICollectionView collectionView, Object newValue, Boolean isASubPropertyChange)
à MS.Internal.Data.ClrBindingWorker.OnSourcePropertyChanged(Object o, String propName)
à MS.Internal.Data.PropertyPathWorker.OnPropertyChanged(Object sender, PropertyChangedEventArgs e)
à System.Windows.WeakEventManager.ListenerList`1.DeliverEvent(Object sender, EventArgs e, Type managerType)
à System.ComponentModel.PropertyChangedEventManager.OnPropertyChanged(Object sender, PropertyChangedEventArgs args)
à System.Collections.ObjectModel.ObservableCollection`1.OnPropertyChanged(PropertyChangedEventArgs e)
à System.Collections.ObjectModel.ObservableCollection`1.ClearItems()
à Telerik.Windows.Controls.GridViewColumnCollectionInternal.ClearItems()
à System.Collections.ObjectModel.Collection`1.Clear()
à Telerik.Windows.Controls.GridView.GridViewDataControl.TotalColumnRefresh()
à Telerik.Windows.Controls.GridView.GridViewDataControl.Grid_Loaded(Object sender, RoutedEventArgs e)
à System.Windows.RoutedEventHandlerInfo.InvokeHandler(Object target, RoutedEventArgs routedEventArgs)
à System.Windows.EventRoute.InvokeHandlersImpl(Object source, RoutedEventArgs args, Boolean reRaised)
à System.Windows.UIElement.RaiseEventImpl(DependencyObject sender, RoutedEventArgs args)
à System.Windows.UIElement.RaiseEvent(RoutedEventArgs e)
à System.Windows.BroadcastEventHelper.BroadcastEvent(DependencyObject root, RoutedEvent routedEvent)
à System.Windows.BroadcastEventHelper.BroadcastLoadedEvent(Object root)
à MS.Internal.LoadedOrUnloadedOperation.DoWork()
à System.Windows.Media.MediaContext.FireLoadedPendingCallbacks()
à System.Windows.Media.MediaContext.FireInvokeOnRenderCallbacks()
à System.Windows.Media.MediaContext.RenderMessageHandlerCore(Object resizedCompositionTarget)
à System.Windows.Media.MediaContext.RenderMessageHandler(Object resizedCompositionTarget)
à System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs)
à MS.Internal.Threading.ExceptionFilterHelper.TryCatchWhen(Object source, Delegate method, Object args, Int32 numArgs, Delegate catchHandler)
à System.Windows.Threading.DispatcherOperation.InvokeImpl()
à System.Windows.Threading.DispatcherOperation.InvokeInSecurityContext(Object state)
à System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
à System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
à System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
à System.Windows.Threading.DispatcherOperation.Invoke()
à System.Windows.Threading.Dispatcher.ProcessQueue()
à System.Windows.Threading.Dispatcher.WndProcHook(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
à MS.Win32.HwndWrapper.WndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
à MS.Win32.HwndSubclass.DispatcherCallbackOperation(Object o)
à System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs)
à MS.Internal.Threading.ExceptionFilterHelper.TryCatchWhen(Object source, Delegate method, Object args, Int32 numArgs, Delegate catchHandler)
à System.Windows.Threading.Dispatcher.LegacyInvokeImpl(DispatcherPriority priority, TimeSpan timeout, Delegate method, Object args, Int32 numArgs)
à MS.Win32.HwndSubclass.SubclassWndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam)
à MS.Win32.UnsafeNativeMethods.DispatchMessage(MSG& msg)
à System.Windows.Threading.Dispatcher.PushFrameImpl(DispatcherFrame frame)
à System.Windows.Threading.Dispatcher.PushFrame(DispatcherFrame frame)
à System.Windows.Threading.Dispatcher.Run()
à System.Windows.Application.RunDispatcher(Object ignore)
à System.Windows.Application.RunInternal(Window window)
à System.Windows.Application.Run(Window window)
à System.Windows.Application.Run()
à BaseCamp.App.Main() dans d:\ManagerEntrepriseVS\BaseCamp\BaseCamp\obj\Debug\App.g.cs:ligne 0

XAML Code :

<telerik:RadTabItem Header="{Binding Resource.PerSupplier}">
                              <telerik:RadGridView x:Name="QuotationDashBoardGrid"  ShowGroupPanel="true" AutoGenerateColumns="False"
                          ItemsSource="{Binding LstQuotationDashBoard, Mode=TwoWay}"  SelectedItem="{Binding SelectedQuotation, Mode=TwoWay}"
                          IsReadOnly="True" >
                                  <telerik:RadGridView.GroupDescriptors>
                                      <telerik:ColumnGroupDescriptor Column="{Binding Columns[SupplierColumn],ElementName=QuotationDashBoardGrid}"  SortDirection="Ascending" />
                                  </telerik:RadGridView.GroupDescriptors>
                                  <telerik:RadGridView.Columns>
                                      <telerik:GridViewImageColumn ImageHeight="17" ImageWidth="17"  DataMemberBinding="{Binding DiscountIndication,Converter={StaticResource QuotationToUri}}" Header="" />
                                      <telerik:GridViewDataColumn DataMemberBinding="{Binding CodeTarif}" Header="{Binding Resource.DiscountCode}" />
                                      <telerik:GridViewDataColumn DataMemberBinding="{Binding FamilleLibelle}" Header="{Binding Resource.DiscountLabel}" />
                                      <telerik:GridViewDataColumn DataMemberBinding="{Binding DisplayDiscount}"  Header="{Binding Resource.Discount}" />
                                      <telerik:GridViewDataColumn Header="{Binding Resource.Note}" DataMemberBinding="{Binding Note}"/>
                                      <telerik:GridViewDataColumn DataMemberBinding="{Binding DiscountDealName}" Header="{Binding Resource.DiscountDealName}" />
                                      <telerik:GridViewDataColumn DataMemberBinding="{Binding  OuContractedName}" Header="{Binding Resource.OU}" />
                                      <telerik:GridViewDataColumn DataMemberBinding="{Binding RootSupplierName}" UniqueName="SupplierColumn"  Header="{Binding Resource.Supplier}" />
                                       
 
                                  </telerik:RadGridView.Columns>
                          
                              </telerik:RadGridView>
                              </telerik:RadTabItem>

Without the GroupDescriptor, there is no problem.

Thanks in advance

Vera
Telerik team
 answered on 08 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?