Telerik Forums
UI for WPF Forum
2 answers
127 views

Hi there,

We have a situation where we're creating dockable panes and we'd like to make it so when you hit the button to make one it will create it and start a drag option automatically so you can then dock it where you want as soon as you make it, is this doable at all? I haven't been able to find anything online about it

Thanks

Stenly
Telerik team
 answered on 13 Dec 2021
1 answer
153 views

Hi,

I'm adding 2 column groups to my RadGridView, say "A" and "B".
Then I'm removing them using myRadGridView.RemoveRange().

Then I try to add them again: it works for "A", but raises an exception for "B": InvalidOperationException, because apparently a column group with this name already exists.
But I had removed "B" from the column groups!

So I tried to repro with a very simple case:

var cg = new GridViewColumnGroup { Name = "test" };
myRadGridView.ColumnGroups.Add(cg);
myRadGridView.ColumnGroups.Add(cg);

This is done right at the start of the app.
I exepect this to raise the same exception, since I'm trying to add several column groups with the same name.

But it executes without any problem!

So how does it work internally? At the moment this doesn't make much sense to me...

I'm wondering if this exception is only raised if the column groups are actually used by some columns, that are bound to data, but I can't tell...

Thanks for your feedback!

EDIT: I noticed the event RadGridView.ColumnGroups.CollectionChanging is only fired when using ColumnGroups.Add or .Remove, but not when using ColumnGroups.AddRange or ColumnGroups.RemoveRange. Could this be related to my issue?

EDIT2: I managed to avoid the exception by looping through my groupsToRemove and calling .Remove for each of them, instead of directly calling .RemoveRange. This is in the docs: WPF DataGrid | Column Groups | Telerik UI for WPF. However, I'm not using .SuspendNotifications() and .ResumeNotifications() around my loop. If I do this, the exception is raised again. Hope this helps!

Dilyan Traykov
Telerik team
 answered on 10 Dec 2021
1 answer
204 views

I had to add : 

foreach (var column in radgrid.Columns)
            {
                column.ColumnFilterDescriptor.FieldFilter.Clear();
            }

to clear the text .. 

question: is it supposed to work like that ? 

Martin Ivanov
Telerik team
 answered on 10 Dec 2021
0 answers
112 views

Hi Dear Telerik Developers
It seems there is a bug on exporting RadDocument to docx using DocxFormatProvider.  The problem is when the document has a rtl span. Not only the span which we want to be rtl dose not get right to left direction, but also some other properties of the span (such as bold and italic styles) get buggy and do not work properly on Microsoft Word. 

So, after a couple of hours working on this bug (decompiling  Telerik.Windows.Controls.RichTextBox.dll via JustDecompile and searching about what is going on inside of the component)  finally is turns out that the problem is in ExportTextDirection method of SpanExporter class under Telerik.Windows.Documents.FormatProviders.OpenXml.Docx.Export namespace. This method uses "rtl" WML element which is not recognizes by Microsoft Word and should be "bidi" to perform correctly.
Thanks to OpenXML technology, currently I am using the following code as a trick to solve the problem:

private static void TestTelerik()
{
var document = new RadDocument();
var section = new Section();
document.Sections.Add(section);
var paragraph = new Paragraph();
paragraph.TextAlignment = Telerik.Windows.Documents.Layout.RadTextAlignment.Justify;
paragraph.FlowDirection = System.Windows.FlowDirection.RightToLeft;
var span = new Span();
span.FlowDirection = System.Windows.FlowDirection.RightToLeft;
span.Text = "متن فارسی نمومه";
span.FontWeight = System.Windows.FontWeights.Bold;
span.FontStyle = System.Windows.FontStyles.Italic;
span.FontFamily = new System.Windows.Media.FontFamily("Tahoma");
paragraph.Inlines.Add(span);
section.Blocks.Add(paragraph);
var provider = new DocxFormatProvider();
var bytes = provider.Export(document);
bytes = RefineDocx(bytes);
IO.File.Write("RTLSpanBugFix.docx", bytes);
}

private static byte[] RefineDocx(byte[] docx) 
{
var stream = new System.IO.MemoryStream(docx);
var openXml = DocumentFormat.OpenXml.Packaging.WordprocessingDocument.Open(stream, true);
var main = openXml.MainDocumentPart;
FixBugOnRightToLeft(main);
openXml.Save();
openXml.Close();
var result = stream.ToArray();
return result;
}
private static void FixBugOnRightToLeft(DocumentFormat.OpenXml.Packaging.MainDocumentPart main)
{
var outerXML = main.Document.OuterXml;
outerXML = outerXML.Replace("w:rtl w:val=", "w:bidi w:val=");
main.Document = new DocumentFormat.OpenXml.Wordprocessing.Document(outerXML);
}

 

Mohammad Afghari
Top achievements
Rank 2
 updated question on 09 Dec 2021
0 answers
307 views

Hi, 

we have a dataset of several thousand items which needs to be fully expanded if some search criteria is applied. This can be displayed with virtualization enabled but we encounter an issue where if we add new records the scroll position jumps to the top, this is not the case with virtualization disabled. 

we are using a hierarchical data template to display our tree view items , and would like the scroll position to remain somewhat consistently in the same place. 

Thanks, 

Richard 

 

 

 

 

 

Richard
Top achievements
Rank 1
 asked on 09 Dec 2021
2 answers
1.5K+ views
Hy i am can`t show image in a RadButton
Please told me how can i do this
Petar Mladenov
Telerik team
 answered on 09 Dec 2021
1 answer
203 views

I want to add a small arrow in the column header. This worked perfect. And if I click on this arrow, the column should have a ver small size (almost invisible).

So I have to set the column width almost to zero. Is there a way to set the width programmatically? I could only set the header width, but not the full column width.

 

This is my wpf to show the arrow:

                    <Style TargetType="telerik:ColumnHeaderContainer" BasedOn="{StaticResource ColumnHeaderContainerStyle}">
                        <Setter Property="ContentTemplate">
                            <Setter.Value>
                                <DataTemplate>
                                    <Grid>
                                        <Grid.ColumnDefinitions>
                                            <ColumnDefinition Width="Auto"/>
                                            <ColumnDefinition Width="*" />
                                        </Grid.ColumnDefinitions>
                                        <TextBlock Grid.Column="0" Text="{Binding Header}" />
                                        <Polygon Grid.Column="1" Points="7.5,5 11.5,2 11.5,8 7.5,5" Stroke="Black" StrokeThickness="1" VerticalAlignment="Bottom" 
                                                 HorizontalAlignment="Right" MouseDown="SpalteZusammenklappen">
                                            <Polygon.Style>
                                                <Style TargetType="Polygon">
                                                    <Style.Triggers>
                                                        <Trigger Property="IsMouseOver" Value="True">
                                                            <Setter Property="Polygon.Fill">
                                                                <Setter.Value>
                                                                    <SolidColorBrush Color="Black"/>
                                                                </Setter.Value>
                                                            </Setter>
                                                        </Trigger>
                                                        <Trigger Property="IsMouseOver" Value="False">
                                                            <Setter Property="Polygon.Fill">
                                                                <Setter.Value>
                                                                    <SolidColorBrush Color="White"/>
                                                                </Setter.Value>
                                                            </Setter>
                                                        </Trigger>
                                                    </Style.Triggers>
                                                </Style>
                                            </Polygon.Style>
                                            <Polygon.RenderTransform>
                                                <RotateTransform Angle="-37" />
                                            </Polygon.RenderTransform>
                                        </Polygon>
                                    </Grid>
                                </DataTemplate>
                            </Setter.Value>
                        </Setter>

So my Header looks like this:

Stenly
Telerik team
 answered on 09 Dec 2021
3 answers
3.5K+ views

Hello,

I want to change the text color (foreground) of the selected item in a combo box only. The rest of the control should stay as it is.

Can you help me with this?

regards,

Tobias

Stenly
Telerik team
 answered on 09 Dec 2021
1 answer
289 views

When playing around with the RadRichTextBox for WPF, the following has been noticed:

1) Type in some text using Calibri font: 

2)  Insert symbols in Wingdings font by going to Insert and add Symbol: 

3) Close the 'Insert Symbol' popup, and start typing from the Keyboard. Notice that only Wingdings symbols are being typed up: 

Question: Is this the intended behaviour in Telerik? In Microsoft Word 2013. when you insert a symbol, it does not change the font of the text. In this case, Microsoft Word will let the user type out characters in Calibri font from their keyboard after inserting Wingdings symbols through the Insert Symbols icon present in MS Word. Also, in MS 2013, the font present in the Home page would still be Calibri, it will not change to Wingdings as it does in this example.

Note: The RadRichTextBox being used is from the demo which can be downloaded here: https://demos.telerik.com/wpf/

Tanya
Telerik team
 answered on 09 Dec 2021
1 answer
101 views

Is there a way to disable the grouping of categories?

For example, I'm using a bar series and my category values are A, B, B, B, C which are being grouped and shown as A, B, C bars. I would like to display the original 5 separate bars, without grouping.

Martin Ivanov
Telerik team
 answered on 09 Dec 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
PersistenceFramework
DataPager
Styling
TimeBar
OutlookBar
TransitionControl
FileDialogs
Book
ToolBar
ColorPicker
TimePicker
MultiColumnComboBox
SyntaxEditor
VirtualGrid
Wizard
ExpressionEditor
NavigationView (Hamburger Menu)
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
PasswordBox
SplashScreen
Callout
Rating
Accessibility
CollectionNavigator
Localization
AutoSuggestBox
Security
VirtualKeyboard
HighlightTextBlock
TouchManager
StepProgressBar
Badge
OfficeNavigationBar
ExpressionParser
CircularProgressBar
SvgImage
PipsPager
SlideView
AI Coding Assistant
+? more
Top users last month
Cynthia
Top achievements
Rank 1
Iron
Toby
Top achievements
Rank 3
Iron
Iron
Iron
Danielle
Top achievements
Rank 1
Iron
Iron
Joel
Top achievements
Rank 3
Bronze
Bronze
Iron
yw
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Cynthia
Top achievements
Rank 1
Iron
Toby
Top achievements
Rank 3
Iron
Iron
Iron
Danielle
Top achievements
Rank 1
Iron
Iron
Joel
Top achievements
Rank 3
Bronze
Bronze
Iron
yw
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?