Telerik Forums
UI for WPF Forum
1 answer
339 views

Hello.

I've written a similar post before. 

At that time, there was not much warning output, so I didn't care.
But if I get a lot of Resource not found output, I've seen the design load slowly.

Also, the warning didn't come up when I made a general sample project.
When I use it as a module in another program, it happens.

I used [Row Number] of GridView for Telerik Demo.
I used an implicit style and found this in CellStyle.

 

The GirdViewCell implicit style is as follows, and all warnings are printed for the ResourceKey of telerik1.

    <Style x:Key="GridViewCellStyle" TargetType="grid:GridViewCell">
        <Setter Property="Template" Value="{StaticResource GridViewCellTemplate}"/>
        <Setter Property="FontSize" Value="{telerik1:FluentResource ResourceKey=FontSize}"/>
        <Setter Property="FontFamily" Value="{telerik1:FluentResource ResourceKey=FontFamily}"/>
        <Setter Property="Background" Value="Transparent"/>
        <Setter Property="BorderBrush" Value="{telerik1:FluentResource ResourceKey=BasicSolidBrush}"/>
        <Setter Property="SelectedBackground" Value="{telerik1:FluentResource ResourceKey=PressedBrush}"/>
        <Setter Property="CurrentBorderBrush" Value="{telerik1:FluentResource ResourceKey=IconBrush}"/>
        <Setter Property="MouseOverBackground" Value="{telerik1:FluentResource ResourceKey=MouseOverBrush}"/>
        <Setter Property="Padding" Value="5 0"/>
        <Setter Property="VerticalContentAlignment" Value="Center"/>
        <Setter Property="HorizontalContentAlignment" Value="Stretch"/>
        <Setter Property="SnapsToDevicePixels" Value="True"/>
        <Setter Property="FocusVisualStyle" Value="{StaticResource FocusVisualStyle}"/>
    </Style>

 

 

If this is used, the above warning of the image is output.

<behaviour:GridViewRowNumber.CellStyle>
    <Style TargetType="telerik:GridViewCell" BasedOn="{StaticResource GridViewCellStyle}">
	<Setter Property="Background" Value="LightGray"/>
	<Setter Property="TextBlock.TextAlignment" Value="Center"/>
    </Style>
</behaviour:GridViewRowNumber.CellStyle>

 

However, if you find a property in an implicit style for this warning output and wrap it in style, it does not appear.

<behaviour:GridViewRowNumber.CellStyle>
    <Style TargetType="telerik:GridViewCell" BasedOn="{StaticResource GridViewCellStyle}">
	<Setter Property="Background" Value="LightGray"/>
	<Setter Property="TextBlock.TextAlignment" Value="Center"/>
	<Setter Property="FontSize" Value="12"/>
	<Setter Property="FontFamily" Value="Segoe UI"/>
	<Setter Property="BorderBrush" Value="Transparent"/>
	<Setter Property="SelectedBackground" Value="Transparent"/>
	<Setter Property="CurrentBorderBrush" Value="Transparent"/>
	<Setter Property="MouseOverBackground" Value="Transparent"/>
    </Style>
</behaviour:GridViewRowNumber.CellStyle>


The explanation was a bit long.

Here I want to know two things.

first. When the program crashes and opens a window, is there a way to find and apply the implicit style again?
When loading the program, all styles are read, but when the window is opened, it is assumed that the warning will not occur if read again.

second. If there is no solution, please tell me where to set ValidationBrush, PrimaryBackgroundBrush, and FocusThickness.

 

Thanks.

Psyduck
Top achievements
Rank 5
Bronze
Bronze
Bronze
 updated answer on 25 Jun 2021
3 answers
168 views

We have documents that use RadDocumentPane and we serialize them on shutdown so we can restore them when the application restarts. The problem is that floating windows don't get their titles set.

While the application is running, forms can be dragged outside and left floating, then redocked and the titles work fine. The issue occurs after startup and the forms are restored from deserialization, floating windows end up with no title. Redocking them works but the tab has no text.

From what I can see of the XAML there are no errors reported for binding to Header or Title, yet the same code works for docked windows but not for floating windows.

Pete
Top achievements
Rank 2
Iron
Iron
Iron
 answered on 24 Jun 2021
1 answer
819 views

WPF I am using Radgridview inside having so many group headers, how to merge a particular cell in a row by index of the column. If have any example project pls post here.

 

 

 

 

Thanks & Regards

Murugansilvers

Vladimir Stoyanov
Telerik team
 answered on 24 Jun 2021
1 answer
683 views

Hello,

I use RadRichTextBox and HtmlFormatProvider to render HTML string and faced issue, when Unicode hex character code "&#x200b;" is rendered like "È€b;"
Is it possible to fix it?

Input HTML string fragment:

<span>&#x200b;</span>
Expected: Zero Width Space.
Actual rendering:
Dimitar
Telerik team
 answered on 24 Jun 2021
1 answer
420 views

Hi

I am using Telerik.Windows.Documents.Flow.FormatProviders.Pdf.PdfFormatProvider() to convert a word document(.docx) to pdf.

This takes a lot of time and gives system out of memory exception when the number of pages in the word document is more than 500.

 

Below is the code snippet:

using (Stream input = new FileStream("temp.docx"), FileMode.Open))

                {
                    var providerDocx = new Telerik.Windows.Documents.Flow.FormatProviders.Docx.DocxFormatProvider();
                    var document = providerDocx.Import(input);

                    var providerPdf = new Telerik.Windows.Documents.Flow.FormatProviders.Pdf.PdfFormatProvider();

                    Stream outStream = new MemoryStream();
                    providerPdf.Export(document, outStream);

                    var fileStream = File.Create("temp.pdf");
                    outStream.Seek(Constants.Int0, SeekOrigin.Begin);
                    outStream.CopyTo(fileStream);
                    fileStream.Close();
                }

 

Please suggest a solution to this or any other alternative which takes less time and memory.

 

Dimitar
Telerik team
 answered on 24 Jun 2021
1 answer
264 views

Downloading and running the WPF UI demo gives an error. Installer log shows:

The following properties have been set:
Property: [AdminUser] = true {boolean}
Property: [InstallMode] = HomeSite {string}
Property: [ProcessorArchitecture] = AMD64 {string}
Property: [VersionNT] = 6.2.0 {version}
Running checks for package 'Windows Installer 4.5', phase BuildList
Looking up path for special folder 'WindowsFolder'
Running check with folder 'C:\Windows\System32' and file 'msi.dll'
Attempting to find file 'C:\Windows\System32\msi.dll'
File version is '5.0.19041.928'
Setting value '5.0.19041.928 {version}' for property 'VersionMsiDll'
The following properties have been set for package 'Windows Installer 4.5':
Property: [VersionMsiDll] = 5.0.19041.928 {version}
Running checks for command 'WindowsInstaller4_5\WindowsXP-KB942288-v3-x86.exe'
Result of running operator 'VersionGreaterThanOrEqualTo' on property 'VersionMsi' and value '4.5': true
Result of checks for command 'WindowsInstaller4_5\WindowsXP-KB942288-v3-x86.exe' is 'Bypass'
Running checks for command 'WindowsInstaller4_5\WindowsXP-KB958655-v2-x86-ENU.exe'
Result of running operator 'VersionGreaterThanOrEqualTo' on property 'VersionMsiDll' and value '4.5.6001.22299': true
Result of checks for command 'WindowsInstaller4_5\WindowsXP-KB958655-v2-x86-ENU.exe' is 'Bypass'
Running checks for command 'WindowsInstaller4_5\WindowsServer2003-KB942288-v4-x86.exe'
Result of running operator 'VersionGreaterThanOrEqualTo' on property 'VersionMsi' and value '4.5': true
Result of checks for command 'WindowsInstaller4_5\WindowsServer2003-KB942288-v4-x86.exe' is 'Bypass'
Running checks for command 'WindowsInstaller4_5\WindowsServer2003-KB958655-v2-x86-ENU.exe'
Result of running operator 'VersionGreaterThanOrEqualTo' on property 'VersionMsiDll' and value '4.5.6001.22299': true
Result of checks for command 'WindowsInstaller4_5\WindowsServer2003-KB958655-v2-x86-ENU.exe' is 'Bypass'
Running checks for command 'WindowsInstaller4_5\WindowsServer2003-KB942288-v4-x64.exe'
Result of running operator 'VersionGreaterThanOrEqualTo' on property 'VersionMsi' and value '4.5': true
Result of checks for command 'WindowsInstaller4_5\WindowsServer2003-KB942288-v4-x64.exe' is 'Bypass'
Running checks for command 'WindowsInstaller4_5\WindowsServer2003.WindowsXP-KB958655-v2-x64-ENU.exe'
Result of running operator 'VersionGreaterThanOrEqualTo' on property 'VersionMsiDll' and value '4.5.6001.22299': true
Result of checks for command 'WindowsInstaller4_5\WindowsServer2003.WindowsXP-KB958655-v2-x64-ENU.exe' is 'Bypass'
Running checks for command 'WindowsInstaller4_5\Windows6.0-KB958655-v2-x86.MSU'
Result of running operator 'VersionGreaterThanOrEqualTo' on property 'VersionMsiDll' and value '4.5.6001.22308': true
Result of checks for command 'WindowsInstaller4_5\Windows6.0-KB958655-v2-x86.MSU' is 'Bypass'
Running checks for command 'WindowsInstaller4_5\Windows6.0-KB958655-v2-x64.MSU'
Result of running operator 'VersionGreaterThanOrEqualTo' on property 'VersionMsiDll' and value '4.5.6001.22308': true
Result of checks for command 'WindowsInstaller4_5\Windows6.0-KB958655-v2-x64.MSU' is 'Bypass'
'Windows Installer 4.5' RunCheck result: No Install Needed
Launching Application.
URLDownloadToCacheFile failed with HRESULT '-2146697208'
Error: An error occurred trying to download 'https://demos.telerik.com/wpf/WPF%20Demos.application'.
Dilyan Traykov
Telerik team
 answered on 24 Jun 2021
2 answers
223 views

Hello.

 

It will be easier to understand if you refer to the image.
The user wants to independently enable the navigation item according to the user's selection.

My example created a structure like that, but it doesn't work.

Is there any good way?

 

Thanks.

 

p.s - In combination with the above functions, can I control A and B Views with Enable at the same time by adding a C Button(True/False)?

Dinko | Tech Support Engineer
Telerik team
 answered on 24 Jun 2021
1 answer
314 views
I have a data-driven application architecture and my expectation is that MultipleSelectionBoxTemplate shares the same DataContext as the parent RadComboBox because it does not apply to any particular item. This is very confusing.
Martin Ivanov
Telerik team
 answered on 23 Jun 2021
1 answer
183 views

Is it possible to remove RadDiagramShape-Connectos at runtime (I've created my own shape-class: BaseNodeShape : RadDiagramShape)?

If I'm calling Connectors.Clear(), the connectors are not removed from the shape, do I need to start/end editing or something like that?

I'm creating connectors like that, since the code is called multiple times, I also need to remove old connectors. But old connectors just stay in ths shape.


/// <summary>
        /// Creates connectors and calls LoadConnectorText method
        /// </summary>
        public virtual void CreateConnectors()
        {
            if (ViewModel?.DataPins == null || ViewModel?.FlowPins == null)
                return;

            int longestTextLength = 0;
            
            FlowConnectors?.Clear();
            DataConnectors?.Clear();
            Connectors?.Clear();
            
            // Fill connector list
            foreach (var pin in ViewModel.DataPins)
            {
                var dataConnector = new DataConnector(pin.Name, pin.DisplayName,
                    pin.PinDirection == PinDirectionDefinition.In ? ConnectorDirection.In : ConnectorDirection.Out,
                    pin.DataConnectorType, pin.IsGeneric, pin.AllowedTypes)
                {
                    DataContext = pin
                };
                
                DataConnectors.Add(dataConnector);

                if (dataConnector.Name.Length > longestTextLength)
                    longestTextLength = dataConnector.Name.Length;
            }

            foreach (var pin in ViewModel.FlowPins)
            {
                var flowConnector = new FlowConnector(pin.Name, pin.DisplayName,
                    pin.PinDirection == PinDirectionDefinition.In ? ConnectorDirection.In : ConnectorDirection.Out)
                {
                    DataContext = pin
                };

                FlowConnectors.Add(flowConnector);

                if (flowConnector.Name.Length > longestTextLength)
                    longestTextLength = flowConnector.Name.Length;
            }

            var headerWidth = 15 + (ViewModel.DisplayName.Length * 8);
            var totalLineWidth = longestTextLength * 10;

            if (headerWidth < totalLineWidth)
                ViewModel.Width = totalLineWidth;
            else
                ViewModel.Width = headerWidth;

            if (ViewModel.Width < 50)
                ViewModel.Width = 50;

            const double heightPerDataPin = 20;
            const double heightPerFlowPin = 20;
            const double baseHeight = 35;

            var flowInPinCount = FlowConnectors.Count(x => x.ConnectorDirection == ConnectorDirection.In);
            var dataInPinCount = DataConnectors.Count(x => x.ConnectorDirection == ConnectorDirection.In);
            var flowOutPinCount = FlowConnectors.Count(x => x.ConnectorDirection == ConnectorDirection.Out);
            var dataOutPinCount = DataConnectors.Count(x => x.ConnectorDirection == ConnectorDirection.Out);

            if ((flowInPinCount * heightPerFlowPin + dataInPinCount * heightPerDataPin) > (flowOutPinCount * heightPerFlowPin + dataOutPinCount * heightPerDataPin))
            {
                var flowPinsHeight = heightPerFlowPin * flowInPinCount;
                var dataPinsHeight = heightPerDataPin * dataInPinCount;
                ViewModel.Height = baseHeight + flowPinsHeight + dataPinsHeight + 5;
            }
            else
            {
                var flowPinsHeight = heightPerFlowPin * flowOutPinCount;
                var dataPinsHeight = heightPerDataPin * dataOutPinCount;
                ViewModel.Height = baseHeight + flowPinsHeight + dataPinsHeight + 5;
            }

            double heightOffset = (35 / ViewModel.Height);
            double rowMargin = (18 / ViewModel.Height);
            double xLeft = (8 / ViewModel.Width); // 0.04;
            double xRight = 1 - xLeft;
            double yTop = heightOffset;

            foreach (var flowConnector in FlowConnectors
                .Where(connector => connector.ConnectorDirection == ConnectorDirection.In))
            {
                flowConnector.Offset = new Point(xLeft, yTop);
                this.Connectors.Add(flowConnector);
                yTop += rowMargin;                
            }

            foreach (var dataConnector in DataConnectors
                .Where(connector => connector.ConnectorDirection == ConnectorDirection.In))
            {
                dataConnector.Offset = new Point(xLeft - 0.01, yTop);
                this.Connectors.Add(dataConnector);
                yTop += rowMargin;                
            }

            yTop = heightOffset;
            foreach (var flowConnector in FlowConnectors
                .Where(connector => connector.ConnectorDirection == ConnectorDirection.Out))
            {
                flowConnector.Offset = new Point(xRight, yTop);
                this.Connectors.Add(flowConnector);
                yTop += rowMargin;
            }

            foreach (var dataConnector in DataConnectors
                .Where(connector => connector.ConnectorDirection == ConnectorDirection.Out))
            {
                dataConnector.Offset = new Point(xRight, yTop);
                this.Connectors.Add(dataConnector);
                yTop += rowMargin;
            }
        }
Dinko | Tech Support Engineer
Telerik team
 answered on 22 Jun 2021
1 answer
896 views

Hope somebody can help out here.

We have recently started using the RadSyntaxEditor in an application that uses the Prism framework. There have been some posts about the SyntaxEditor not showing in the UI unless you put it in a ContentControl. We did this and bound the Content to the SyntaxEditor instance in the VM.

This worked fine and we can add a custom tagger but none of the event subscriptions to the Document.TextContentChanged event seem to work.

If we then template the SyntaxEditor in the XAML and bind to an instance of the TextDocument like this, how do you set up a custom tagger?

<ControlTemplate x:Key="SyntaxEditorControlTemplate" TargetType="{x:Type ContentControl}">
            <telerik:RadSyntaxEditor AutoScrollToCaretOnTextChange="True"
                                      CaretDisplayMode="Block"
                                      Document="{Binding SyntaxTextDocument}">

            </telerik:RadSyntaxEditor>
</ControlTemplate>

Can anybody point us to an example of using the SyntaxEditor with MVVM please.

Thanks

Vladimir Stoyanov
Telerik team
 answered on 21 Jun 2021
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
NavigationView (Hamburger Menu)
Wizard
ExpressionEditor
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
Callout
PasswordBox
SplashScreen
Localization
Rating
Accessibility
CollectionNavigator
AutoSuggestBox
Security
VirtualKeyboard
HighlightTextBlock
TouchManager
StepProgressBar
Badge
OfficeNavigationBar
ExpressionParser
CircularProgressBar
SvgImage
PipsPager
SlideView
AI Coding Assistant
InlineAIAssistant
+? more
Top users last month
Shiori
Top achievements
Rank 2
Iron
Tien
Top achievements
Rank 1
Iron
Robert
Top achievements
Rank 1
Rob
Top achievements
Rank 4
Bronze
Bronze
Iron
Geoff
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Top users last month
Shiori
Top achievements
Rank 2
Iron
Tien
Top achievements
Rank 1
Iron
Robert
Top achievements
Rank 1
Rob
Top achievements
Rank 4
Bronze
Bronze
Iron
Geoff
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?