How to Achieve ExcelLikeFillSelection in SfDataGrid
I want to achieve ExcelLikeFillSelection feature in SfDataGrid Control.
In other words, I want user to be able to start drag from one cell and drop a few cells after in vertically down direction and be able to copy cell values.
Please find attached Syncfusion Sample, it has desired behaviour I want, but it is designed for GridControl.
Attachment: Excel_Like_Fill_Selection_9b4204c3.7z
In other words, I want user to be able to start drag from one cell and drop a few cells after in vertically down direction and be able to copy cell values.
Please find attached Syncfusion Sample, it has desired behaviour I want, but it is designed for GridControl.
How do I achieve the same for SfDataGrid ?
Thanking you,
Rahul Makwana
Attachment: Excel_Like_Fill_Selection_9b4204c3.7z
SIGN IN To post a reply.
3 Replies
GT
Gnanasownthari Thirugnanam
Syncfusion Team
November 29, 2017 12:14 PM UTC
Hi Rahul,
We cannot provide direct support for ExcellLikeFillSelection feature like GridControl but you can achieve your requirement in SfDataGrid by customize the GridCellSelectionController class. In this sample we have get the first selected cell value and set the value to all dragged cells in ProcessPointerRelease method.
We have prepared the sample based on your requirement, you can download it from below mentioned location.
Sample link: http://www.syncfusion.com/downloads/support/directtrac/general/ze/SfDataGridDemo1775621174
Regards,
Gnanasownthari T.
RU
Russ
May 24, 2026 01:20 PM UTC
Would there be a way of doing this without preventing rows from being selected?
SR
Senthilkumar Ranganathan
Syncfusion Team
May 25, 2026 12:38 PM UTC
Russ,
Based on your requirement, this can be achieved by customizing the GridSelectionController class. Within this class, as mentioned earlier, you can retrieve the first selected cell value and apply it to all dragged cells in the ProcessPointerReleased method.
Additionally, to enable row selection, ensure that the SelectionUnit property is set to Row.
Code Snippet for Excel-like Fill Selection with Row Selection:
Based on your requirement, this can be achieved by customizing the GridSelectionController class. Within this class, as mentioned earlier, you can retrieve the first selected cell value and apply it to all dragged cells in the ProcessPointerReleased method.
Additionally, to enable row selection, ensure that the SelectionUnit property is set to Row.
Code Snippet for Excel-like Fill Selection with Row Selection:
|
Gif Illustration:
Please find the modified sample demo in the attachment.
Attachment: SfDataGridDemo_c09037a7.zip
SIGN IN To post a reply.
- 3 Replies
- 4 Participants
-
RM Rahul Makwana
- Nov 28, 2017 09:25 PM UTC
- May 25, 2026 12:38 PM UTC