Telerik Forums
UI for WPF Forum
1 answer
142 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
275 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
310 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
329 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
223 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
220 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
3 answers
304 views

Hi, I use the following code to overwrite the FilteringControl

public class ContainsFilteringControl: FilteringControl
    {
        public override void Prepare(GridViewColumn gridViewColumn)
        {
            base.Prepare(gridViewColumn);
  
            var vm = DataContext as FilteringViewModel;
  
            if (vm == null) return;
              
            if (!vm.Filter1.IsActive)
            {
                vm.Filter1.Operator = FilterOperator.Contains;
            }
  
            if (!vm.Filter2.IsActive)
            {
                vm.Filter2.Operator = FilterOperator.Contains;
            }
        }
  
    }

Then, in the code behind of the view,

public MyWindow(MyViewModel viewModel)
{
      DataContext = viewModel;
      this.radGrid.Columns[2].FilteringControl = new ContainsFilteringControl();
 }

After recompile and run the application, the filter changes to Contains.

However, when the filter is opened first time, the text boxes below the filter dropdowns are not shown.

When the filter window is opended the second time, the text boxes will appear.

Anything I can do to fix this?

Thanks
Rossen Hristov
Telerik team
 answered on 27 Nov 2012
1 answer
141 views
hi
i implement  Radtoolbar with basic functions but only copy undo and  cut commands are working . the others editingcommans and applicationcommand arn't working  sush as EditingCommands.DecreaseFontSize or increase
could you give me an example to implement it.
thanks by advance
Pavel R. Pavlov
Telerik team
 answered on 27 Nov 2012
4 answers
178 views
Hello,

I'm using internal build 2012.3.1017.40 and it seems the GridView is using the wrong locale (en-US instead of de-DE) when DataFormatString is applied to cells. Currency values are formatted as "$100.00" instead of "100,00 €". Is there a new configuration I have to set up or is it an issue with this build? I need to use the internal build because I'm using the WPF ReportViewer as well and there is that mean printing bug in the main release.

Kind regards
Markus
Markus Wolff
Top achievements
Rank 1
 answered on 27 Nov 2012
1 answer
418 views
I came across the need to be able to sort my ObservableCollections the other day and I found a nice code snippet demonstrating how to sort an ObservableCollection even if the collection type does not support IComparable. I added the ReverseCompare/Descending sort just in case. Anyhow thought it was a neat piece of code and hope it may help some others out there.

Enjoy!

public static class CollectionSorter  
    {  
        public static void Sort<T>(this ObservableCollection<T> collection, Comparison<T> comparison)  
        {  
            var comparer = new Comparer<T>(comparison);  
 
            List<T> sorted = collection.OrderBy(x => x, comparer).ToList();  
 
            for (int i = 0; i < sorted.Count(); i++)  
                collection.Move(collection.IndexOf(sorted[i]), i);  
        }  
 
        public static void DescendingSort<T>(this ObservableCollection<T> collection, Comparison<T> comparison)  
        {  
            var comparer = new ReverseComparer<T>(comparison);  
 
            List<T> sorted = collection.OrderBy(x => x, comparer).ToList();  
 
            for (int i = 0; i < sorted.Count(); i++)  
                collection.Move(collection.IndexOf(sorted[i]), i);  
        }       
    }  
 
    internal class Comparer<T> : IComparer<T>  
    {  
        private readonly Comparison<T> comparison;  
 
        public Comparer(Comparison<T> comparison)  
        {  
            this.comparison = comparison;  
        }
        #region IComparer<T> Members  
 
        public int Compare(T x, T y)  
        {  
            return comparison.Invoke(x, y);  
        }
        #endregion  
    }  
 
    internal class ReverseComparer<T> : IComparer<T>  
    {  
        private readonly Comparison<T> comparison;  
 
        public ReverseComparer(Comparison<T> comparison)  
        {  
            this.comparison = comparison;  
        }
        #region IComparer<T> Members  
 
        public int Compare(T x, T y)  
        {  
            return -comparison.Invoke(x, y);  
        }
        #endregion  
    } 

then you can use it on your ObservableCollections as such. 
private void Log(LogEntry log)  
        {  
            LoggedEvents.Add(log);  
            LoggedEvents.DescendingSort((x, y) => x.TimeStampString.CompareTo(y.TimeStampString));  
        }        
 
        private ObservableCollection<LogEntry> entries = new ObservableCollection<LogEntry>();  
        public ObservableCollection<LogEntry> LoggedEvents  
        {  
            get 
            {                  
                return entries;  
            }  
            set 
            {  
                entries = value;  
                RaisePropertyChanged(LoggedProperty);  
            }  
        } 
Jonas
Top achievements
Rank 1
 answered on 27 Nov 2012
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
DataPager
PersistenceFramework
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
Chester
Top achievements
Rank 1
Iron
Simon
Top achievements
Rank 1
Iron
Douglas
Top achievements
Rank 2
Iron
Iron
SUNIL
Top achievements
Rank 3
Iron
Iron
Iron
Marco
Top achievements
Rank 3
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Chester
Top achievements
Rank 1
Iron
Simon
Top achievements
Rank 1
Iron
Douglas
Top achievements
Rank 2
Iron
Iron
SUNIL
Top achievements
Rank 3
Iron
Iron
Iron
Marco
Top achievements
Rank 3
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?