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

Copying vitual grids

When copying virtual grids to a normal gridcontrol, i am not getting all the properties of the grid copied to normal grid. For example in the virtual grid i have set col 2 of all the rows readonly. But when i copy to a new grid, the readonly property is copied only for the grids that are in the visible region in the view. for remaining rows i am not getting the readonly property in the new grid. How do i solve this problem.? Thanks in advance

5 Replies

AD Administrator Syncfusion Team March 4, 2005 08:39 AM UTC

These ''column style properties'' in the virtual grid need to be copied to the gridControl1.ColStyles[nCol] style in the non-virtual grid. This will make the style property column-wide in the non-virtual grid.


AD Administrator Syncfusion Team March 4, 2005 10:09 AM UTC

I copied the virtual grid to a new grid as follows for( int row=0; row<=virtgrid.RowCount; row++) for( int col=0; col<=virtgrid.ColCount; col++) { GridStyleInfo copyCell = copyGrid[row+curRow,col]; GridStyleInfo cell = virtgrid[row,col]; copyCell.Text = cell.Text; copyCell.BackColor = cell.BackColor; copyCell.CellType = cell.CellType; copyCell.TextColor = cell.TextColor; copyCell.Font = cell.Font; copyCell.HorizontalAlignment = cell.HorizontalAlignment; copyCell.VerticalAlignment = cell.VerticalAlignment; copyCell.Description = cell.Description; copyCell.ImageList = cell.ImageList; copyCell.ImageIndex = cell.ImageIndex; copyCell.ReadOnly=cell.ReadOnly } But still i have the problem..I get the readonly property true for visible grid area in the view. suppose i have 25 rows visible in the view (in a total of 50rows), i get readonly property true for those 25 cells. for the remaining rows i get the readonly property false. How do i solve this problem


AD Administrator Syncfusion Team March 4, 2005 10:20 AM UTC

When you debug this code, is virtgrid.Row showing the values you expect? Dow row + curRow run through the values you expect (say if you add a Console.WriteLine in the loop and WriteLine out the loop index and several of teh values of interst like the two ReadOnly setting before and after setting them, etc. If you can upload a little sample project showing this problem, we can try to debug it here.


AD Administrator Syncfusion Team March 4, 2005 10:29 AM UTC

when i debug this code i get all the other properties correctly..such as text, cell type etc..but not the readonly property for the rows that are not visble in the grid area. >When you debug this code, is virtgrid.Row showing the values you expect? Dow row + curRow run through the values you expect (say if you add a Console.WriteLine in the loop and WriteLine out the loop index and several of teh values of interst like the two ReadOnly setting before and after setting them, etc. > >If you can upload a little sample project showing this problem, we can try to debug it here.


AD Administrator Syncfusion Team March 4, 2005 11:55 AM UTC

Is teh readonly setting correct when you retrieve it from grid1? If you check grid2 immediately after setting the style, does it show the proper readonly setting. I do not see this problem in this sample using 3010. Can you? Or can you modify it to show the problme you are having? http://www.syncfusion.com/Support/user/uploads/GC_Virt_Copy_f21eef2a.zip

Loader.
Live Chat Icon For mobile
Up arrow icon