RadGridView - Exporting selected cells to csv not supported. Any elegant function to obtain column/row indexes of selected cells?

2 Answers 77 Views
GridView
Czeshirecat
Top achievements
Rank 2
Iron
Iron
Iron
Czeshirecat asked on 14 Sep 2022, 09:04 AM

Hi.

Winforms, c#, .net core 6, VS2022.

I googled to discover, in a very old post, that a gridview was only capable of exporting data from the whole grid unless a flag was set for it to ignore hidden columns/rows.

So I decided to hide columns/rows whilst exporting, then restore the original view afterwards.

But. Is there a clean method to retrieve the start/end column/row indexes or do I have to laboriously step through selected cells to find min/max index values for each cell?

Thanks in advance :)

 

2 Answers, 1 is accepted

Sort by
1
Accepted
Dess | Tech Support Engineer, Principal
Telerik team
answered on 14 Sep 2022, 10:10 AM

Hello, Claire,

Please refer to the following forum post demonstrating how to export only the selected rows in RadGridView:

https://www.telerik.com/forums/howto-export-selected-rows-to-csv#3999796 

I hope this information helps. If you need any further assistance please don't hesitate to contact me. 

Regards,
Dess | Tech Support Engineer, Principal
Progress Telerik

Love the Telerik and Kendo UI products and believe more people should try them? Invite a fellow developer to become a Progress customer and each of you can get a $50 Amazon gift voucher.

Czeshirecat
Top achievements
Rank 2
Iron
Iron
Iron
commented on 14 Sep 2022, 10:37 AM

Thank you :) Your reply arrived after my own realisation.

This looks much better but I'll have a play with this as I'm allowing reordering of columns and cell select. I can see it being messy.

0
Czeshirecat
Top achievements
Rank 2
Iron
Iron
Iron
answered on 14 Sep 2022, 10:26 AM

Argh. Worked it out. DOH

If columns have been rearranged then the selection won't be continuous with min/max. So I need to store a list of selected column indexes instead or minX/maxX etc. (Wish we could delete questions :D )

Tags
GridView
Asked by
Czeshirecat
Top achievements
Rank 2
Iron
Iron
Iron
Answers by
Dess | Tech Support Engineer, Principal
Telerik team
Czeshirecat
Top achievements
Rank 2
Iron
Iron
Iron
Share this question
or