Hi Madhan,
Thanks for your kindly help.
How about if selection done for multiple
cell clipboard copy?
My Sample code looks.
public void CopySelectedCellsToClipboard ()
{
GridRangeInfoList rangeList = _gridControl.Selections.Ranges;
if ( (rangeList.GetColRanges (GridRangeInfoType.Cells|GridRangeInfoType.Rows).Count != rangeList.Count) ||
(rangeList.GetRowRanges (GridRangeInfoType.Cells|GridRangeInfoType.Cols).Count != rangeList.Count))
{
for (int i = 0; i < rangeList.Count; i++)
{
if (rangeList[i].IsRows )
{
GridRangeInfo rangeInfo1 = rangeList[i];
GridRangeInfo rangeInfo = GridRangeInfo.Cells (rangeList[i].Top,1, rangeList[i].Bottom, _gridControl.ColCount);
rangeList[i]= rangeInfo;
}
else
if (rangeList[i].IsCols )
{
GridRangeInfo rangeInfo = GridRangeInfo.Cells (1,rangeList[i].Left, _gridControl.RowCount, rangeList[i].Right );
rangeList[i]= rangeInfo;
}
}
}
if(rangeList.Count==0)
{
GridRangeInfo range = GridRangeInfo.Cell(this._lastSelectedRow, this._lastSelectedColumn);
_gridControl.Selections.Add(range);
}
_gridControl.CutPaste.CopyTextToClipboard(_gridControl.Selections.Ranges);
}
Regards
Vijay.T
>Hi Vijay,
>
>This can be achieved by using the ClipboardCopy event. In the event, get the range and the data for each cell in the range and set manually to the DataObject. Refer to the sample for more details.
>
>Sample :
LeadingSpace_ClipboardCopy
>
>Best regards,
>Madhan