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

Grid In Cell

I''m using the following code to do a custom cell model wich consists of a grid in a cell. GridInCell_584.zip My problem is that when using this cell model, how can I prevent the resulting cell from scrolling. I got more than one row in the Grid in cell and when the user moves down, the whole grid scrolls up and only the last row is visible plus a grey row.

4 Replies

AD Administrator Syncfusion Team June 2, 2005 11:49 PM UTC

I am not sure that I understand your problem. But if you want to prevent the blank area that appears to the right an dbottom of a grid as you scroll to the last col\row, then try setting these properties on the grid that you embed in the cell. grid.HScrollPixel = true grid.VScrollPixel = true If that is not it, if you upload a sample project showing th eproblem you are having, maybe we can suggest sumething.


MC Martin Cyr June 3, 2005 01:19 PM UTC

Seems like it would be the right answer, but it won''t work. Here''s a sample. GridTest_9715.zip Drag the label onto the grid to create the cell and toutch the second row to see the misbeavior. While you''re at it, you could also try and explain to me how to prevent the strange things that happens when you drag one of the subcells (try dragging the combo, you can change any cell to a combo type) but it''s not really the point. Thanks, Martin Cyr


AD Administrator Syncfusion Team June 3, 2005 03:09 PM UTC

I think you may be seeing rounding up making the your heights and widths be larger tan will fit. Try: grid.Model.Cols.DefaultSize = Fix(GridControl1.ColWidths.Item(colIndex) / 2) grid.Model.Rows.DefaultSize = Fix(GridControl1.RowHeights.Item(colIndex) / 2) to truncate the numbers so their sum will never be larger than the parent cell. As far as your second question, I am not sure what you mean. But if you are talking abound trying to drag something in teh embedded grid, then what is happening is that parent grid cell is getting the drg and you end up dragging a cell from teh parent grid to the parent grid which hits your DragDrop code and drops anothe rembedded grid. One simple thing to do would be to turn off the parent grid as an OleDataSource (uncheck the OleDataSource in teh ControllerOptions property) if this will serve your needs. But it would turn you using the grid itself to initiate D&D''s.


MC Martin Cyr June 3, 2005 03:40 PM UTC

Sadly, Fix() wasn''t enough. The grid.VScrollPixel seems to improve the problem slightly, but for the moment, I''ll have to stick with grid.Model.Rows.DefaultSize = Fix(grdPlanification.RowHeights.Item(colIndex) / 2 - 0.1)

Loader.
Live Chat Icon For mobile
Up arrow icon