Hello,
I am new to Infragistics and try to make my first steps.
The goal is to have two datagrids, that can use copy&paste and drag&drop unidirectional. (grid A -> grid B). It is a .net 4.5 app with MVVM. I am using xamDataGrid.
Grid A contains all employees - that works fine. Grid B contains a list of jobs (=construction sites of the company) and a week, one column per weekday and the task assignments for each job inside the cell of each job and weekday.
Each job can have mulitple employees per day assigned. I use a listview inside the cell to show the existing assignments. This works as expected.
<igDP:TemplateField Label="Montag" Name="Montag" IsReadOnly="True"> <igDP:TemplateField.DisplayTemplate> <DataTemplate> <ListView ItemsSource="{Binding .}" ScrollViewer.HorizontalScrollBarVisibility="Disabled" BorderThickness="0"> <ListView.ItemTemplate> <DataTemplate> <TextBlock Text="{Binding DisplayText}" TextWrapping="Wrap" ToolTip="{Binding ANMERKUNG}"/> </DataTemplate> </ListView.ItemTemplate> </ListView> </DataTemplate> </igDP:TemplateField.DisplayTemplate></igDP:TemplateField>
I want to implement following functions:
1. The user selects one or multiple employees in grid A and copies them to the clipboard (in their own class) -> this works
2. The user selects one or multiple cells in grid B and pastes the content of the clipboard
a) I am not able to create an array of SelectedItems that contain only the cells of datagrid B, it always shows the full row.
<igDP:XamDataGrid SelectedDataItemsScope="RecordsOrCells" SelectedDataItems="{Binding SelectedArbeitseinteilungen}" DataSource="{Binding Baustellen}" Grid.Row="1" Grid.Column="0" VerticalAlignment="Stretch" HorizontalAlignment="Stretch"ClipboardCopying="CopyArbeitseinteilungen" ClipboardPasting="PasteArbeitseinteilungen" GroupByAreaLocation="None" >
3) The user select 1 or multiple assigned employees inside one cell = one weekday and deletes them (e.g DEL key)
4) One or multiple cells of grid B are selected = means multiple listviews and the user deletes them or pastes a different content
The main problem is (in my understanding) about the relation of the xamDataGrid and its cells that are listviews in this case:
*) Which event is sent to which control (xamDataGrid or ListView)
*) Binding the commands to the right object inside the ViewModel (ItemsSource of Grid B vs. ItemsSource of each single cell)
I hope that I was able to explain the question and look forward to get this thing done.
Thanks
Niko
Hello Nikolaus Kern,
Thank you for your post.
I have been looking into your post and it seems that I am missing something from your scenario. Would you please provide me with more detailed information on what is the functionality you want to achieve? It will be great if you could share short sample project that illustrates the behavior. This way I would be able to further investigate this for you and provide you with more detailed information on this matter.
Looking forward to hearing from you.
Hello Zhivko,
I want to copy multiple items from DataGrid1 to DataGrid2.
This screenshot will give an idea: www.bauradar.at/vBaustellenEinteilung.png
The problems are:
Basically I have a list inside a cell of a datagrid and need to understand the relation of the datagrid the listview inside the cell. How can I bind a method or event to the listview (inside the cell)?