I’m trying to copying and pasting with checkbox using Excel data.
When pasting from checkbox to Excel , the data transform occurs like below.
checkbox on -> 1
checkbox off -> 0
This behavior is understandable and as same as what I expected,but when pasting one checkbox column from Excel to checkbox (using method pasteBlockFromClipboard, ) any values ( including 0, 1, and so on) make checkbox checked.
I think the value “0” should make checkbox unchecked. So I cannot accept this behavior.In my opinion, this behavior caused by “\r” inserted in Excel cell automatically.
How can I solve this problem without changing Library itself?
I am Using DHTMLX Suite Standard Edition v.3.6.
the checkbox exCell was designed so, that the values “0”,null,false,"" will uncheck the checkbox.
any other value will check the checkbox.
If such behavior doesn’t suit you - you may try to create your own custom exCell with the your own behavior.
here you can find a tutorial:
docs.dhtmlx.com/doku.php?id=dhtm … l_creation
Thank you for your helpful answer.
But I wanted to confirm if there is a support for pasting from Excel (method of handling newline character “\r”).
(Actually, I think there has to be support for pasting from Excel, which is a commonly-used application.)
If there is no support, I will try to do the way you suggested.
I used the word “Excel” to mean “Microsoft Excel.”
I want to paste to checkbox from Microsoft Excel’s cell.
Please, have a look at the following example of clipboard operations with dhtmlxgrid:
dhtmlx.com/docs/products/dht … ction.html
I got the same problem when I pasted “0” to dhtmlxGrid.
It worked and did NOT work in some cases.
- When I pasted “0” from other column on dhtmlxGrid, it worked
- When I pasted a value “0” to dhtmlxGrid from some text editor, it worked.
NOT working cases:
- When I pasted a cell which has value “0” to dhtmlxGrid from MS Excel, it did NOT work.
- When I pasted value “0” in two lines, such as
to dhtmlxGrid from text editor, the first “0” did NOT work, but the second “0” worked if I did not copy “line feed code” together (it is similar to working case 2 above).
Therefore, I supposed that there is some problem on “line feed code” when copying data from MS Excel.
Since I really need to copy data from Excel, could you take a look at it?
Thank you very much.
Not sure if this post has been skipped.
Could you take a look at it?
I apologize for the delay.
Your issue is confirmed, but unfortunately it’s not available to fix it now.
The excel sends the data as string so the grid detects a not empty string and checks the checkbox.
You will have to create your custom checkbox exCell or format your data before pasting it to the grid.