I'm currenting working on an existing project where there the creator had UserControl Xamls, the controls are in ViewModel folder where usercontrol.ViewModel.cs has the control and executable.
I'm trying not to break the code, learn how to use MVVM/WPF formatting.
I have added a button to the UserControl.Xaml now I'm not clear on get the button control to work so it can export both selected gridview item or the whole gridview. I have found several forum articles but they do not met my WPF format:
<telerik:RadButton x:Name="btnExport"
Grid.Row="0"
Content="Export to Excel"
Command="{Binding Export2ExcelCommand}"
Width="100"
Margin="4" />
But now I need a good sample that show how I should add the "Export2ExcelCommand" button control to the "ucViewModel.cs" file.
Again the goal is to support both whole gridview export or selected items in gridview to Excel.
Help is appreciated.