Do I need to put the license key on the build machine, or only on the dev machine? (As I understand, an invalid license would cause a compile errors / warnings during build, and also watermarks when application starts, so I'm guessing that the build machine needs a license).
I see that the license can either be in %appdata% or in the root folder of the project, or embedded in the project as TerlerikLicense.cs with:
[assembly: global::Telerik.Licensing.EvidenceAttribute
You also write: "Do not commit the file to source control as this is your personal license key"
So how does it work with adding you TelerikLicense.cs to the project? Wouldn't adding it to the project is like adding it to git? (since entire project is committed)
Thanks
Hi Telerik Team,
I am currently using the RadTreeListView
in a WPF project and have encountered the following issues that I am unable to resolve:
Unwanted Border Around Column Headers:
Despite setting BorderBrush
and BorderThickness
to Transparent
or 0
for the headers, there is still a faint border around the header cells. I tried modifying the control templates based on the Telerik documentation but haven't been able to remove it.
Row Hover Color Changes to Orange/Golden:
When I hover over any row, its background color changes to an orange/golden shade, even though I have explicitly set the IsMouseOver
trigger to make the row background transparent.
Customizing the Toggle Button Icon from Triangle to Arrow:
I want to replace the default triangular toggle icon (used to expand/collapse rows) with a simple arrow icon, but I’m not sure how to modify the toggle button template correctly.
Below is a simplified version of my current RadTreeListView
XAML:
Hi,
Can I check if it is possible to disable having multiple radpanes in a radpanegroup - only 1 radpane in 1 radpanegroup? As I understand that I have to use radpanegroup in order to use radpane
Hello,
I am working with GridViewColumnGroups in RadTreeListView. The first steps and styling worked pretty well.
This morning, I stumbled upon an issue which I am trying to fix now - so far, without success:
I need to implement the "Thumb" and resizing for a GridViewColumnGroup by dragging it with the mouse (the same behavior as it already exists for plain columns). The reason I want to implement this is that I want to "fake" a certain behavior: There are alternating GridViewColumnGroups which each contain only one column. But the user of the application should be under the illusion that the column header cell and the column group are one cell - as if the two "melted together".
By styling the column group, I can make it look like that (I changed the background colour and set the bottom border to thickness zero - that's it). But I also need to implement the Thumb that not only the appearance but also the behavior are the same.
This leads me to the issue that a two-way binding between the column width and the column group width has to be implemented.
Any help here or someone with experience / a solution to this issue?
Any help is appreciated! Thanks a lot in adavance!
Alex
Hello,
I have to attach an xml file to a pdf document, generated by Telerik report Designer.
I have a problem at importing and exporting the generated document.
Import problems:
The MediaBox has values about 100 * 333333333, as you can see in the code, i already tried to reset its size.
Other Unknown problem:
Theres is no text displayed in the exported pdf, but the imported document has a page, and has page.Content.count=80, so there was data imported.
I already tried to remove/implement the PDFA-3b Standard for generation and exporting, but it is still the same result.
The generated document was validated and has correct PDFA-3b Standard.
I also tried to set the font to black via editor, because i thought theres maybe a font problem.
This problems only occures with invoices created by ReportDesigner.
A self created word document, exported to pdf works well.
Code for generating the document by ReportDesigner:
public void Export(object param)
{
try
{
Logger.Log("Executing PrintDialogView.Export", LogLevels.Debug, null, 2);
if (param != null)
{
Microsoft.Win32.SaveFileDialog dialog = new Microsoft.Win32.SaveFileDialog();
dialog.FileName = FileName;
dialog.Filter = String.Format("(*.{0})|*.{1}", param.ToString(), param.ToString());
var SavePath = Repository<AppSetting>.GetSingle(Context, u => u.Key == AppSettingTypes.SavePath.ToString());
if (SavePath != null && SavePath.Value != string.Empty)
{
dialog.InitialDirectory = SavePath.Value.ToString();
}
if (dialog.ShowDialog() == true)
{
// DeviceInfo für PDF/A-3 konfigurieren
System.Collections.Hashtable deviceInfo = new System.Collections.Hashtable();
deviceInfo["ComplianceLevel"] = "PDF/A-3B"; // PDFA-3b-Standard
Telerik.Reporting.Processing.ReportProcessor reportProcessor = new Telerik.Reporting.Processing.ReportProcessor();
Telerik.Reporting.Processing.RenderingResult result = reportProcessor.RenderReport("PDF", ReportSource, deviceInfo);
//Telerik.Reporting.Processing.RenderingResult result = RenderExport(param.ToString());
using (System.IO.FileStream fs = new System.IO.FileStream(dialog.FileName, System.IO.FileMode.Create))
{
fs.Write(result.DocumentBytes, 0, result.DocumentBytes.Length);
System.IO.FileInfo fi = new System.IO.FileInfo(dialog.FileName);
Logger.Log(String.Format("File saved to Directory = {0}, Filename = {1}", fi.Directory, fi.FullName), LogLevels.Debug, null, 2);
ReturnExport(fi.Extension, System.IO.Path.GetFileNameWithoutExtension(dialog.FileName), result.DocumentBytes);
}
if (SaveDocumentFile)
{
DocumentNumber = GetAndSetNextDocumentNumber(SelectedDocumentLayout);
}
}
}
}
catch (Exception ex)
{
MessageBox.Show(ex.ToString(), "Fehler", MessageBox.MessageBoxButtons.Okay, MessageBox.MessageBoxImages.Error);
}
}
Code for Import/Export the generated Document
using iText.IO.Colors;
using iText.Kernel.Pdf;
using iText.Kernel.XMP.Options;
using iText.Kernel.XMP;
using iText.Pdfa;
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Telerik.Windows.Documents.Fixed.FormatProviders.Pdf;
using Telerik.Windows.Documents.Fixed.FormatProviders.Pdf.Export;
using Telerik.Windows.Documents.Fixed.FormatProviders.Pdf.Model.Encryption;
using Telerik.Windows.Documents.Fixed.Model;
using System.Diagnostics;
using iText.Pdfa.Exceptions;
using Telerik.Windows.Documents.Fixed.Model.Text;
using System.Windows;
using Telerik.Windows.Documents.Fixed.Model.Editing;
using Telerik.Documents.Fixed.Model.Fonts;
using Telerik.Documents.Media;
using Telerik.Windows.Documents.Fixed.Model.ColorSpaces;
using System.Drawing;
namespaceZUGFeRD_ConsoleTest
{
publicclassTest
{
public RadFixedDocument LoadPdf(string @pdfPath)
{
// Read the PDF file as a byte arraybyte[] pdfBytes = System.IO.File.ReadAllBytes(@pdfPath);
// Create a PdfFormatProvider instance
PdfFormatProvider provider = new PdfFormatProvider();
// Import the PDF into a RadFixedDocument
RadFixedDocument document = provider.Import(pdfBytes, new TimeSpan(0, 0, 60));
// RadFixedDocumentEditor editor = new RadFixedDocumentEditor(document);
//RgbColor black = new RgbColor(127, 255, 255, 255);//RgbColor white = new RgbColor(0, 0 , 0, 0);
//editor.CharacterProperties.ForegroundColor = black;//editor.ParagraphProperties.BackgroundColor = white;
if (document.Pages.Count == 0)
{
thrownew Exception("Das geladene PDF-Dokument enthält keine Seiten.");
}
foreach(var page in document.Pages)
{
if(page.Content != null)
{
Console.WriteLine($"Seite mit {page.Content.Count} Objekten geladen.");
foreach (var content in page.Content)
{
Console.WriteLine(content.ToString());
}
}
//page.MediaBox = new System.Windows.Rect(0, 0, 2480, 3508);
//page.CropBox = page.MediaBox;
}
//editor.Dispose();
return document;
}public void ExportDocument(RadFixedDocument document, string targetPath)
{
// Export to PDF including xml file
PdfFormatProvider provider = new PdfFormatProvider();
PdfExportSettings settings = new PdfExportSettings();
if (provider.CanExport)
{
settings.ComplianceLevel = PdfComplianceLevel.PdfA3B;
settings.IsEncrypted = false;
settings.FontEmbeddingType = FontEmbeddingType.None;
provider.ExportSettings = settings;
//System.Collections.Hashtable deviceInfo = new System.Collections.Hashtable();//deviceInfo["ComplianceLevel"] = "PDF/A-3B"; // PDF/A-3-Standardbyte[] exportBytes = provider.Export(document, new TimeSpan(0, 0, 60));
using (FileStream fs = new FileStream(targetPath, FileMode.Create))
{
fs.Write(exportBytes, 0, exportBytes.Length);
}
//using (Stream output = System.IO.File.Create(targetPath))//{// provider.Export(document, output, new TimeSpan(0, 0, 60));// FileInfo fileInfo = new FileInfo(targetPath);// Console.WriteLine($"Exportierte Datei Größe: {fileInfo.Length} Bytes");//}
}
//Telerik.Reporting.Processing.RenderingResult result = reportProcessor.RenderReport("PDF", new ReportSource(), deviceInfo);//Telerik.Reporting.Processing.RenderingResult result = RenderExport(param.ToString());//using (System.IO.FileStream fs = new System.IO.FileStream(targetPath, System.IO.FileMode.Create))//{// fs.Write(result.DocumentBytes, 0, result.DocumentBytes.Length);// System.IO.FileInfo fi = new System.IO.FileInfo(pdfPath);//
}
public void ExportDocumentByiText7(PdfDocument document, string targetPath)
{
// Paths for input and output filesstring outputPdfPath = targetPath;
string iccProfilePath = "sRGB.icc"; // Ensure you have an ICC profile file// Create a PdfWriter for the output fileusing (PdfWriter writer = new PdfWriter(outputPdfPath))
{
// Load the ICC profile
IccProfile iccProfile = IccProfile.GetInstance(System.IO.File.ReadAllBytes(iccProfilePath));
// Create a PdfADocument with PDF/A-3b conformance
PdfADocument pdfaDocument = new PdfADocument(writer, PdfAConformance.PDF_A_3B, new PdfOutputIntent("Custom", "", null, "sRGB IEC61966-2.1", writer));
// Add metadata (required for PDF/A compliance)
pdfaDocument.GetDocumentInfo().SetTitle("Sample PDF/A-3b Document");
pdfaDocument.GetDocumentInfo().SetAuthor("Your Name");
pdfaDocument.GetDocumentInfo().SetSubject("PDF/A-3b Export Example");
// Add XMP metadata
XMPMeta xmpMeta = XMPMetaFactory.Create();
xmpMeta.SetProperty(XMPConst.NS_DC, "title", "Sample PDF/A-3b Document", new PropertyOptions(PropertyOptions.SEPARATE_NODE));
pdfaDocument.SetXmpMetadata(xmpMeta);
// Add content to the document
pdfaDocument.AddNewPage(); // Add an empty page as an example// Close the document to finalize it
pdfaDocument.Close();
}
// Output message
System.Console.WriteLine("PDF/A-3b document created successfully!");
}
}
}
Hello,
I have an application where the user will drag object values from internal properties within the application into a Spreadsheet control. Think like a CAD package, the user would drag/drop something like circle's radius into a cell. These cells will automatically update as the application updates. I call these dynamic references DynamicDataFields.
The application maintains a collection of these DynamicDataFields. When the user drag/drops these fields from the application into a cell, that cell information is added to the collection.
It is a pretty simple solution and adding hooks for ActiveWorksheetEditor.Commands like Copy, Paste, Cut, Clear. RemoveCellsCommand, etc. - isn't too complicated.
Basically, the application responds by either,
The biggest thing missing though, is how undo/redo get's handled. I am looking for ways to implement these two actions alongside the built-in undo redo system. Is this something that is possible? Where would I being looking?
Or does anyone have any better ideas?
None of the examples you guys have or I've been able to find are a solution to what should be an easy problem. Right-click on a grid row, show the context menu, and when the user selects an items from the context menu, pass the id from the row to the page view model.
I did find this post but because it uses a UI element for the binding path and it uses code behind instead of MVVM, it's not a solution but my code is based on this.
Here is my context menu code.
<telerik:RadGridView.RowStyle>
<Style TargetType="telerik:GridViewRow">
<Setter Property="telerik:RadContextMenu.ContextMenu">
<Setter.Value>
<telerik:RadContextMenu>
<telerik:RadMenuItem Header="Open"
Command="{Binding OpenCommand}"
CommandParameter="{Binding Path=.}" />
<telerik:RadMenuItem Header="Delete"
Command="{Binding DeleteCommand}"
CommandParameter="{Binding Path=.}" />
<telerik:RadMenuItem Header="Print"
Command="{Binding ReportCommand}"
CommandParameter="{Binding Path=.}" />
</telerik:RadContextMenu>
</Setter.Value>
</Setter>
</Style>
</telerik:RadGridView.RowStyle>
The problem is it thinks the commands are in the view model for the grid row data so I'm getting binding failures.
DeleteCommand property not found on object of type JobVm.
I need to have it use the commands in my page view model. How can I achieve this? I've tried dozens of combinations of setting the RelativeSource but none of them seem to work.
I'm trying to allow for user customization of a grid with as little effort as possible. In order of priority,
Does Telerik have anything pre-built for any of that? I've looked at the "Control Panel" sample and I don't think that would meet my definition of "little effort".
I have a simple, classic grid of numerous records with a checkbox column. I'd like to be able to multi-select records in the grid and then toggle the checkbox. How would I go about doing that?
A tiny, working example would be much appreciated!
Hi,
I have a ScheduleView where I want it to initially be readonly. But then open for edit by clicking a toggle button.
Right now I have added the ReadOnlyBehaviour... and I can see how I can remove it.. but adding it back when clicking out of Edit mode is not so clear.
I had an idea to add a bindable property to my readonlybehaviour like this:
public class ScheduleViewReadOnlyBehaviour : ReadOnlyBehavior
{
private bool _isReadOnly;
public static readonly DependencyProperty ReadOnlyProperty =
DependencyProperty.Register(nameof(ReadOnly), typeof(bool), typeof(RadScheduleView),
new PropertyMetadata(true, ReadOnlyPropertyChanged));
private static void ReadOnlyPropertyChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
{
((ScheduleViewReadOnlyBehaviour)((RadScheduleView)d).ReadOnlyBehavior).ReadOnlyPropertyChanged((bool)e.NewValue);
}
private void ReadOnlyPropertyChanged(bool isReadOnly)
{
_isReadOnly = isReadOnly;
}
public bool ReadOnly
{
get { return (bool)GetValue(ReadOnlyProperty); }
set { SetValue(ReadOnlyProperty, value); }
}
public override bool CanSaveAppointment(IReadOnlySettings readOnlySettings, IOccurrence occurrence)
{
return false;
}
public override bool CanEditAppointment(IReadOnlySettings readOnlySettings, IOccurrence occurrence)
{
return false;
}
public override bool CanDragAppointment(IReadOnlySettings readOnlySettings, IOccurrence occurrence)
{
return false;
}
public override bool CanResizeAppointment(IReadOnlySettings readOnlySettings, IOccurrence occurrence)
{
return false;
}
public override bool CanDeleteAppointment(IReadOnlySettings readOnlySettings, IOccurrence occurrence)
{
return false;
}
public override bool CanEditSlot(IReadOnlySettings readOnlySettings, Slot slot)
{
return false;
}
}
But keep ending up with the GetValue and SetValue methods not found.. obviously missing a point here. Would be a nice clean way of solving this problem.
And yes, I am aware that I am currently not actually using the value being bound... I see that as the least of my issues.