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

Implement "copy down" feature - referencing Row(s) of SelectedCells

5 Answers 74 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Abhinav
Top achievements
Rank 1
Abhinav asked on 07 Oct 2016, 11:29 PM

Hi,

Could you please advise how to reference the row(s) of the SelectedCells?

For example, would like to implement a "copy down/fill handler" (as in Excel) using a ContextMenu on the gridview. For each SelectedCell, we would like to copy the cell contents of the top selected row down to each row of the SelectedCells using MVVM. Please find a sample of the XAML attached.

        <telerik:RadGridView Name="dtgMyData" 
                             ItemsSource="{Binding Path=MyData}" 
                             AutoGenerateColumns="False" 
                             RowIndicatorVisibility="Visible"
                             HorizontalAlignment="Stretch"
                             SelectionMode="Extended"
                             SelectionUnit="Mixed">

...

<telerik:RadMenuItem Header="Copy Values Down" Command="{Binding DataContext.CopyValuesDownCommand, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type telerik:RadContextMenu}}}" CommandParameter="{Binding Path=UIElement, RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=telerik:RadContextMenu}}" />
                    </telerik:RadContextMenu.Items>
                </telerik:RadContextMenu>
            </telerik:RadContextMenu.ContextMenu>

...columns...

</telerik:RadGridView>

 

Kindly advise.

Thanks

5 Answers, 1 is accepted

Sort by
0
Martin
Telerik team
answered on 12 Oct 2016, 02:19 PM
Hi Abhinav,

For your convenience, I prepared an example to demonstrate how to achieve the desired behavior. Please take a look at the implementation and consider how this approach fits your scenario.

I hope that this helps. Should you have any other questions, do not hesitate to contact us.

Regards,
Martin Vatev
Telerik by Progress
Do you need help with upgrading your AJAX, WPF or WinForms project? Check the Telerik API Analyzer and share your thoughts.
0
Abhinav
Top achievements
Rank 1
answered on 12 Oct 2016, 04:56 PM

Hi Martin,

Thank you very much for your reply.

It seems the page/download link is not available, as we are getting a "Page Not Found" error when clicking the download link to the zip file provided.

Could you please provide a working link?

 

Thanks very much.

0
Accepted
Martin
Telerik team
answered on 14 Oct 2016, 10:13 AM
Hi Abhinav,

I really apologize for the inconvenience. I reattached the project in the current response. Would you try it to download again?

Thank you for your understanding. I hope that this time will help you.

Regards,
Martin Vatev
Telerik by Progress
Do you need help with upgrading your AJAX, WPF or WinForms project? Check the Telerik API Analyzer and share your thoughts.
0
Accepted
Martin
Telerik team
answered on 14 Oct 2016, 12:05 PM
Hello Abhinav,

I want just to inform that we have a global issue with the attachments on our forum. We are working on the problem and I hope it will be resolved soon.

Regards,
Martin Vatev
Telerik by Progress
Do you need help with upgrading your AJAX, WPF or WinForms project? Check the Telerik API Analyzer and share your thoughts.
0
Abhinav
Top achievements
Rank 1
answered on 17 Oct 2016, 09:23 PM

Thank you, Martin. The example fits our scenario.

Tags
GridView
Asked by
Abhinav
Top achievements
Rank 1
Answers by
Martin
Telerik team
Abhinav
Top achievements
Rank 1
Share this question
or