开发者

Paste from Clipboard into Flex 4 DataGrid cells

I want to allow the users of my application to click on a cell in a Flex 4 DataGrid and hit Ctrl-V to paste the contents of the clipboard into the current cell and the cells below it. Basically, what I want to do is select some values from a single column in Excel and paste into a single column in the DataGrid, and this is a web application, not an Air app. Is there an example anywhere of how to do this?

I can grab the contents of the clipboard using keyboard handler events, but I'm not sure how to disable the default paste functionality of the DataGrid. The default functionality is to paste all of t开发者_高级运维he clipboard contents into the selected cell. And I want it to paste into multiple cells starting with the one I have selected.

Any help would be appreciated!!

Thanks, Steve


What you would do is detect which cell is active, you would then have to catch the ctrl v. You then need to interrogate the clip board and work out the intent manually, and then set the relevant cell values.

The other option is to interrogate the clip board and then integrate to the data provider.

Please see this sample: http://hillelcoren.com/2009/09/17/import-export-copy-paste-flex-datagrid/

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜