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

Copy from ClipBoard to Radgrid

1 Answer 35 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Thippa Reddy
Top achievements
Rank 1
Thippa Reddy asked on 16 Nov 2010, 09:07 AM
Hi,

I am using the below Java script code for copy the excell data(ClipBoard) and paste it into rad grid. It's working fine. But if I use RadcomboBox in EditItemTemplate then i can't able to read the values in Mozilla and safari. In I.E I can done.
Actual After Postback RadCombo Values are Disappearing in FireFox and Safari.

function pasteFromExcel() {
            if (!lastFocused) return;
            var browser = navigator.appName;
            if (browser == "Microsoft Internet Explorer") {
                var clipData = window.clipboardData.getData('Text');
                var crlf = String.fromCharCode(13) + String.fromCharCode(10);
                var table = clipData.split(crlf);
                for (var tRow = 0; tRow < table.length - 1; tRow++)
                    table[tRow] = table[tRow].split(String.fromCharCode(9));
                Array.remove(table, table[table.length - 1]);
                fillTable(table);
            }
            else {

                var clipDiv = document.getElementById("Div1");
                clipDiv.style.display = "block";
                var clipBoardText1 = document.getElementById("clipboardtext1");
                clipBoardText1.style.visibility = "visible";
                if (clipBoardText1.value != "") {
                    var clipData = clipBoardText1.value;
                    var table = clipData.split("\n");
                    for (var tRow = 0; tRow < table.length - 1; tRow++)
                        table[tRow] = table[tRow].split(String.fromCharCode(9));
                    Array.remove(table, table[table.length - 1]);
                    fillTable(table);
                    clipBoardText1.value = "";
                    clipDiv.style.display = "none";
                }
            }
        }


Thanks & Regards,

Thippa Reddy

1 Answer, 1 is accepted

Sort by
0
Priyank
Top achievements
Rank 1
answered on 01 Aug 2015, 09:08 AM

Hello Dear,

              Can you please share your " fillTable(table) " method.

Thanks in advance.

 

Tags
Grid
Asked by
Thippa Reddy
Top achievements
Rank 1
Answers by
Priyank
Top achievements
Rank 1
Share this question
or