Telerik Forums
UI for WPF Forum
11 answers
1.8K+ views

Our application has a form with multiple wide WatermarkTextboxes (and other textbox-like controls, e.g. MaskedDateTimeInput) in a grid layout. Most of them are single-line but some might become multiline, if the user enters long texts. The attached screenshot shows the form region where the problem becomes the most apparent.

Since each textbox, by default, has its own ScrollViewer that swallows all incoming scroll events, scrolling the main form via mouse wheel becomes pretty much impossible.

Browsers, such as Firefox, circumvent this issue by bubbling scroll events to the parent, whenever the child scrollviewer reaches its end. We could add this kind of workaround via an attached behavior but as our form is quite large, this would become ugly really soon. Is there any better solution and if not, would this be something that can be made possible in a future release?

 

 

 

 

 

 

 

 

 

 

 

Simon
Top achievements
Rank 1
 answered on 21 Sep 2020
6 answers
2.1K+ views

Good Day.

 

Is there a way the have the WatermarkTextBox accept multi line text including next lines? I dont want to use the RadRichTextBox as it looks much complicated the what I needed. I just need a simple multi line textbox.

 

Also, I noticed that with WatermarkTextBox, It does not set the caret to the end of the text when I input a long text. As a result, it only displays the first part of the long text when typing. I already set the property  SelectionOnFocus to CaretToEnd.

It only shows the expected behavior when I navigate to the end of the text then type again

gerardo
Top achievements
Rank 1
Veteran
 answered on 20 Sep 2020
3 answers
399 views

Hello,

I'm using: Telerik 2019.1.116.45

1. I'm looking to display code in a read only view.  I have found the RichTextBox API for insert code block and I like the formatting and key word coloring for the CSharp setting.  I am wondering how can I interact with the Codeblock through MVVM, instead of calling the insert code api.  

 

2.  I have found that it takes a bit of time to load when the code is perhaps around 60-70 lines.  Any way/settings I can set to increase the speed?

Tanya
Telerik team
 answered on 18 Sep 2020
3 answers
369 views

Hello 

I am trying to migrate a WPF app to PRISM 7. 

The MainWindow (Shell) is a RadRibbonWindow, hence it doe not migrate as it seems it is not of type Window.

I followed the instructions highlighted here (https://docs.telerik.com/devtools/wpf/knowledge-base/kb-radwindow-prismapplication-createshell), but I am missing a critical piece of information.

- Where do I find the "TelerikShell" type? Which dll, out of the many Telerik dlls that comes with WPF?

Also, if you have a working sample application that used PRISM 7 that you can sher would appreciate it.

 

Thanks

Herald

Dilyan Traykov
Telerik team
 answered on 18 Sep 2020
16 answers
1.1K+ views
Is it possible to use a separate TextBox for the full text search? I'd would like to put the search text box in a toolbar on the UI.

Thanks,
Richard
Dilyan Traykov
Telerik team
 answered on 18 Sep 2020
1 answer
166 views
Hello,

during our development process we've been facing some problems with
one of your products (RadTimeline for WPF).

Situation:
Using the RadTimeline in WPF we have been trying to display expandable/collapsible timeline items,
the general idea is that each timeline item consists of a label and a RadExpander which contains a list of additional information, the size of the list varies from each timeline item to the next.

And while the timeline items themselves work as intended, their positioning on the timeline doesn’t.

While all items are collapsed, their positioning on the timeline is correct,
but when one or more items are expanded, the positioning of these items gets inconsistent,
with some items overlapping others and/or items moving down horizontally.
The hight of the timeline itself seems to increase disproportionally when items are expanded, even if there would have been enough place for them to be displayed on the timeline without its height being increased.

We would like to know if it is possible for timeline items to have different sizes,
And should this not be supported by the RadTimeline out of the box,
is there a way to modify the behaviour based on which the items are positioned on the timeline.
Dilyan Traykov
Telerik team
 answered on 18 Sep 2020
1 answer
186 views
Hi,

Our application have predefined document variables and we put these variables inside documents. Some of the variables contains singleline text but some of them have multiline text. For multiline text we add \v vertical tab for line break. When we add line break RadRichTextBox UI shows as we expected.
For example we added a text "Progress Telerik\vVertical Tab Test Second Line\vThird Line" and RadRichTextBox UI shows as

Progress Telerik
Vertical Tab Test Second Line
Third Line

But when we exported these xaml file as xaml format, final xaml file is not the same as shown in RadRichTextBox UI. The last line repeated for all the lines. Exported xaml file repeates "Third Line" line as shown below.


<t:Paragraph TextAlignment="Center">
  <t:FieldRangeStart AnnotationID="1">
    <t:DocumentVariableField DateTimeFormatting="" DisplayMode="Result" GeneralFormatting="" NumericFormatting="" VariableName="D_ALICI" />
  </t:FieldRangeStart>
  <t:Span BaselineAlignment="Baseline" FontFamily="Times New Roman" FontSize="16" FontStyle="Normal" FontWeight="Bold" ForeColor="#FF000000" HighlightColor="#00FFFFFF" Strikethrough="False" Text="Third Line" ThemeForeColorShade="" ThemeForeColorTint="" ThemeUnderlineColorShade="" ThemeUnderlineColorTint="" UnderlineColor="#FF000000" UnderlineDecoration="None" />
  <t:Break BreakType="LineBreak" Text="¬" />
  <t:Span BaselineAlignment="Baseline" FontFamily="Times New Roman" FontSize="16" FontStyle="Normal" FontWeight="Bold" ForeColor="#FF000000" HighlightColor="#00FFFFFF" Strikethrough="False" Text="Third Line" ThemeForeColorShade="" ThemeForeColorTint="" ThemeUnderlineColorShade="" ThemeUnderlineColorTint="" UnderlineColor="#FF000000" UnderlineDecoration="None" />
  <t:Break BreakType="LineBreak" Text="¬" />
  <t:Span BaselineAlignment="Baseline" FontFamily="Times New Roman" FontSize="16" FontStyle="Normal" FontWeight="Bold" ForeColor="#FF000000" HighlightColor="#00FFFFFF" Strikethrough="False" Text="Third Line" ThemeForeColorShade="" ThemeForeColorTint="" ThemeUnderlineColorShade="" ThemeUnderlineColorTint="" UnderlineColor="#FF000000" UnderlineDecoration="None" />
  <t:FieldRangeEnd AnnotationID="1" />
</t:Paragraph>


How can we solve this problem?

You can download sample application and final xaml file from  https://we.tl/t-KYQh8XpGfF

Martin
Telerik team
 answered on 16 Sep 2020
3 answers
1.0K+ views
Hello,

I am working on an MVVM application.I have in view a ListBox which is bound to an ObservableDictionary in VM as follows:

C# VM:

private ObservableDictionary<string, bool> mCategories;
public ObservableDictionary<string, bool> Categories
{
get { return mCategories; }
set { mCategories = value; FirePropertyChanged("Categories"); }
}

Categories = new ObservableDictionary<string, bool>()
{
{ "Allgemein", true},
{ "Dampf", false},
{ "Fernwärme", false},
{ "Prozessabhängig", false},
{ "Stromverbrauch", false}
};



XAML VIEW:

<telerik:RadListBox ItemsSource="{Binding Categories}">
    <telerik:RadListBox.ItemTemplate>
        <DataTemplate>
            <StackPanel Orientation="Horizontal">
                <CheckBox IsChecked="{Binding Value, Mode=TwoWay}"/>
                <TextBlock Text="{Binding Key, Mode=OneWay}"/>
            </StackPanel>
        </DataTemplate>
    </telerik:RadListBox.ItemTemplate>
</telerik:RadListBox>



I have the following problem: Binding seems not to work in the direction View to VM, that when I check a Checkbox the Value of the corresponding dictionary element will not be set to true, while it works in the other direction (VM to View) that when I set the Value of a dictionary elemnt in C# code (VM) the CheckBx is checked in View.

Any suggestion?

Thanks
Dilyan Traykov
Telerik team
 answered on 15 Sep 2020
5 answers
261 views

Hi,

I'm using  grid.SelectedItems.Add(row); in a loop to select rows on a grid. However sometimes I need to select 10,000+ rows and this can take over 15 seconds. I have tired .AddRange() but that takes the same amount of time. 

Is there a faster way to select items, especially with a very large number of rows?

Thanks,

Richard

Dilyan Traykov
Telerik team
 answered on 15 Sep 2020
7 answers
357 views

Hello,

I don't get any rows displayed when filtering with popup mode, grouping with drag&drop and sorting either by clicking on the column header or programatically.

And I get all my rows back when clearing filter/grouping/sorting either directly on the UI or programatically. Could you please help me?

 

Designer.xaml

<telerik:RadGridView x:Name="AttributesTable" ItemsSource="{Binding Path=Items}" RowDetailsVisibilityMode="Collapsed"
                             ScrollViewer.CanContentScroll="False" AutoGenerateColumns="False" CanUserSortColumns="True"
                             Sorting="AttributesTable_Sorting" PreparedCellForEdit="AttributesTable_PreparedCellForEdit"
                             CellEditEnded="AttributesTable_CellEditEnded"
                             FilteringMode="Popup" IsFilteringAllowed="True" MouseLeftButtonDown="AttributesTable_MouseLeftButtonDown"
                             FieldFilterEditorCreated="OnRadGridViewFieldFilterEditorCreated">
            <telerik:RadGridView.Columns>
                <telerik:GridViewDataColumn>
                    <telerik:GridViewDataColumn.CellTemplate>
                        <DataTemplate>
                            <Button Style="{StaticResource NoChromeButton}" Command="{base:XamlRoot Path=DataContext.Navigate}" CommandParameter="{Binding}">
                                <Image Source="/STTAR;component/Resources/Object_Globe_16xLG.png" ToolTip="{base:ResX ResKey=CenterMapToolTip}"/>
                            </Button>
                        </DataTemplate>
                    </telerik:GridViewDataColumn.CellTemplate>
                </telerik:GridViewDataColumn>
            </telerik:RadGridView.Columns>
        </telerik:RadGridView>

 

Code.cs

columns = (this.DataContext as AttributesTableViewModel)?.Columns;
items = (this.DataContext as AttributesTableViewModel)?.Items;
DynAdapter = (this.DataContext as AttributesTableViewModel)?.DynAdapter;

if (columns.Count == 0)
{
    var temp = AttributesTable.Columns[0];
    AttributesTable.Columns.Clear();
    AttributesTable.Columns.Add(temp);
    return;
}
 
var alreadyInsertedColsNames = (from col in (AttributesTable.Columns as ObservableCollection<GridViewColumn>).Where(col => col.DisplayIndex != 0) select col.Header as string).ToList();
var colsNames = (from col in columns select col.DisplayName).ToList();
var notInsertedColsNames = colsNames.Except(alreadyInsertedColsNames).ToList();
var toRemoveColsNames = alreadyInsertedColsNames.Except(colsNames).ToList();
 
if (notInsertedColsNames.Count > 0)
    foreach (string colName in notInsertedColsNames)
    {
        FeatureAttribute selectedCol = columns.Where(col => col.DisplayName == colName).FirstOrDefault();
        var gridViewColumn = new GridViewDataColumn();
 
        switch (selectedCol.Name)
        {
            case FeatureAttributes.Cost:
                string costUnit = String.Format(" ({0})", DynAdapter.Project.Settings.CurrencyCode);
                gridViewColumn.Header = selectedCol.DisplayName + costUnit;
                break;
            case FeatureAttributes.Length:
                string lengthUnit = " (m)";
                gridViewColumn.Header = selectedCol.DisplayName + lengthUnit;
                break;
            case FeatureAttributes.Id:
            case FeatureAttributes.Source:
            case FeatureAttributes.Support:
                gridViewColumn.IsReadOnly = true;
                gridViewColumn.Header = selectedCol.DisplayName;
                break;
            default:
                gridViewColumn.Header = selectedCol.DisplayName;
                break;
        }
 

                       // GetBindingStringForAttribute returns ".[propertyName]"

        gridViewColumn.DataMemberBinding = new Binding(GetBindingStringForAttribute(selectedCol));
        gridViewColumn.FilterMemberPath = GetBindingStringForAttribute(selectedCol);
        gridViewColumn.FilterMemberType = selectedCol.DataType;
        gridViewColumn.DataType = selectedCol.DataType;
        gridViewColumn.ShowDistinctFilters = false;
        gridViewColumn.CellTemplateSelector = (DataTemplateSelector)GridContainer.Resources["CellTemplateSelector"];
        gridViewColumn.CellEditTemplateSelector = (DataTemplateSelector)GridContainer.Resources["CellEditTemplateSelector"];
        AttributesTable.Columns.Add(gridViewColumn);
    }
 
    foreach (string toRem in toRemoveColsNames)
    {
        var colToRemove = (AttributesTable.Columns as ObservableCollection<GridViewColumn>)
        .FirstOrDefault(col => col.Header == toRem);
        if (AttributesTable.Columns.Contains(colToRemove))
            AttributesTable.Columns.Remove(colToRemove);
    }
Vladimir Stoyanov
Telerik team
 answered on 15 Sep 2020
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
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
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?