Telerik Forums
UI for WPF Forum
4 answers
87 views

Hi,

I have an advanced MVVM scenario with a GridView hosting an ObservableCollection via ItemsSource. The grid has some complicated editing scenarios, and in one case, I need to replace an object in my collection (due to a conversion where the underlying object needs to be converted to a different type). After the underlying object is replaced, the grid is updated as expected. The problem is that I want to preserve focus on the cell that was being edited, so the user can keep typing to continue editing.

This seems to work fine if it's the first row being edited. I have tried hooking into the RowEditEnded event and using grid.ScrollIntoViewAsync() or cell.Focus() without any success.

Please can someone provide any advice?

Thanks!

KWUN WA
Top achievements
Rank 1
 answered on 03 Aug 2016
1 answer
87 views

Hello,

I get StackOverflowException when I try to insert fragment to document and call InsertFragment function from RadRichTextBox. The error is not stable, sometimes everything works.

I attach a file with my list (please, rename it in .txt).

Can you help me? What's wrong with that?

Thanks in advance.

Tanya
Telerik team
 answered on 03 Aug 2016
11 answers
2.0K+ 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
391 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
85 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
104 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
422 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
85 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
322 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
220 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
Narrow your results
Selected tags
Tags
+? more
Top users last month
Rob
Top achievements
Rank 3
Iron
Iron
Iron
Atul
Top achievements
Rank 1
Iron
Iron
Iron
Alexander
Top achievements
Rank 1
Veteran
Iron
Serkan
Top achievements
Rank 1
Iron
Shawn
Top achievements
Rank 1
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Rob
Top achievements
Rank 3
Iron
Iron
Iron
Atul
Top achievements
Rank 1
Iron
Iron
Iron
Alexander
Top achievements
Rank 1
Veteran
Iron
Serkan
Top achievements
Rank 1
Iron
Shawn
Top achievements
Rank 1
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?