Telerik Forums
UI for WPF Forum
2 answers
640 views
Hi I have a RadGridView. The ItemSource is a DataView based on a DataTable. The GridView Property AutoGenerateColumns = "False".

XAML:
<telerik:RadGridView.Columns>
<telerik:GridViewDataColumn x:Name="VisitNumber" DataMemberBinding="{Binding VisitNumber}" Header="Fallnummer" Width="120"/>
<telerik:GridViewDataColumn x:Name="LastName" DataMemberBinding="{Binding LastName}" Header="Nachname" Width="200"/>
<telerik:GridViewDataColumn x:Name="FirstName" DataMemberBinding="{Binding FirstName}" Header="Vorname" Width="150"/>
</telerik:RadGridView.Columns>

How can I retrieve the values of the selected row using C # code?
Maya
Telerik team
 answered on 02 Mar 2015
1 answer
128 views
Hello all,
I have the following problem when using the mail merge:
If I do not have watermark in the document, MailMerge and Export to PDF performs correctly.
Here is how I do the MailMerge (not full code):

//loop throught documents
do
{
    RadDocument currentDocument = document.MailMergeCurrentRecord();
    if (currentDocument != null)
    {
        //freeze images
        foreach (var image in currentDocument.EnumerateChildrenOfType<ImageInline>())
            image.ImageSource.Freeze();
 
        //Floating images
        foreach (var image in currentDocument.EnumerateChildrenOfType<FloatingImageBlock>())
            image.ImageInline.ImageSource.Freeze();
 
        lock (baton)
            documentQueue.Enqueue(currentDocument);//add new document to a queue for further processing
        currentDocument = null;
    }
 
} while (document.MailMergeDataSource.MoveToNext());


and here is how I export to PDF (into a stream):
public static async Task<Stream> ExportToPDF(RadDocument document)
{
    PdfFormatProvider provider = new PdfFormatProvider();
    Stream output = new MemoryStream();
 
    await StartSTATask(() =>
    {
        provider.Export(document, output);
    });
    output.Position = 0;
    return output;
}


As I have mentioned, the problem occurs when I have a Watermark in my document. Even though Mail Merge performs correctly, the document crashes on the 
provider.Export(document, output) saying that the current thread cannot access object as different thread owns it.

Here is full error report:

at System.Windows.Threading.DispatcherObject.VerifyAccess()
   at System.Windows.Media.Imaging.BitmapSource.get_PixelWidth()
   at System.Windows.Media.Imaging.WriteableBitmap.InitFromBitmapSource(BitmapSource source)
   at Telerik.Windows.Media.Imaging.RadBitmap..ctor(BitmapSource image)
   at Telerik.Windows.Documents.FormatProviders.Pdf.PdfDocumentExporter.SetImageAlpha(WatermarkImageSettings imageSettings, Byte alpha)
   at Telerik.Windows.Documents.FormatProviders.Pdf.PdfDocumentExporter.DrawWatermark(Header header, SectionLayoutBox sectionBox, PdfContentsWriter writer)
   at Telerik.Windows.Documents.FormatProviders.Pdf.PdfDocumentExporter.ExportHeadersAndFooters(SectionLayoutBox sectionBox, PdfContentsWriter writer)
   at Telerik.Windows.Documents.FormatProviders.Pdf.PdfDocumentExporter.ExportPage(SectionLayoutBox sectionBox, PdfContentsWriter writer)
   at Telerik.Windows.Documents.FormatProviders.Pdf.PdfDocumentExporter.<>c__DisplayClass1.<Export>b__0(PdfContentsWriter contentsWriter)
   at Telerik.Windows.Documents.FormatProviders.Pdf.RadPdf.PdfContents.WriteContents(PdfWriter writer)
   at Telerik.Windows.Documents.FormatProviders.Pdf.RadPdf.PdfStream.WriteToCore(PdfWriter writer)
   at Telerik.Windows.Documents.FormatProviders.Pdf.RadPdf.PdfObject.WriteTo(PdfWriter writer)
   at Telerik.Windows.Documents.FormatProviders.Pdf.RadPdf.PdfWriter.WritePdfObject(PdfObject obj)
   at Telerik.Windows.Documents.FormatProviders.Pdf.PdfDocumentExporter.Export()
   at Telerik.Windows.Documents.FormatProviders.Pdf.PdfFormatProvider.Export(RadDocument document, Stream output)
   at IP_DocumentProcessor.MailMerge.IP_MailMerge.<>c__DisplayClass14.<ExportToPDF>b__13() in d:\VB Projects + Silverlight\VS2012APP\IP_DocumentProcessor\IP_DocumentProcessor\MailMerge\IP_MailMerge.cs:line 476
   at IP_DocumentProcessor.MailMerge.IP_MailMerge.<>c__DisplayClass1a.<StartSTATask>b__19() in d:\VB Projects + Silverlight\VS2012APP\IP_DocumentProcessor\IP_DocumentProcessor\MailMerge\IP_MailMerge.cs:line 500
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter`1.GetResult()
   at IP_DocumentProcessor.MailMerge.IP_MailMerge.<StartSTATask>d__1c.MoveNext() in d:\VB Projects + Silverlight\VS2012APP\IP_DocumentProcessor\IP_DocumentProcessor\MailMerge\IP_MailMerge.cs:line 510
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at IP_DocumentProcessor.MailMerge.IP_MailMerge.<ExportToPDF>d__16.MoveNext() in d:\VB Projects + Silverlight\VS2012APP\IP_DocumentProcessor\IP_DocumentProcessor\MailMerge\IP_MailMerge.cs:line 474
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter`1.GetResult()
   at IP_DocumentProcessor.MailMerge.IP_MailMerge.<GenerateStreams>d__7.MoveNext() in d:\VB Projects + Silverlight\VS2012APP\IP_DocumentProcessor\IP_DocumentProcessor\MailMerge\IP_MailMerge.cs:line 282
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.AsyncMethodBuilderCore.<ThrowAsync>b__1(Object state)
   at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
   at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
   at System.Threading.QueueUserWorkItemCallback.System.Threading.IThreadPoolWorkItem.ExecuteWorkItem()
   at System.Threading.ThreadPoolWorkQueue.Dispatch()


Your help would be highly appreciated as I don't know how to handle this problem.
Thank you.
Robert
Boby
Telerik team
 answered on 27 Feb 2015
1 answer
129 views
Hi,

I would like to know how it's possible to dock center a SplitContainer?

Thank's
Alain
Nasko
Telerik team
 answered on 27 Feb 2015
8 answers
209 views
Hi,

I looking for a kind of tabular layout.
The idea behind it is that in my data I know Row and Column and I want my diagram to look
something like in the attached images.

And I also need Multiple root items like showed on the second image.

The next thing is that I want to restrict node dragging to the matrix - inclusive position change (like drag drop in a treeview control for an example). But this is "enhanced" - my initial request is to generate the layout from data - just by knowing
a.) Node Position Row, Column
b.) Node connected to List of other Nodes

Is this possible - "out of the box" (or with little effort)?

Thanks
Manfred
Petar Mladenov
Telerik team
 answered on 27 Feb 2015
1 answer
126 views
Is it possible to pin a RadDocumentPane like the tabs in VS 2013?
Thanks in advance,
Steve
Vladi
Telerik team
 answered on 27 Feb 2015
1 answer
104 views
Hi

I like this menu, but it would be nice to have more than eight slice.
Kalin
Telerik team
 answered on 27 Feb 2015
1 answer
286 views
1.3.2.4 You must include a valid copyright message in Your Integrated Products in a location viewable by Authorized End-Users (e.g. “About” box) that will serve to protect Telerik’s copyright and other intellectual property rights in the Software.
Kalin
Telerik team
 answered on 27 Feb 2015
1 answer
134 views
Am I able to build any kind of functioning shortcut menu into the GridView accessible thru a right mouse click?

Thanks,

Tony
Boris
Telerik team
 answered on 27 Feb 2015
1 answer
111 views
Hi!

When I bind a GridView to an QCV and klick in a cell the cell/row is in edit-mode and I can change the content of the cell. The moment I use a CellTemplate this functionality is gone, no automatic edit-mode, nothing. Here the example which works:

<telerik:GridViewDataColumn DataMemberBinding="{Binding Name}"
    UniqueName="BoilerplateName"
    IsGroupable="False"
    Width="200"
    Header="Name" />

This one is not working - no edit-mode whatsoever:

<telerik:GridViewDataColumn DataMemberBinding="{Binding Name}"
                           UniqueName="BoilerplateName"
                           IsGroupable="False"
                           Width="200"
                           Header="Name">
    <telerik:GridViewDataColumn.CellTemplate>
        <DataTemplate>
            <TextBox Text="{Binding Name, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"
                     AcceptsReturn="True"
                     MaxLength="4000"
                     TextWrapping="Wrap" />
        </DataTemplate>
    </telerik:GridViewDataColumn.CellTemplate>
</telerik:GridViewDataColumn>



Boris
Telerik team
 answered on 27 Feb 2015
8 answers
433 views
Hello,
in my ribbon, I have added a DropDownButton that contains a ContextMenu, following the example in Telerik documentation.
This works well... until the menu contains a sub menu. In this case, as soon as the sub menu is opened, the menu is not closed when we click outside it, only the sub menu is closed.
Patrick
Petar Mladenov
Telerik team
 answered on 27 Feb 2015
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
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
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?