Telerik Forums
UI for WPF Forum
6 answers
222 views

In winform demos, it use FastLineSeries and have nice fps, very smooth.

how can i do it in wpf?

Si
Top achievements
Rank 1
 answered on 15 Dec 2018
1 answer
292 views
Hi, I'm currently using Radsplitcontainer, radpanegroup and radpane and I'm having a problem with settings which of the tab in the radpanegroup should be active. I got two viewmodels, and I want to use a bool to make the tabs active according to which ViewModel event that is invoking. How can I do this?

Because I'm using a gridView, and by selecting an item in the grid, I the tab to be active depending on which gridview I'm selecting an item on. This mean that I'll have 2 gridviews, and the radpane is supposed to be a tab window that shows the details of the item selected.

<telerik:RadPaneGroup TabStripPlacement="Top" telerik:ProportionalStackPanel.RelativeSize="100,300" >
                        <telerik:RadPane Header="{Binding viewModel1.Title, Mode=TwoWay}" CanUserClose="False" CanDockInDocumentHost="True" >
                            <ScrollViewer HorizontalScrollBarVisibility="Auto" VerticalScrollBarVisibility="Auto">
                                <ContentControl Content="{Binding viewModel1}"
    ContentTemplate="{StaticResource ViewEditorTemplate1}" />
                            </ScrollViewer>
                        </telerik:RadPane>
                        <telerik:RadPane Header="{Binding viewModel2.Title}" CanUserClose="False" CanDockInDocumentHost="True" telerik:ProportionalStackPanel.RelativeSize="200, 100" >
                            <ScrollViewer HorizontalScrollBarVisibility="Auto" VerticalScrollBarVisibility="Auto">
                                <ContentControl Content="{Binding viewModel2}"
                                                ContentTemplate="{StaticResource ViewEditorTemplate1}"/>
                            </ScrollViewer>
                        </telerik:RadPane>
                    </telerik:RadPaneGroup>
Vladimir Stoyanov
Telerik team
 answered on 14 Dec 2018
11 answers
932 views
The focus events for the RadRichTextBox don't appear to be firing correctly.  There's a number of issues, which I'll list in turn.  We need to do things according to whether the control has the focus or not, and currently its unexpected behaviour is causing us a lot of problems.

For the purpose of reproducing the behaviour, simply place a RadRichTextBox control on a view, and handle its GotFocus and LostFocus events with the following event handlers, which will write to Visual Studio's Output window so you can see that they've been called.

private void RadRichTextBoxEx_LostFocus(object sender, RoutedEventArgs e)
{
    Console.WriteLine("LostFocus");
}
 
private void RadRichTextBoxEx_GotFocus(object sender, RoutedEventArgs e)
{
    Console.WriteLine("GotFocus");
}


#1 - Clicking the mouse anywhere within the control fires the events

Let's say the RadRichTextbox control has the focus.  Clicking the mouse anywhere within the control fires the LostFocus and GotFocus events twice, with the following output in the VS Output window:

LostFocus
GotFocus
LostFocus
GotFocus

I would expect neither the LostFocus not the GotFocus events to be fired, as the control already has the focus.

If the control doesn't have the focus and you click in it (giving it the focus), then the following events are currently raised:

GotFocus
LostFocus
GotFocus

In this situation, I would expect only the first GotFocus event to be raised.

NOTE: I have tried handling the KeyboardGotFocus/KeyboardLostFocus events, and they behave the same way.

#2 - Clicking on a control that doesn't take focus, still fires these events

Let's say the RadRichTextBox control has the focus, and you click on a different control that doesn't steal the focus from the RadRichTextBox control, such as a ribbon button (note, we aren't using the Telerik ribbon currently, but that shouldn't matter).  Doing so fires the events like so:

LostFocus
GotFocus

The expected behaviour is that neither of those events should be called.

#3 - When overriding the RadRichTextBox control, neither the OnGotFocus, nor the OnLostFocus methods fire

While this is not really an issue for me, I tried overriding the RadRichTextBox control to add my own behaviour to it, and found that if I override the OnGotFocus and OnLostFocus methods, they never get called.  Something maybe to look at as part of this problem.

Please note that all these scenarios have been tried on a plan TextBox control, and it fires its GotFocus/LostFocus events as per my expected behaviour described.  Therefore, I would expect the RadRichTextBox control to behave in the same manner.

Thanks

Chris Anderson
Boby
Telerik team
 answered on 14 Dec 2018
3 answers
262 views

Hello,

In our application we are using a few separator that are used to resize the two panels (right & left), those two panels contain GridViews. It used to work perfectly but when switching to .NET 4.7.2 (from 4.5.2), this resizing causes the app to freeze entirely. Removing the GridView controls seems to fix the issue, hence why I think there is something wrong with the GridView (or one of the Windows API its using)

Now, the issue only seems to happen on a specific hardware and some kind of setup. An easy way to reproduce it is (in our case) to run the app on the main screen on a Lenovo E580 laptop. We are currently running WPF 2018 R2, but upgrading to R3 doesn't fix the issue.

I was simply wondering, before I open a bug and build a test app to show the error, if you were aware of an issue with the GridView (or other Telerik control for that matter) when running .NET 4.7.2?

 

Best Regards,

Bastian

Vladimir Stoyanov
Telerik team
 answered on 14 Dec 2018
3 answers
189 views

Hello,

is there a way to get the list of visible rows of a grid in the order, as they appear on the screen (respect sorting, filtering, pinning)?

Best regards,
Thomas

Dinko | Tech Support Engineer
Telerik team
 answered on 14 Dec 2018
8 answers
598 views
Hi,
    Is there any way to save a RadBarcodeQR to binary or image? Then I could use it on a report until telerik reports support QR codes.

Thanks
Dinko | Tech Support Engineer
Telerik team
 answered on 14 Dec 2018
1 answer
368 views

I have a RadGridView, in the first column is an AutoCompleteBox for searching articles in every row and the other GridViewDataColumn's get filled by the Information of the chosen article in the AutoCompleteBox.

I have build the RadGridView with AutoCompleteBox like this:

 

                        <telerik:RadGridView.Columns>
                            <telerik:GridViewDataColumn
                    x:Name="ArtikelNr"
                    Header="Artikel-/Materialsuche"
                    Width="Auto"
                    MinWidth="150"                                      
                    IsReadOnly="True"
                    IsGroupable="True"
                    IsFilterable="True">
                                <telerik:GridViewDataColumn.CellStyle>
                                    <Style TargetType="{x:Type telerik:GridViewCell}">
                                        <Setter Property="Template">
                                            <Setter.Value>
                                                <ControlTemplate TargetType="{x:Type telerik:GridViewCell}">
                                                    <telerik:RadAutoCompleteBox  x:Name="AutoCompleteBox_ArtikelNr" DropDownItemTemplate="{StaticResource                                                                            CustomAutoCompleteBoxItemTemplate1}"
                                                    ItemsSource="{Binding DataContext.ArtikelAuswahl, RelativeSource={RelativeSource AncestorType={x:Type                                                                                   telerik:RadGridView}}}"
                                                    SelectedItem="{Binding RadAutoCompleteBoxArtikel_SelectedItem, Mode=TwoWay}"
                                                    SelectionChanged="AutoCompleteBoxArtikel_SelectionChanged"
                                                    FilteringBehavior="{StaticResource ArtikelSucheFilteringBehavior}"
                                                    DisplayMemberPath="ArtikelNr"
                                                    TextSearchMode="Contains"
                                                    MaxDropDownHeight="400" 
                                                    DropDownWidth="1000"
                                                    WatermarkContent="Suche..."
                                                    HorizontalAlignment="Stretch"
                                                    AutoCompleteMode="Suggest"
                                                    SelectionMode="Single"/>
                                                </ControlTemplate>
                                            </Setter.Value>
                                        </Setter>
                                    </Style>
                                </telerik:GridViewDataColumn.CellStyle>
                            </telerik:GridViewDataColumn>

… 

I fill the Columns with Information I seleced in the AutoCompleteBox like this:

        private void AutoCompleteBoxArtikel_SelectionChanged(object sender, SelectionChangedEventArgs e)
        {
            if (e.AddedItems.Count > 0)
            {
                if (currentTabellenDaten != null)
                {
                    //int rowIndex = this.radGridView1.Items.IndexOf(this.radGridView1.SelectedItem);
                    //rowIndex = rowIndex + 1;
                    TabellenDaten geladeneTabellenDaten = new TabellenDaten();
                    bool ok = MainViewModel.TabellenDatenController.LoadTabellenDaten(((Artikel)e.AddedItems[0]).ArtikelNr, geladeneTabellenDaten);
                    currentTabellenDaten.ArtikelNr = geladeneTabellenDaten.ArtikelNr;
                    currentTabellenDaten.ArtikelBez1 = geladeneTabellenDaten.ArtikelBez1;
                    currentTabellenDaten = null;
                    this.radGridView1.CommitEdit();
                    geladeneTabellenDaten = null;
                }

}

My Problem is, that I can't get the Row index of the Current edited AutoCompleteBox(I tried like in the Code commented out but doesn't work), so when I want to edit a Row that already has some Information (selecting an other article in the AutoCompleteBox) , the new Information should be written in the same Row.

 

Is it possible with my type of implemetation of the AutoCompleteBox in the RadGridView?

Is there an other or better way to have an AutoCompleteBox in the RadGridview?

 

I hope you can understand my Problem and I'm sorry for my bad english skills.

 

Dilyan Traykov
Telerik team
 answered on 14 Dec 2018
4 answers
189 views

Hi,

 

I'm looking to get custom tooltips for the "X"'s in the search, as well as add a watermark in the search textbox.

I'm not seeing any properties for this int he XAML...please advise.

 

Barry

Barry
Top achievements
Rank 1
 answered on 13 Dec 2018
4 answers
306 views
Hi,
I have a question regarding red calendar days(special days). There are video tutorials for winforms and silverlight which use red calendar days. Unfortunately I couldn't find a collection of Special Days in the WPF RadCalendar Control property section in Visual Studio 2008.
How can I bind a DateCollection as Special Days to the RadCalendar Control?

Thanks in advance

tWand
arman
Top achievements
Rank 1
 answered on 12 Dec 2018
3 answers
493 views

I use RadNumericUpDown in many places.  My application runs on a PC and on the Microsoft Surface and uses the Windows8Touch theme. 
 
My problem is that whenever the user clicks the + or - button of a RadNumericUpDown the edit control receives keyboard focus which I do not want and cannot seem to prevent.  Why is this a problem?  Because on the MS Surface, this causes the Windows Virtual Keyboard to appear, immediately obscuring the very control the user is using.  The user isn't trying to edit the text box, mind you, just tapping the buttons.

If the the user is only tapping the buttons, it seems that the edit box should not get focus.  That should not happen until you actually try to *type* in it.   But even if you think it *should* get focus, there at least needs to be a way to prevent it from happening.  Yet I cannot find any way short of completely retemplating the control.
 
Here is what I tried:

1. I tried to setting the entire RadNumericControl's IsEditable property to "False" but this has no effect.  Even though the user cannot edit the box, clicking the '+' or '-' button *still* makes the edit control think it is being edited enough to give it focus and force that virtual keyboard to appear

2. Then I tried setting the entire control's "Focusable" property to "False" but that didn't work either.  The internal edit control still gets keyboard focus.  This is because the Telerik template for the control fails to pass the "Focusable" to its internal edit through TemplateBinding. 

The only way I've managed to "fix" this is by completely copying the entire RadNumericUpDown control's template and making it pass "Focusable" to its internal edit via the TemplateBinding.  Then I use this template for my RadNumericUpDown and set its Focusable property to false.

But this is serious  overkill and my copied template is not using the Telerik Windows8Touch theme that I applied to everything else.  So it looks out of place and terrible.  It appears I can copy a whole bunch of stuff from the Telerik-installed XAML for that theme, but that's even more overkill than before. 

So my questions are these:

1. Am I missing some simpler method here?  Does RadNumericUpDown give me a way to get at the internal edit control and prevent it from getting keyboard focus short of copying its entire template?  

2. Also, am I correct that it's internal edit should NOT get keyboard focus if you just tap the buttons (at least if it's not editable)?

I am hoping you can point me to an easier way.  

Martin Ivanov
Telerik team
 answered on 12 Dec 2018
Narrow your results
Selected tags
Tags
+? more
Top users last month
Will
Top achievements
Rank 2
Iron
Motti
Top achievements
Rank 1
Iron
Hester
Top achievements
Rank 1
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Thomas
Top achievements
Rank 2
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Will
Top achievements
Rank 2
Iron
Motti
Top achievements
Rank 1
Iron
Hester
Top achievements
Rank 1
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Thomas
Top achievements
Rank 2
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?