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.
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Copy 1 cell and paste into many

Thread ID:

Created:

Updated:

Platform:

Replies:

45474 Jun 21,2006 07:47 PM UTC Jun 23,2006 11:03 PM UTC Windows Forms 5
loading
Tags: GridControl
Adam K.
Asked On June 21, 2006 07:47 PM UTC

I am using the following code below to copy from 1 grid cell and paste into many cell in the same column. I am using a virtual grid. It works but the issue is that 1. After the data gets pasted, (while the grid has the whole column highlighted) i can''t move the cursor right or left for a number of seconds. 2. When i finally can move the cursor, it seems the cell painting gets screwed up because half the cell still shows the color as if it was still highlighted which the rest of cell displays normally. I have attached a picture to show you what i mean. Any thoughts on each of these items. thks, ak private void Model_ClipboardPaste(object sender, GridCutPasteEventArgs e) { DataObject obj = Clipboard.GetDataObject() as DataObject; string data = obj.GetData(typeof (string)).ToString(); GridRangeInfo info = _HPGrid.Model.SelectedRanges.ActiveRange; string[] cells = data.Split(new char[] {''\t''}); for (int i = info.Top; i <= info.Bottom; i++) { int cellsCount = 0; for (int j = info.Left; j <= info.Right; j++) { _HPGrid.Model[i, j].Text = cells[cellsCount]; cellsCount++; } } }

gridScreenShot.zip

Administrator [Syncfusion]
Replied On June 21, 2006 09:02 PM UTC

Hi Adam, Please refer to the forum thread for more details. http://www.syncfusion.com/Support/Forums/message.aspx?MessageID=44965 Best Regards, Haneef

Administrator [Syncfusion]
Replied On June 22, 2006 12:26 PM UTC

Haneef, I was the one that posted that message but i am still getting this issue that i described above. Any ideas. thks, ak >Hi Adam, > >Please refer to the forum thread for more details. >http://www.syncfusion.com/Support/Forums/message.aspx?MessageID=44965 > >Best Regards, >Haneef

Administrator [Syncfusion]
Replied On June 22, 2006 03:49 PM UTC

Hi Adam, Sorry for the inconvenience caused. Regarding the Question 1: I am afraid that I was not able to reproduce this issue. Please let me know the version number of Studio you are testing this with and the .Net version. Regarding the Question 2: The reason is that selection is not cleared when the user moves the currentcell out of a selected range. You need to set the ExcelLikeCurrentCell behavior to TRUE. Here is a code snippet. this.gridControl1.Model.Options.ExcelLikeCurrentCell = true; Description of ExcelLikeCurrentCell: When the user moves the currentcell out of a selected range will be cleared.If the user moves the currentcell inside a selected range, the range will stay. If it is not works, you can handle the CurrentCellMoving event to clear the selection and also comment the ExcelLikeCurrentCell behavior. Please find the code below. //disable the ExcellLikeCurrentCell behavior. this.gridControl1.Model.Options.ExcelLikeCurrentCell = false; private void gridControl1_CurrentCellMoving(object sender, Syncfusion.Windows.Forms.Grid.GridCurrentCellMovingEventArgs e) { if (! this.gridControl1.Model.SelectedRanges.AnyRangeIntersects(GridRangeInfo.Cell(e.RowIndex,e.ColIndex) )) { this.gridControl1.Model.Selections.Clear(true); } } Let me know if this helps. Best Regards, Haneef

Adam K.
Replied On June 22, 2006 09:52 PM UTC

i tried this but i still saw the exact same behavior in the attached image from my first email. WHen i move off the cell, the old range of selected cells have sections of the cell still with the old coloring as if they were still highlighted even though the selection has moved. I am using DotNet 1.1 and Syncfusion 3.301 >Hi Adam, > >Sorry for the inconvenience caused. > >Regarding the Question 1: > >I am afraid that I was not able to reproduce this issue. > >Please let me know the version number of Studio you are testing this with and the .Net version. > >Regarding the Question 2: > >The reason is that selection is not cleared when the user moves the currentcell out of a selected range. You need to set the ExcelLikeCurrentCell behavior to TRUE. Here is a code snippet. > >this.gridControl1.Model.Options.ExcelLikeCurrentCell = true; > >Description of ExcelLikeCurrentCell: > >When the user moves the currentcell out of a selected range will be cleared.If the user moves the currentcell inside a selected range, the range will stay. > >If it is not works, you can handle the CurrentCellMoving event to clear the selection and also comment the ExcelLikeCurrentCell behavior. Please find the code below. > >//disable the ExcellLikeCurrentCell behavior. >this.gridControl1.Model.Options.ExcelLikeCurrentCell = false; > >private void gridControl1_CurrentCellMoving(object sender, Syncfusion.Windows.Forms.Grid.GridCurrentCellMovingEventArgs e) >{ > if (! this.gridControl1.Model.SelectedRanges.AnyRangeIntersects(GridRangeInfo.Cell(e.RowIndex,e.ColIndex) )) > { > this.gridControl1.Model.Selections.Clear(true); > } >} > >Let me know if this helps. >Best Regards, >Haneef >

Administrator [Syncfusion]
Replied On June 23, 2006 11:03 PM UTC

Hi Adam, I have tested this issue by creating a sample in v.3.3 and then again tested by upgrading to 4.1/42. I was not able to reproduce the issue. May be I am not following the steps that you are doing. Attached sample working fine here.If you can provide more information, we can try to suggest some solution. Here is a sample. http://www.syncfusion.com/Support/user/uploads/VirtualGrid_49952bec.zip Could you please run this at your end and let me know how it goes? Thanks for your patience. Regards, Haneef

CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

;