I am using radgridview on my project to display collection of data and I got an exception when I resize column. please find attachment for your reference. Application is also crashed so please help me out from this.
First jpeg : I got an exception whenever I tried to resize column
Second jpeg : I got an exception whenever I do mouse double click on radgridview row
Thanks & Regards
Murugansilvers M
Hi,
I am using radribboncombobox to display toolbar.we want to display combobox like shown in image.
last item as default item i.e "manage filters" in combobox and also other items are grouped as per category "shared" or "personal".
is it possible?
How to do it using template.?
I have a RadSplitContainer docking in an application and when I do the following it either returns DockedLeft or DockedBottom, however I can see that's not correct:
var docking = RadDocking.GetDockState(container)
If I ask for the width and height, I get fixed numbers, not the actual size of the container:
var width = container.ActualWidth; var height = container.ActualHeight;
This question seems related to .Net, but as I am using Telerik UI WPF noXaml 2021 R2 assemblies. I have doubt that Telerik controls might causing this error.
I have published .Net 5 SCD x-86 wpf application on client machine which has win 7 OS. As client machines are outdated, therefore we provided them self contained deployment.
Our application is importing Telerik UI for WPF noXaml 2021 R2 assemblies, and using Font Glyph. FontResources.xaml is imported at application startup. Other than that application is using default fonts.
As following errors shows, application is unable to create font (may be font not found/ corrupted fonts), and I guess Telerik Font Glyph is using fonts which is not available in older OS like Win 7.
System.IO.FileFormatException: Invalid file format.
at MS.Internal.Text.TextInterface.Native.Util.ConvertHresultToException(Int32 hr)
at MS.Internal.Text.TextInterface.Font.CreateFontFace()
at MS.Internal.Text.TextInterface.Font.AddFontFaceToCache()
at MS.Internal.Text.TextInterface.Font.GetFontFace()
at System.Windows.Media.GlyphTypeface..ctor(Font font)
at MS.Internal.FontFace.PhysicalFontFamily.GetGlyphTypeface(FontStyle style, FontWeight weight, FontStretch stretch)
at MS.Internal.FontFace.PhysicalFontFamily.MS.Internal.FontFace.IFontFamily.GetTypefaceMetrics(FontStyle style, FontWeight weight, FontStretch stretch)
at System.Windows.Media.Typeface.ConstructCachedTypeface()
at System.Windows.Media.Typeface.get_CachedTypeface()
at System.Windows.Media.Typeface.CheckFastPathNominalGlyphs(CharacterBufferRange charBufferRange, Double emSize, Single pixelsPerDip, Double scalingFactor, Double widthMax, Boolean keepAWord, Boolean numberSubstitution, CultureInfo cultureInfo, TextFormattingMode textFormattingMode, Boolean isSideways, Boolean breakOnTabs, Int32& stringLengthFit)
at MS.Internal.TextFormatting.SimpleRun.CreateSimpleTextRun(CharacterBufferRange charBufferRange, TextRun textRun, TextFormatterImp formatter, Int32 widthLeft, Boolean emergencyWrap, Boolean breakOnTabs, Double pixelsPerDip)
at MS.Internal.TextFormatting.SimpleRun.Create(FormatSettings settings, CharacterBufferRange charString, TextRun textRun, Int32 cp, Int32 cpFirst, Int32 runLength, Int32 widthLeft, Int32 idealRunOffsetUnRounded, Double pixelsPerDip)
at MS.Internal.TextFormatting.SimpleTextLine.Create(FormatSettings settings, Int32 cpFirst, Int32 paragraphWidth, Double pixelsPerDip)
at MS.Internal.TextFormatting.TextFormatterImp.FormatLineInternal(TextSource textSource, Int32 firstCharIndex, Int32 lineLength, Double paragraphWidth, TextParagraphProperties paragraphProperties, TextLineBreak previousLineBreak, TextRunCache textRunCache)
at MS.Internal.TextFormatting.TextFormatterImp.FormatLine(TextSource textSource, Int32 firstCharIndex, Double paragraphWidth, TextParagraphProperties paragraphProperties, TextLineBreak previousLineBreak, TextRunCache textRunCache)
at System.Windows.Controls.TextBlock.MeasureOverride(Size constraint)
at System.Windows.FrameworkElement.MeasureCore(Size availableSize)
at System.Windows.UIElement.Measure(Size availableSize)
at System.Windows.Controls.Grid.MeasureOverride(Size constraint)
at System.Windows.FrameworkElement.MeasureCore(Size availableSize)
at System.Windows.UIElement.Measure(Size availableSize)
at System.Windows.Controls.Border.MeasureOverride(Size constraint)
at System.Windows.FrameworkElement.MeasureCore(Size availableSize)
at System.Windows.UIElement.Measure(Size availableSize)
at System.Windows.Controls.Canvas.MeasureOverride(Size constraint)
at System.Windows.FrameworkElement.MeasureCore(Size availableSize)
at System.Windows.UIElement.Measure(Size availableSize)
at MS.Internal.Helper.MeasureElementWithSingleChild(UIElement element, Size constraint)
at System.Windows.Controls.ContentPresenter.MeasureOverride(Size constraint)
at System.Windows.FrameworkElement.MeasureCore(Size availableSize)
at System.Windows.UIElement.Measure(Size availableSize)
at System.Windows.Controls.Control.MeasureOverride(Size constraint)
at System.Windows.FrameworkElement.MeasureCore(Size availableSize)
at System.Windows.UIElement.Measure(Size availableSize)
at System.Windows.Controls.Grid.MeasureOverride(Size constraint)
at System.Windows.FrameworkElement.MeasureCore(Size availableSize)
at System.Windows.UIElement.Measure(Size availableSize)
at System.Windows.Controls.Control.MeasureOverride(Size constraint)
at System.Windows.FrameworkElement.MeasureCore(Size availableSize)
at System.Windows.UIElement.Measure(Size availableSize)
at System.Windows.Controls.Grid.MeasureOverride(Size constraint)
at System.Windows.FrameworkElement.MeasureCore(Size availableSize)
at System.Windows.UIElement.Measure(Size availableSize)
at MS.Internal.Helper.MeasureElementWithSingleChild(UIElement element, Size constraint)
at System.Windows.Controls.ContentPresenter.MeasureOverride(Size constraint)
at System.Windows.FrameworkElement.MeasureCore(Size availableSize)
at System.Windows.UIElement.Measure(Size availableSize)
at System.Windows.Documents.AdornerDecorator.MeasureOverride(Size constraint)
at System.Windows.FrameworkElement.MeasureCore(Size availableSize)
at System.Windows.UIElement.Measure(Size availableSize)
at System.Windows.Controls.Border.MeasureOverride(Size constraint)
at System.Windows.FrameworkElement.MeasureCore(Size availableSize)
at System.Windows.UIElement.Measure(Size availableSize)
at System.Windows.Window.MeasureOverrideHelper(Size constraint)
at System.Windows.Window.MeasureOverride(Size availableSize)
at System.Windows.FrameworkElement.MeasureCore(Size availableSize)
at System.Windows.UIElement.Measure(Size availableSize)
at System.Windows.Interop.HwndSource.SetLayoutSize()
at System.Windows.Interop.HwndSource.set_RootVisualInternal(Visual value)
at System.Windows.Interop.HwndSource.set_RootVisual(Visual value)
at System.Windows.Window.SetRootVisual()
at System.Windows.Window.SetRootVisualAndUpdateSTC()
at System.Windows.Window.SetupInitialState(Double requestedTop, Double requestedLeft, Double requestedWidth, Double requestedHeight)
at System.Windows.Window.CreateSourceWindow(Boolean duringShow)
at System.Windows.Window.CreateSourceWindowDuringShow()
at System.Windows.Window.SafeCreateWindowDuringShow()
at System.Windows.Window.ShowHelper(Object booleanBox)
at System.Windows.Window.Show()
at eOffice.App.OnStartup(Object sender, StartupEventArgs e)
at System.Windows.Application.OnStartup(StartupEventArgs e)
at System.Windows.Application.<.ctor>b__1_0(Object unused)
at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs)
at System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Int32 numArgs, Delegate catchHandler)
When I import html document to HtmlFormatProvider, I noticed empty line at beginning of each paragraph. When I exported same document as html document. I found empty paragraph is added, which causing extra spacing. Our challenge is to remove such extra spaces, so that all text in columns are same aligned.
Following is actual document content
<body><p class="NormalWeb "><span class="s_B0779B8D">some text here</span></p><p class="Normal "> </p></body>
While following is generated html document (First para is not part of actual document. and same rendered in richtextbox editor. which adds extra space on top)
<p class="NormalWeb ">
<span class="s_DED8E654"> </span>
</p>
<p class="NormalWeb ">
<span class="s_BCF031D1">some text here</span>
</p>
<p class="Normal "> </p>
I am using following code to import html into editor
using (Stream input = new MemoryStream(Encoding.Default.GetBytes(html)))
{
HtmlFormatProvider provider = new HtmlFormatProvider();
provider.ImportSettings = new HtmlImportSettings
{
UseDefaultStylesheetForFontProperties = false,
UseHtmlHeadingStyles = false
};
RadDocument document = provider.Import(input);
editor.Document = document;
editor.Document.StyleRepository["NormalWeb"].ParagraphProperties.SpacingBefore = 0;
editor.Document.StyleRepository["NormalWeb"].ParagraphProperties.SpacingAfter = 0;
editor.Document.StyleRepository["NormalWeb"].ParagraphProperties.AutomaticSpacingAfter = false;
}
For reference I am attaching actual html document, exported html document and rendering in user interface.
public
MainWindow()
{
InitializeComponent();
var graph =
new
TemplateGraph();
graph.AddNode(
new
ModelItem
{
ZIndex = 3,
Position =
new
Point(80, 120),
Width = 150,
Height = 150,
Color = Colors.Red
});
graph.AddNode(
new
ModelItem
{
ZIndex = 2,
Position =
new
Point(180, 120),
Width = 150,
Height = 150,
Color = Colors.Green
});
graph.AddNode(
new
ModelItem
{
ZIndex = 1,
Position =
new
Point(120, 20),
Width = 150,
Height = 150,
Color = Colors.Blue
});
diagram.GraphSource = graph;
}
<
Window.Resources
>
<
Style
TargetType
=
"telerik:RadDiagramShape"
>
<
Setter
Property
=
"Position"
Value
=
"{Binding Position}"
/>
<
Setter
Property
=
"IsConnectorsManipulationEnabled"
Value
=
"False"
/>
<
Setter
Property
=
"Background"
>
<
Setter.Value
>
<
SolidColorBrush
Color
=
"{Binding Color}"
/>
</
Setter.Value
>
</
Setter
>
<
Setter
Property
=
"Geometry"
Value
=
"{telerik:CommonShape ShapeType=EllipseShape}"
/>
<
Setter
Property
=
"Width"
Value
=
"{Binding Width, Mode=TwoWay}"
/>
<
Setter
Property
=
"Height"
Value
=
"{Binding Height, Mode=TwoWay}"
/>
<
Setter
Property
=
"ZIndex"
Value
=
"{Binding ZIndex, Mode=TwoWay}"
/>
<
Setter
Property
=
"ContentTemplate"
>
<
Setter.Value
>
<
DataTemplate
>
<
TextBlock
Text
=
"{Binding ZIndex}"
/>
</
DataTemplate
>
</
Setter.Value
>
</
Setter
>
</
Style
>
</
Window.Resources
>
<
DockPanel
>
<
telerik:RadNumericUpDown
Value
=
"{Binding SelectedItem.ZIndex, ElementName=diagram}"
/>
<
telerik:RadDiagram
x:Name
=
"diagram"
/>
</
DockPanel
>
Hey guys,
Some of my users want to print a GridView and write things in the printed Grid.
I know, dumb...
The Export is currently done with this:
public void PDFExport()
{
Telerik.Windows.Controls.GridView.IColumnFilterDescriptor tempFilter = ucEndtermintreueDaten.rgvEndtermintreueDaten.Columns["Ausblenden"].ColumnFilterDescriptor;
tempFilter.DistinctFilter.AddDistinctValue(false);
SaveFileDialog dialog = new SaveFileDialog();
dialog.DefaultExt = ".pdf";
dialog.Filter = string.Format("(*.{0})|*.{1}", "pdf", "pdf");
dialog.FileName = "Endtermintreue " + MinDatum.ToString("dd.MM.yy") + "-" + MaxDatum.ToString("dd.MM.yy");
var result = dialog.ShowDialog();
if ((bool)result)
{
using (var stream = dialog.OpenFile())
{
GridViewDocumentExportOptions options = new GridViewDocumentExportOptions()
{
ShowColumnHeaders = true,
AutoFitColumnsWidth = true
};
options.ExcludedColumns.Add(ucEndtermintreueDaten.rgvEndtermintreueDaten.Columns["Ausblenden"]);
ucEndtermintreueDaten.rgvEndtermintreueDaten.ExportToPdf(stream, options);
}
System.Diagnostics.Process.Start(dialog.FileName);
}
tempFilter.Clear();
}
My problem is, that the rows are to small and the columns not wide enough to write something in it from hand if printed.
But I don't see any option to set the row height, and if I set AutoFitColumnsWidth to false it just cuts off the text in it.
Is it possible to set these options?
Or maybe do I have to set the RowHeight and ColumnWidth in the element and revert it back to the original values after export?
Greetings Benedikt