Paste and SaveCellInfo

I am trying to reuse code posted here that implements fill pasting (so that when one string is pasted into a range, it copies to every row). I used some sample code that was posted here. The problem is that I am using a virtual grid, so I am running into the problem that if I do not set the grid.Data.Rowcount properly, I get an index out of range error. Is there a way to tigger the save cellinfo event in a loop? I''ve tried GetViewStyleInfo(iRow, iCol).Text = Value but that does not work to trigger the event.

1 Reply

AD Administrator Syncfusion Team July 27, 2004 08:15 PM UTC

You trigger SaveCellInfo by setting grid[row, col].Text = somevalue. But you do have to check row and col to make sure they exist in your external datasource so your SaveCellInfo handler can properly save the values. If row and col are outside your external data, then you can either try to add rows/cols to your external datasource, or you can just not set the out of range values. Your looping code would have to manage whatever you woul dwant to do in this case.

Loader.
Up arrow icon