This is a migrated thread and some comments may be shown as answers.

Printing problem

1 Answer 33 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Mike
Top achievements
Rank 1
Mike asked on 06 Dec 2012, 10:40 PM
Hi,

I am attempting to recreate the print and export example for WPF in my code. I have the PrintAndExportWithRadDocumentModel and Commands, and in my XAML I have 

<Window.Resources>
    <local:PrintAndExportWithRadDocumentModel x:Key="context" />
  </Window.Resources>

and 

<telerik:RadButton Content="Export"
        Height="40"
     Width="50"
        Command="{Binding ExportCommand, Source={StaticResource context}}"
        CommandParameter="{Binding}" />
<telerik:RadButton Content="Print"
        Height="20"
     Width="50"
        Command="{Binding PrintCommand, Source={StaticResource context}}"
       CommandParameter="{Binding}" />

However, when I click on the button I get a null object parameter in the Print method (in the PrintAndExportWithRadDocumentModel class). My question is, how do I bind the RadGridView to the button click so it gets passed as the parameter?





1 Answer, 1 is accepted

Sort by
0
Vlad
Telerik team
answered on 07 Dec 2012, 07:41 AM
Hi,

 You can use ElementName for this Binding to point to your RadGridView instance. 

Regards,
Vlad
the Telerik team

Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

Tags
GridView
Asked by
Mike
Top achievements
Rank 1
Answers by
Vlad
Telerik team
Share this question
or