Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
163
Problem in Pasting Data in Grid
posted

Hi All,

I have a situation in code, where the UltraGrid is being used in Load on Demand mode (Virtual Mode) by using the Ultra Data Source where the underlying source is a Data Table.

Now the total rows returned by the source DB are near 2000. I have implemented a functionality where the user can jump to a cell down in grid by using a small tool "Go To" just as in Excel. I copied the content of the first cell in first column ( this  columns contains date data) and then used the "Go To" tool to jumped to Column 0 and Row 1360 in Grid. I did so by using the following code:

<Code>

private void ActivateCell(int RowIndex, string ColName) 

        this.resultsGrid.ActiveRowScrollRegion.ScrollPosition = RowIndex;
        this.resultsGrid.ActiveRow = this.resultsGrid.Rows[RowIndex];
        this.resultsGrid.ActiveCell = this.resultsGrid.Rows[RowIndex].Cells[ColName];
        this.resultsGrid.Rows[RowIndex].Cells[ColName].Activate();
        this.resultsGrid.Rows[RowIndex].Cells[ColName].Selected = this.resultsGrid.Rows[RowIndex].Cells[ColName].Activate();

</Code> 

 Now the real problem is that as I copied the contents of the first cell and now when I try to paste it in the zero(th) cell in 1360th row, it jumps back to the first cell. The paste command is being used by UltraGrid.PerformAction(UltraGridAction.Paste). I also stepped through the code here that which cell was the active on before PerformAction line o code and it was the 1360th Row and its zero cell.

Can anyone guide me where am I wrong or if there is some other way to handle this?

 

Due Regards,

Talha Muhammad