We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date
close icon

Text Box copy and paste issue with HTML code value GDBG

I copy from a text cell that contains html code and paste into another text cell, several rows below the cell I paste into are getting some of the html code. It looks like the extra cells are where there are page breaks in the html code and the grid is treating the page breaks like tab delimitation. I need the grid to paste one to one and not one to many. What are my options?

after copy and paste into first row.zip

3 Replies

AD Administrator Syncfusion Team January 3, 2007 09:59 AM UTC

Hi Prumery,

By default, the grid interprets newlines from the clipboard as information to be added in a new row. So, it will not paste text with newlines in it into a single cell. If you want this behavior, then you will have to handle the entire paste yourself. You can do this by catch the grid.Model.ClipboardPaste event. But grid doesn't interprets HTML-PageBreak

from the clipboard. Here is a minimal sample works fine with HTML-PageBreak.

Sample : GDBGCopy.zip
a>

Best Regards,
Haneef


PR Patrick Rumery January 3, 2007 08:21 PM UTC

Thanks for the reply Haneef. I'm using VB and a grid data bound grid version 4.302.0.30. I'm looking for the event of grid.model.ClipboardPaste and I don't see it. I tried to add a handel for the event and there is no clipboard or cut/paste event in the list. Is there a VB example of copy from Excel into the GDBG you can send me?


>Hi Prumery,

By default, the grid interprets newlines from the clipboard as information to be added in a new row. So, it will not paste text with newlines in it into a single cell. If you want this behavior, then you will have to handle the entire paste yourself. You can do this by catch the grid.Model.ClipboardPaste event. But grid doesn't interprets HTML-PageBreak

from the clipboard. Here is a minimal sample works fine with HTML-PageBreak.

Sample : GDBGCopy.zip
a>

Best Regards,
Haneef


AD Administrator Syncfusion Team January 4, 2007 06:35 AM UTC

Hi Prumery,

Use the AddHandler to subscribe the Model.ClipboardPaste event. Here is a code snippet to show this.

'Form Load....
AddHandler Me.gridControl1.Model.ClipboardPaste, AddressOf Model_ClipBoardPaste

Private Sub Model_ClipBoardPaste(ByVal sender As Object, ByVal e As GridCutPasteEventArgs)
'Your code Here.....
End Sub

>>>>>>Is there a VB example of copy from Excel into the GDBG you can send me?

In the Sample you will find customized excel import, to get a dataTable from the excel file and thereby the dataSource of GridDataBoundGrid is set.. Let me know if your requirement is misunderstood.

Best Regards,
Haneef

Loader.
Live Chat Icon For mobile
Up arrow icon