Copy from ClipBoard to Radgrid

2 posts, 0 answers
  1. Thippa Reddy
    Thippa Reddy avatar
    5 posts
    Member since:
    Nov 2010

    Posted 16 Nov 2010 Link to this post

    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
  2. Priyank
    Priyank avatar
    1 posts
    Member since:
    Jul 2015

    Posted 01 Aug 2015 in reply to Thippa Reddy Link to this post

    Hello Dear,

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

    Thanks in advance.

     

Back to Top