Telerik Forums
UI for WPF Forum
11 answers
2.1K+ views
Hello,

I have a standard WPF MainWindow, from that I open a modal RadWindow (using .ShowDialog()). When the user clicks on one button I close the dialog and open a new non-modal RadWindow:

ConfigurationComparerWindow comparerWindow = new ConfigurationComparerWindow() { Owner = Application.Current.MainWindow, };
comparerWindow.Show();
//comparerWindow.Closed += (s, a) => { Application.Current.MainWindow.Focus(); };

This works just fine.

But if the user closes the second window I would expect that the MainWindow receives the focus. Instead the MainWindow is sent to back. If I uncomment the Closed event handler it works as I expected.

What is the preferred way of doing this?

Thanks,
   Zoltan
karim
Top achievements
Rank 1
 answered on 03 Aug 2016
5 answers
405 views

 

I have below rich text,

{\rtf1\ansi\ansicpg1252\deff0\deflang1033{\fonttbl{\f0\fnil\fcharset0 Times New Roman;}{\f1\fnil\fcharset0 Tahoma;}}
\viewkind4\uc1\pard\protect\f0\fs22 This is protected text\protect0\f1\fs16\par
}

It contains "\protect" tag which indicates the text between this tag is protected and cant be edited.

But when I bind this RTF to RadRichTextBox, it displays the text correctly. But it loses the protection. It does not make the text read-only.

How to make this text read-only?

Parag
Top achievements
Rank 1
 answered on 03 Aug 2016
2 answers
94 views

Dear support,

we are facing rather often but nevertheless unpredictably the problem that the mail merge functionality produces identical documents. This is the part of code

01.public static IList<object> GetMailMergeBinaryResultDocuments
02.                     (byte[] source, IEnumerable mailMergeDataSource)
03.{
04.  if (mailMergeDataSource == null)
05.  {
06.    throw new ArgumentNullException("mailMergeDataSource");
07.  }
08. 
09.  RadDocument masterDocument = XamlFormatProvider.Import(source);
10.  masterDocument.MailMergeDataSource.ItemsSource = mailMergeDataSource;
11.  RadDocumentEditor radDocumentEditor = new RadDocumentEditor(masterDocument);
12. 
13.  radDocumentEditor.ChangeAllFieldsDisplayMode(FieldDisplayMode.Result);
14. 
15.  List<object> resultDocuments = new List<object>();
16.  masterDocument.MailMergeDataSource.MoveToFirst();
17. 
18.  do
19.  {
20.    resultDocuments.Add(masterDocument.MailMergeCurrentRecord());
21.  }
22.  while (masterDocument.MailMergeDataSource.MoveToNext());
23. 
24.  return resultDocuments;
25.}

 

where we know that different mail merge information was passed but for some reason was not processed correctly.

Can you help?

 

Regards   Jo

Joachim
Top achievements
Rank 1
 answered on 03 Aug 2016
3 answers
108 views

I have a problem when using the tab key.

When I run the code below and press the tab key repeatedly displays error messages:

"Object reference not set to an instance of an object."

Step run => tab tab tab => exception

<Window x:Class="DockingException.MainWindow"
        xmlns:local="clr-namespace:DockingException"
        xmlns:telerikDocking="clr-namespace:Telerik.Windows.Controls;assembly=Telerik.Windows.Controls.Docking"
        mc:Ignorable="d"
        Title="MainWindow" Height="350" Width="525">
    <Grid>
        <telerikDocking:RadDocking  RetainPaneSizeMode="DockingAndFloating" >
            <telerikDocking:RadDocking.CompassStyle>
                <Style TargetType="telerik:Compass">
                    <Setter Property="IsCenterIndicatorVisible" Value="false" />
                    <Setter Property="IsLeftIndicatorVisible" Value="false" />
                    <Setter Property="IsRightIndicatorVisible" Value="false" />
                    <Setter Property="IsTopIndicatorVisible" Value="false" />
                    <Setter Property="IsBottomIndicatorVisible" Value="False" />
                </Style>
            </telerikDocking:RadDocking.CompassStyle>
            <telerik:RadDocking.RootCompassStyle>
                <Style TargetType="telerik:RootCompass">
                    <Setter Property="IsTopIndicatorVisible" Value="false" />
                    <Setter Property="IsLeftIndicatorVisible" Value="false" />
                    <Setter Property="IsRightIndicatorVisible" Value="false" />
                    <Setter Property="IsBottomIndicatorVisible" Value="True" />
                </Style>
            </telerik:RadDocking.RootCompassStyle>
            <!--MainContent-->
            <telerik:RadDocking.DocumentHost>
                <Grid >
                </Grid>
            </telerik:RadDocking.DocumentHost>
            <!--/MainContent-->
            <telerik:RadSplitContainer InitialPosition="DockedBottom" Height="500" >
                <telerik:RadPaneGroup>
                    <telerik:RadPane IsHidden="True" IsPinned="True" CanUserPin="False" PaneHeaderVisibility="Collapsed" CanUserClose="False">
                       
                    </telerik:RadPane>
                </telerik:RadPaneGroup>
            </telerik:RadSplitContainer>
        </telerikDocking:RadDocking>
    </Grid>
</Window>

Geri
Telerik team
 answered on 03 Aug 2016
11 answers
445 views
Hi,

is there any easy way to show arrows on a mapline? The alignment should be centered.
Please have a look on my attached example delivery_network.png.

Maybe could caluclate the mid point of two geo coordinates and attach a custom node, but how could i bind the transformation to the edge line?

<telerik:RadMap Provider="{Binding MapProvider}" Center="{Binding Center}">
    <telerik:InformationLayer ItemsSource="{Binding Edges}">
        <telerik:InformationLayer.ItemTemplate>
            <DataTemplate>
                <telerik:MapLine Point1="{Binding SourceLocation}" Point2="{Binding TargetLocation}" Stroke="Black" StrokeThickness="2" />
            </DataTemplate>
        </telerik:InformationLayer.ItemTemplate>
    </telerik:InformationLayer>
    <telerik:InformationLayer ItemsSource="{Binding Nodes}">
        <telerik:InformationLayer.ItemTemplate>
            <DataTemplate>
                <Border Background="Transparent" telerik:MapLayer.Location="{Binding Location}">
                    <ToolTipService.ToolTip>
                        <ToolTip>
                            <ToolTip.Content>
                                <TextBlock Text="{Binding DisplayLocation}" />
                            </ToolTip.Content>
                        </ToolTip>
                    </ToolTipService.ToolTip>
                    <telerik:MapLayer.HotSpot>
                        <telerik:HotSpot X="0.5" Y="0.5" ElementName="Ellipse"/>
                    </telerik:MapLayer.HotSpot>
                    <Grid>
                        <Ellipse Fill="{Binding Fill}" Width="15" Height="15" x:Name="Ellipse" />
                        <TextBlock Text="{Binding Name}" Foreground="{Binding Foreground}" FontSize="14" FontWeight="Bold" Margin="0 0 0 50" />
                    </Grid>
                </Border>
            </DataTemplate>
        </telerik:InformationLayer.ItemTemplate>
    </telerik:InformationLayer>
</telerik:RadMap>

I've found something similar but it doesn't really help me because binding inside geometry group or segments is not supported.
http://www.telerik.com/community/forums/wpf/map/custom-mapshape.aspx

Thanks for your help.
Renier Pretorius
Top achievements
Rank 2
Iron
Iron
Iron
 answered on 03 Aug 2016
1 answer
91 views

Hi there.

I'm trying with no success at the moment, to implement a simple PRISM application who uses a RadRibbonView. The complexity resides basically in the command being defined as a member of a ViewModel that belongs to a MODULE of this PRISM application:

 

Prism application contains:

 

Shell, with a RadRibbonView containing a RadRibbonButton with a command called AddNewEmployee

EmployeeModule, with a RadGridView whose DataContext is EmployeeViewModel

EmployeeViewModel, defines an AddNewEmployee command.

So, AddNewEmployee command must be called on RadRibbonView, who knows nothing (pretty much like Jon Snow) of the model used in the EmployeeModule.

 

p.s.: modules are being loaded using RadRibbonTabs, and in the first tab, theres the button who calls the AddNewEmployee command.

Question is: this can be achieved? it is possible?

regards,

 

Gonzalo.

Kiril Vandov
Telerik team
 answered on 03 Aug 2016
7 answers
343 views

Hi,

I have a Telerik Rad Cartesian Spline Curve Chart where X axis Categorical axis and Y Axis is numerical. Currently the values of X Axis Labels are like eg 0,1,2,3....

On Mouse hover over the labels on Categorical X Axis I want to display a tool tip which represent some string corresponding to 0,1,2 accordingly.

eg: 0=> Apple

       1=> Orange etc

How do I acheive this?

 

Regards,

Shilpa

Shilpa
Top achievements
Rank 1
 answered on 03 Aug 2016
2 answers
234 views

I upgraded my Telerik version from 2014.1.331.45 to 2016.2.606.45. RadTreeView Multiple selection mode was working just fine with the older version, multiple selection is applied only when using Ctrl and/or Shift key (as expected). But after upgrading, RadTreeView is applying multiple selection without clicking Ctrl or Shift key, which is strange. The code is the same before and after upgrading:

<telerik:RadTreeView x:Name="lstVariables" Padding="5" BorderThickness="0" Grid.Row="0" ScrollViewer.CanContentScroll="False" IsEditable="True" SelectionMode="Multiple" ItemsSource="{Binding LstAppDataSeriesGrouping}" IsDropPreviewLineEnabled="False" IsDragPreviewEnabled="True" IsDragTooltipEnabled="False"  telerik:TreeViewSettings.DragDropExecutionMode="New" IsLineEnabled="True" IsSingleExpandPath="False" IsExpandOnSingleClickEnabled="True" IsDragDropEnabled="True"
KeyDown="lstVariables_KeyDown" ItemTemplateSelector="{StaticResource ItemDataTemplateSelector}">
                            <telerik:RadContextMenu.ContextMenu>
                                <telerik:RadContextMenu x:Name="radContextMenu"  Opened="radContextMenuBasic_Opened">
                                    <telerik:RadMenuItem x:Name="mnuEditVariableBasic" Height="23" Header="{Lang:LangCheck Edit}" Click="EditBasicVariable_Click">
                                        <telerik:RadMenuItem.Icon>
                                            <Image Source="{DynamicResource editseries}"/>
                                        </telerik:RadMenuItem.Icon>
                                    </telerik:RadMenuItem>
                                    <telerik:RadMenuItem x:Name="mnuDelete" Height="23" Header="{Lang:LangCheck Delete}" Click="mnuDeleteBasic_Click">
                                        <telerik:RadMenuItem.Icon>
                                            <Image Source="{DynamicResource delete}"/>
                                        </telerik:RadMenuItem.Icon>
                                    </telerik:RadMenuItem>
                                    <telerik:RadMenuItem x:Name="mnuRename" Height="23" Header="{Lang:LangCheck Rename}" Click="mnuRenameBasic_Click">
                                        <telerik:RadMenuItem.Icon>
                                            <Image Source="{DynamicResource rename}"/>
                                        </telerik:RadMenuItem.Icon>
                                    </telerik:RadMenuItem>
                                </telerik:RadContextMenu>
                            </telerik:RadContextMenu.ContextMenu>
                        </telerik:RadTreeView>

Adnan
Top achievements
Rank 1
 answered on 03 Aug 2016
1 answer
67 views

hello,when I load diagram use code like this:

                    StreamReader streamReader = new StreamReader(diagramXmlFile);
                    string data = streamReader.ReadToEnd();
                    streamReader.Close();
                    this.ProjectImageDiagram.Load(data);

                    RadDocumentPane diagramPane = new RadDocumentPane();
                    DataTemplate doctabTemplate = (DataTemplate)CRWindow.TryFindResource("doctab");
                    StackPanel docTab = (StackPanel)doctabTemplate.LoadContent();
                   diagramPane.Header = docTab;
                   UserControl diagramUserControl = new UserControl(diagram, true);
                   diagramPane.Content = diagramUserControl;

And I add diagramPane to RadDocking-DocumentHost-RadSplitContainer-RadPaneGroup, but when I run the program and open this pane, I find that the diagram is zoom in first, and then zoom out to fit the window,why?   Hope to answer, Thanks !

Peshito
Telerik team
 answered on 02 Aug 2016
1 answer
74 views

Hi,

We are using custom page presenters (from FixedDocumentPresenterBase),

We have updated the telerik dlls to the last version (2016.2.613) since then we are unable to see our pdfs correctly using the pdfviewer with our custom presenters.

Only the first page is displayed, the other ones are all blank.

Works fine with the default page presenter.

I think that it could be related to a new page caching optimization that has been implemented.

Is there a way to be able to use it in our custom page presenters or maybe a way to disable it ?

Regards,

 

Mihail
Telerik team
 answered on 02 Aug 2016
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
Book
FileDialogs
ToolBar
ColorPicker
TimePicker
SyntaxEditor
MultiColumnComboBox
VirtualGrid
Wizard
ExpressionEditor
NavigationView (Hamburger Menu)
DesktopAlert
WatermarkTextBox
BarCode
SpellChecker
DataServiceDataSource
EntityFrameworkDataSource
RadialMenu
ChartView3D
Data Virtualization
BreadCrumb
ProgressBar
Sparkline
LayoutControl
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
Rating
SplashScreen
Accessibility
Callout
CollectionNavigator
Localization
AutoSuggestBox
Security
VirtualKeyboard
HighlightTextBlock
TouchManager
StepProgressBar
Badge
OfficeNavigationBar
ExpressionParser
CircularProgressBar
SvgImage
PipsPager
SlideView
AI Coding Assistant
+? more
Top users last month
Rob
Top achievements
Rank 3
Bronze
Iron
Iron
Sergii
Top achievements
Rank 1
Iron
Iron
Dedalus
Top achievements
Rank 1
Iron
Iron
Lan
Top achievements
Rank 1
Iron
Doug
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Top users last month
Rob
Top achievements
Rank 3
Bronze
Iron
Iron
Sergii
Top achievements
Rank 1
Iron
Iron
Dedalus
Top achievements
Rank 1
Iron
Iron
Lan
Top achievements
Rank 1
Iron
Doug
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?