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

Copy Selected Rows to Clipboard

I am using the following code to copy the data from the selected range of cells into the clipboard: Dim range As GridRangeInfo = m_Grid.Model.SelectedRanges(0) Dim rangeList As GridRangeInfoList = New GridRangeInfoList rangeList.Add(range) m_Grid.Model.CutPaste.CopyTextToClipboard(rangeList) This works fine if my selected range only contains partial rows (ie: range.info ="R2C3:R3C4"). However, if I select my range by rows such that range.info ends up containing something like "R4:R5" the copy doesn''t seem to work. How can I modify this to recognize both range selections and entire row selections?

2 Replies

AD Administrator Syncfusion Team October 14, 2004 06:15 PM UTC

Before adding your range to the rangelist, use range.ExpandRange to change an arbitrary range into a cell range. range = range.ExpandRange(1, 1, grid.Model.RowCount, grid.Model.ColCount)

JL Jeff Lancaster October 15, 2004 07:01 PM UTC

That works great! Thanks, Clay.

Live Chat Icon For mobile
Up arrow icon