Telerik Forums
UI for WPF Forum
1 answer
95 views
Hello.

In WPF RadTimeline First Look example (presidents list)
UpdateCurrentPage() method in ExampleViewModel.cs file has duplicate variable settings as below.

Is there any reason?

this.StartDate = startDate;
this.EndDate = endDate;
this.StartDate = startDate;
 
this.VisibleStartDate = startDate;
this.VisibleEndDate = endDate;
this.VisibleStartDate = startDate;


Petar Kirov
Telerik team
 answered on 28 Nov 2012
1 answer
63 views
is there a way to export the book or pages of the book to excel or pdf?
Tina Stancheva
Telerik team
 answered on 28 Nov 2012
1 answer
625 views
Hi,

I am using an AutoCompleteBox inside a RadDataForm template.The control ItemsSource is bound to an ObseravableCollcetion while the selected item is bound to a property on the window.

<DataTemplate x:Key="MyTemplate">
                    <Grid>
                        <Grid.RowDefinitions>
                            <RowDefinition/>
                            <RowDefinition/>
                            <RowDefinition/>
                            <RowDefinition/>
                            <RowDefinition/>
                            <RowDefinition/>
                            <RowDefinition/>
                        </Grid.RowDefinitions>
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition Width="200"/>
                            <ColumnDefinition Width="*"/>
                        </Grid.ColumnDefinitions>
                        <Label Content="Driver" Grid.Row="0"/>
                        <Label Content="Document Number" Grid.Row="1"/>
                        <Label Content="Issue Date" Grid.Row="2"/>
                        <Label Content="Expiry Date" Grid.Row="3"/>
                        <Label Content="Place of Issue" Grid.Row="4"/>
                        <Label Content="Document Type" Grid.Row="5"/>
                        <Label Content="Remarks" Grid.Row="6"/>
                        <telerik:RadAutoCompleteBox AutoCompleteMode="Suggest"
                                              
                                             TextSearchPath="FullName"   ItemsSource="{Binding Drivers,ElementName=DriverDocumentView1}"    Name="RadAutoCompleteBox"  SearchTextChanged="RadAutoCompleteBox_SearchTextChanged" TextSearchMode="Contains" SelectionMode="Single"  DisplayMemberPath="Name" SelectedItem="{Binding SelectedDriver,ElementName=DriverDocumentView1}" Grid.Column="1" Grid.Row="0"/>
                        <TextBox Text="{Binding Document.DocumentNo}" Grid.Row="1" Grid.Column="1"/>
                        <DatePicker SelectedDate="{Binding IssueDate}"  Grid.Row="2" Grid.Column="1"/>
                        <DatePicker SelectedDate="{Binding ExpiryDate}"  Grid.Row="3" Grid.Column="1"/>
                        <ComboBox ItemsSource="{Binding PlacesOfIssue,ElementName=DriverDocumentView1}" DisplayMemberPath="Text" SelectedValuePath="ID" SelectedValue="{Binding Document.PlaceOfIssueID}" Grid.Column="1" Grid.Row="4"/>
                        <ComboBox ItemsSource="{Binding DocumentTypes,ElementName=DriverDocumentView1}" DisplayMemberPath="Name" SelectedValuePath="ID" SelectedValue="{Binding Document.DocumentTypeID}" Grid.Column="1" Grid.Row="5"/>
                        <TextBox Text="{Binding Remarks}" Grid.Row="6" Grid.Column="1"/>                      
                    </Grid>
                        
 
 
                </DataTemplate>

private Driver selectedDriver;
       public Driver SelectedDriver
       {
           get { return selectedDriver; }
           set { selectedDriver = value; NotifyPropertyChanged("SelectedDriver"); }
       }

Now, the breakpoint I set in the 'set' part of the SelectedDriver property is not hit.I also find it to be null when sending the form data for saving:

private void SaveBTN_Click(object sender, RoutedEventArgs e)
        {
            if (RadDataForm.ValidateItem())
            {
                DriverDocument driverDocument = RadDataForm.CurrentItem.To<DriverDocument>();
                driverDocument.Document.CreationDate = DateTime.Now;
                driverDocument.Document.EntryByID = 178;
                driverDocument.Driver = SelectedDriver;
                RadDataForm.SubmitChanges();
 
            }
        }


Thanks

Madani
Vladi
Telerik team
 answered on 28 Nov 2012
1 answer
147 views
Error occurs when I switch between cells with key "Tab" :
Value cannot be null.
Parameter name: source

Stack Trace

   at System.Linq.Enumerable.Cast[TResult](IEnumerable source)
   at Telerik.Windows.Controls.GridViewBoundColumnBase.GetValidationErrors(Object dataItem, String propertyName) in c:\TB\135\WPF_Scrum\Current_HotFix\Sources\Controls\GridView\GridView\GridView\Columns\GridViewBoundColumnBase.cs:line 1579
   at Telerik.Windows.Controls.GridView.GridViewCell.<GetDataErrors>d__7.MoveNext() in c:\TB\135\WPF_Scrum\Current_HotFix\Sources\Controls\GridView\GridView\GridView\Cells\GridViewCell.cs:line 709
   at Telerik.Windows.Data.EnumerableExtensions.Count(IEnumerable source) in c:\TB\135\WPF_Scrum\Current_HotFix\Sources\Core\Data\Collections\EnumerableExtensions.cs:line 124
   at Telerik.Windows.Controls.GridView.GridViewCell.UpdateIsValidState() in c:\TB\135\WPF_Scrum\Current_HotFix\Sources\Controls\GridView\GridView\GridView\Cells\GridViewCell.cs:line 603
   at Telerik.Windows.Controls.GridView.GridViewCell.UpdateValue() in c:\TB\135\WPF_Scrum\Current_HotFix\Sources\Controls\GridView\GridView\GridView\Cells\GridViewCell.cs:line 1594
   at Telerik.Windows.Controls.GridView.GridViewCell.SetCellElement() in c:\TB\135\WPF_Scrum\Current_HotFix\Sources\Controls\GridView\GridView\GridView\Cells\GridViewCell.cs:line 522
   at Telerik.Windows.Controls.GridView.GridViewCell.HideEditor() in c:\TB\135\WPF_Scrum\Current_HotFix\Sources\Controls\GridView\GridView\GridView\Cells\GridViewCell.cs:line 818
   at Telerik.Windows.Controls.GridView.GridViewCell.ToggleEditor() in c:\TB\135\WPF_Scrum\Current_HotFix\Sources\Controls\GridView\GridView\GridView\Cells\GridViewCell.cs:line 1130
   at Telerik.Windows.Controls.GridView.GridViewDataControl.OnCellEditModeChanged(GridViewCell cell, Boolean newIsInEditMode) in c:\TB\135\WPF_Scrum\Current_HotFix\Sources\Controls\GridView\GridView\GridView\GridViewDataControl.Editing.cs:line 400
   at Telerik.Windows.Controls.GridView.GridViewCell.IsInEditModeChanged(DependencyObject target, DependencyPropertyChangedEventArgs e) in c:\TB\135\WPF_Scrum\Current_HotFix\Sources\Controls\GridView\GridView\GridView\Cells\GridViewCell.cs:line 1118
   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, Boolean coerceWithCurrentValue, OperationType operationType)
   at System.Windows.DependencyObject.SetValueCommon(DependencyProperty dp, Object value, PropertyMetadata metadata, Boolean coerceWithDeferredReference, Boolean coerceWithCurrentValue, OperationType operationType, Boolean isInternal)
   at System.Windows.DependencyObject.SetValue(DependencyProperty dp, Object value)
   at Telerik.Windows.Controls.GridView.GridViewCell.set_IsInEditMode(Boolean value) in c:\TB\135\WPF_Scrum\Current_HotFix\Sources\Controls\GridView\GridView\GridView\Cells\GridViewCell.cs:line 298
   at Telerik.Windows.Controls.GridView.GridViewCell.RaiseCellEditEndedEvent(GridViewEditAction editAction) in c:\TB\135\WPF_Scrum\Current_HotFix\Sources\Controls\GridView\GridView\GridView\Cells\GridViewCell.cs:line 1229
   at Telerik.Windows.Controls.GridView.GridViewDataControl.PerformCellEditEnded(GridViewCell currentCell) in c:\TB\135\WPF_Scrum\Current_HotFix\Sources\Controls\GridView\GridView\GridView\GridViewDataControl.Editing.cs:line 108
   at Telerik.Windows.Controls.GridView.GridViewDataControl.CommitCellEdit(GridViewCell currentCell, Boolean isLeavingRow) in c:\TB\135\WPF_Scrum\Current_HotFix\Sources\Controls\GridView\GridView\GridView\GridViewDataControl.Editing.cs:line 69
   at Telerik.Windows.Controls.GridView.GridViewDataControl.OnCurrentCellInfoChanging(GridViewCellInfo oldCell, GridViewCellInfo newCell) in c:\TB\135\WPF_Scrum\Current_HotFix\Sources\Controls\GridView\GridView\GridView\GridViewDataControl.cs:line 841
   at Telerik.Windows.Controls.GridView.GridViewDataControl.set_CurrentCellInfo(GridViewCellInfo value) in c:\TB\135\WPF_Scrum\Current_HotFix\Sources\Controls\GridView\GridView\GridView\GridViewDataControl.cs:line 803
   at Telerik.Windows.Controls.GridView.GridViewDataControl.BeginEdit(GridViewCell gridViewCell, RoutedEventArgs editingEventArgs) in c:\TB\135\WPF_Scrum\Current_HotFix\Sources\Controls\GridView\GridView\GridView\GridViewDataControl.Editing.cs:line 667
   at Telerik.Windows.Controls.GridView.GridViewDataControl.OnCellMouseDown(GridViewCell cell, MouseButtonEventArgs args) in c:\TB\135\WPF_Scrum\Current_HotFix\Sources\Controls\GridView\GridView\GridView\GridViewDataControl.Editing.cs:line 356
   at Telerik.Windows.Controls.GridView.GridViewCell.OnMouseLeftButtonDown(MouseButtonEventArgs e) in c:\TB\135\WPF_Scrum\Current_HotFix\Sources\Controls\GridView\GridView\GridView\Cells\GridViewCell.cs:line 418
   at System.Windows.UIElement.OnMouseLeftButtonDownThunk(Object sender, MouseButtonEventArgs e)
   at System.Windows.Input.MouseButtonEventArgs.InvokeEventHandler(Delegate genericHandler, Object genericTarget)
   at System.Windows.RoutedEventArgs.InvokeHandler(Delegate handler, Object target)
   at System.Windows.RoutedEventHandlerInfo.InvokeHandler(Object target, RoutedEventArgs routedEventArgs)
   at System.Windows.EventRoute.InvokeHandlersImpl(Object source, RoutedEventArgs args, Boolean reRaised)
   at System.Windows.UIElement.ReRaiseEventAs(DependencyObject sender, RoutedEventArgs args, RoutedEvent newEvent)
   at System.Windows.UIElement.OnMouseDownThunk(Object sender, MouseButtonEventArgs e)
   at System.Windows.Input.MouseButtonEventArgs.InvokeEventHandler(Delegate genericHandler, Object genericTarget)
   at System.Windows.RoutedEventArgs.InvokeHandler(Delegate handler, Object target)
   at System.Windows.RoutedEventHandlerInfo.InvokeHandler(Object target, RoutedEventArgs routedEventArgs)
   at System.Windows.EventRoute.InvokeHandlersImpl(Object source, RoutedEventArgs args, Boolean reRaised)
   at System.Windows.UIElement.RaiseEventImpl(DependencyObject sender, RoutedEventArgs args)
   at System.Windows.UIElement.RaiseTrustedEvent(RoutedEventArgs args)
   at System.Windows.UIElement.RaiseEvent(RoutedEventArgs args, Boolean trusted)
   at System.Windows.Input.InputManager.ProcessStagingArea()
   at System.Windows.Input.InputManager.ProcessInput(InputEventArgs input)
   at System.Windows.Input.InputProviderSite.ReportInput(InputReport inputReport)
   at System.Windows.Interop.HwndMouseInputProvider.ReportInput(IntPtr hwnd, InputMode mode, Int32 timestamp, RawMouseActions actions, Int32 x, Int32 y, Int32 wheel)
   at System.Windows.Interop.HwndMouseInputProvider.FilterMessage(IntPtr hwnd, WindowMessage msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
   at System.Windows.Interop.HwndSource.InputFilterMessage(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, Int32 numArgs)
   at MS.Internal.Threading.ExceptionFilterHelper.TryCatchWhen(Object source, Delegate method, Object args, Int32 numArgs, Delegate catchHandler)
Vera
Telerik team
 answered on 28 Nov 2012
1 answer
110 views
Is RaWindow a good candidate to function as a child window that cannot be dragged outside the confines of its parent's boundaries?

Similar to shadowbox-type functionality on websites when user input is required and parent is locked?  We'd like the user to still be able to drag/resize/minimize/etc the parent while the child window is controlling it.
George
Telerik team
 answered on 28 Nov 2012
9 answers
247 views
hello,

i am trying to set up a custom range on my y axis as our 'date' values are custom generated and do not work in the same way as normal dates or numeric values.

we have a situation where the chart would run along variable time levels, ie sometimes weeks, sometimes months, quarters, etc. the chart needs to plot these time members across the Y axis of a horizontal 2D Bar chart and display the values as such:

M201010       M201011       M201012     M201101 etc..

what we did to overcome the fact that we need a numeric value for the axis was to use only the numeric section of the chart and then set a min and max value (since we know the start and end date for the chart) but this works only as long as the values are for the same year, in this example 2010.

if the periods span over 2 years, ie from 2010 to 2011, the series stretches from M201012 all the way to M201099 before getting on to 2011, because it increments by one of course.

the chart is set up in the xaml as follows:

<telerik:RadChart Grid.Row="0" Grid.Column="0" x:Name="TimeRangeChart" ItemsSource="{Binding PhasingOptionList}" UseDefaultLayout="False" DataBound="TimeRangeChart_Loaded">
            <telerik:RadChart.Resources>
                <Style x:Key="CustomAxisTitleStyle" TargetType="telerik:AxisTitle">
                    <Setter Property="FontWeight" Value="Normal" />
                    <Setter Property="Margin" Value="0,0,10,0" />
                </Style>
                <Style x:Key="SeriesItemLabelStyle" TargetType="telerik:SeriesItemLabel">
                    <Setter Property="VerticalAlignment" Value="Center" />
                </Style>
                <Style x:Key="ItemLabelStyle" TargetType="TextBlock">
                    <Setter Property="HorizontalAlignment" Value="Left"/>
                    <Setter Property="Visibility" Value="Collapsed"/>                   
                </Style>
            </telerik:RadChart.Resources>
            <telerik:RadChart.SeriesMappings>
                <telerik:SeriesMapping ChartAreaName="ChartArea" >
                    <telerik:SeriesMapping.SeriesDefinition>
                        <telerik:HorizontalRangeBarSeriesDefinition ShowItemLabels="True" ItemLabelFormat="#OptionName - #ColourDescr"
                                                                    ShowItemToolTips="True" SeriesItemLabelStyle="{StaticResource SeriesItemLabelStyle}">                          
                            <telerik:HorizontalRangeBarSeriesDefinition.InteractivitySettings>
                                <telerik:InteractivitySettings SelectionMode="Single" SelectionScope="Item" HoverScope="Item"  />
                            </telerik:HorizontalRangeBarSeriesDefinition.InteractivitySettings>
                        </telerik:HorizontalRangeBarSeriesDefinition>
                    </telerik:SeriesMapping.SeriesDefinition>
                    <telerik:ItemMapping FieldName="ProposedSellTimeFromCodeNumeric" DataPointMember="Low" />
                    <telerik:ItemMapping FieldName="ProposedSellTimeToCodeNumeric" DataPointMember="High" />
                    <telerik:ItemMapping FieldName="OptionNo" DataPointMember="XCategory" />
                </telerik:SeriesMapping>
            </telerik:RadChart.SeriesMappings>
            <Grid>
                <Grid.RowDefinitions>
                    <RowDefinition Height="*"/>
                </Grid.RowDefinitions>
                <telerik:ChartArea Grid.Row="0" x:Name="ChartArea" NoDataString="" LabelFormatBehavior="None"
                                   ItemClick="ChartArea_ItemClick" ItemToolTipOpening="ChartArea_ItemToolTipOpening"
                                    PaletteBrushesRepeat="False" EnableAnimations="False" >
                    <telerik:ChartArea.ZoomScrollSettingsX>
                        <telerik:ZoomScrollSettings ScrollMode="ScrollAndZoom" MinZoomRange="0.005"/>
                    </telerik:ChartArea.ZoomScrollSettingsX>
                    <telerik:ChartArea.PaletteBrushes>
                        <SolidColorBrush Color="#FF74A6E2"/>
                    </telerik:ChartArea.PaletteBrushes>
                    <telerik:ChartArea.AxisY>
                        <telerik:AxisY Title="{Binding BottomTimePeriodDescription}" ExtendDirection="Up" DefaultLabelFormat="{Binding TimeValueLabelFormat}"
                                        MinValue="{Binding FromWeekNumeric}" MaxValue="{Binding ToWeekNumeric}" AutoRange="False"
                                        LabelRotationAngle="-45" MinorTicksVisibility="Hidden">
                            <telerik:AxisY.AxisStyles>
                                <telerik:AxisStyles TitleStyle="{StaticResource CustomAxisTitleStyle}" ItemLabelStyle="{StaticResource ChartAxisTextStyle}" />
                            </telerik:AxisY.AxisStyles>
                        </telerik:AxisY>
                    </telerik:ChartArea.AxisY>
                    <telerik:ChartArea.AxisX>
                        <telerik:AxisX LayoutMode="Inside" MinorTicksVisibility="Collapsed" MajorTicksVisibility="Collapsed"  >
                            <telerik:AxisX.AxisStyles>
                                <telerik:AxisStyles ItemLabelStyle="{StaticResource ItemLabelStyle}" />
                            </telerik:AxisX.AxisStyles>
                        </telerik:AxisX>
                    </telerik:ChartArea.AxisX>
                </telerik:ChartArea>               
            </Grid>
        </telerik:RadChart>


is there a way to get around this?

thanks,
Nemanja
Nemanja
Top achievements
Rank 1
 answered on 28 Nov 2012
3 answers
263 views
I show a message box in cellvalidating event to show the error message as a Messagebox..

It usually work ok, but if i use the TAB key to move out of the field, the event fire twice (so the message box show twice... )


A sample project is attached to the support ticket #384333
http://www.telerik.com/account/support-tickets/view-ticket.aspx?threadid=384333
Yordanka
Telerik team
 answered on 28 Nov 2012
2 answers
267 views
Hi There,
I am using the RadPane and RadDocumentPane in my application, can you please tell me what is difference between them ?

Regards,
Srinivas.

Ravi
Top achievements
Rank 1
 answered on 28 Nov 2012
4 answers
193 views
Hi, I am attempting to add a custom line or custom grid line annotation to my RadChart. I need to make the line dashed, but do so completely in c#, not using any XAML styles. How would I do this?

Also, how would I add my annotation to my legend, completely in code. I saw the example:
http://www.telerik.com/help/wpf/radchart-how-to-add-annotations-in-chart-legend.html, but that uses XAML styles, and I can't do that.

How would I ensure that the annotation appears in front of the data series? I.E. the bars for the bar chart are behind the annotation.

And finally, how would I add labels to annotations, again, in c# code only.
Petar Kirov
Telerik team
 answered on 27 Nov 2012
6 answers
182 views

This is based on the most recent build we have (downloaded this morning, RadControls_for_WPF_2011_3_1116_Dev_hotfix)

 

When we import a  file in docx format, and do a MailMerge() call, the fields merging appears to work perfectly, except that the style (or ‘format’ in MS Word parlance) is not maintained. Whether it’s bold, underlined, different font, different colour, it doesn’t matter, the text that is merged into that field always goes in with what appears to be the default RadDocument/RichTextDocument format (Verdana, 12 pt).

I’ve not been able to find any properties or anything that seem to indicate that merged values will override the styles/formats of the merge fields they’re replacing. It doesn’t appear as if it’s respecting the “Preserve formatting during updates” setting from MS Word

This is the code being used:

 

private RadDocument MergeDataFieldsWithDocument(RadDocument radDocument)

        {

 

            var mergeFieldsAndValues = DeriveValuesToMergeWithDocumentFields();

 

            radDocument.MailMergeDataSource.ItemsSource = mergeFieldsAndValues;

            return radDocument.MailMerge(false);

        }

 

        private static List<object> DeriveValuesToMergeWithDocumentFields()

        {

            return new List<object>

                       {

                           new

                               {

                                  DATE_TODAY = "test"

                               }

                       };

        }

How can we make it so that the merge fields use the correct format?

Thanks,

Brock

Petya
Telerik team
 answered on 27 Nov 2012
Narrow your results
Selected tags
Tags
+? more
Top users last month
Jay
Top achievements
Rank 3
Iron
Iron
Iron
Benjamin
Top achievements
Rank 3
Bronze
Iron
Veteran
Radek
Top achievements
Rank 2
Iron
Iron
Iron
Bohdan
Top achievements
Rank 2
Iron
Iron
Richard
Top achievements
Rank 4
Bronze
Bronze
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Jay
Top achievements
Rank 3
Iron
Iron
Iron
Benjamin
Top achievements
Rank 3
Bronze
Iron
Veteran
Radek
Top achievements
Rank 2
Iron
Iron
Iron
Bohdan
Top achievements
Rank 2
Iron
Iron
Richard
Top achievements
Rank 4
Bronze
Bronze
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?