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

BUG: GridModel.CopyTextToBuffer

Not sure if this is reported yet but I think there is a bug in this function. Do the following (assuming you have a data bound grid with a populated DataTable as its DataSource): 1. Create a RangeInfoList containing one RangeInfo whose type is Cols. Let's say it's called "selections". 2. Call grid.Model.CutPaste.CopyRange(selections); 3. Note that the clipboard is empty. 4. Repeat the first step but use a Cells RangeInfo (for the same range, ie. a bunch of columns) and note that it works as expected. I think the bug is in the CopyTextToBuffer function where it tries to get the rowRanges and colRanges. The filter should probably include Cols for rangeList.GetRowRanges and vice versa. FWIW, my version of the grid is -Peter PS - An even worse problem occurs when you set the selection RangeInfo to type Table.

3 Replies

AD Administrator Syncfusion Team November 13, 2003 11:16 PM UTC

Try calling ExpandRange before you pass it to CopyRange to see if this avoids this problem. grid.Model.CutPaste.CopyRange(selections.ExpandRange(1,1,this.gridDataBoundGrid1.Model.RowCount, this.gridDataBoundGrid1.Model.ColCount));

PZ Peter Zaborski November 14, 2003 02:44 PM UTC

Hi Clay, I have found a workaround for the problem I described, thanks. Are you saying that this is not a bug? I've attached a very simple project to illustrate what I was describing. Please let me know if the behavior I am seeing is expected (ie. Cols, Rows or Table ranges are not valid to pass to CutPaste.CopyRange). -Peter

AD Administrator Syncfusion Team November 14, 2003 04:05 PM UTC

Thank you for the sample, Peter. For now, we are treating this as a usage issue, requiring the call to ExpandRange before calling CopyRange if you are using something other than a cell range. Stefan will look into handling this, but there are some usages of CopyRange internal to the grid where he wants to allow ranges other than Cell ranges. So, until he can work through those particular situations, you'll need to use ExpandRange. We will document this in the next release.

Live Chat Icon For mobile
Up arrow icon