Hey,
I have a problem related to unbound columns when I use the the Print and PrintPreview functions of the grid. Only the cell values of the bounded columns are printed, not the cell values of the unbounded ones. However ,the unbounded columns themselves and the associated groups are printed.
I tried adding RowPropertyCategories.All as argument in the the Print methods to achieve some sort of WYSIWYG in the printed version of the grid, but without luck.
Is it possible to print the the cell values of the unbounded columns at all or must all columns be bounded to the datasource?
Any help would be highly appreciated.
How are you populating the unbound columns? My guess is that you are populating the cells inside the InitializeRow event and they are not getting populated or are getting cleared out for the print row.
thanks for your reply.
The cells are populated in the BeforeCellUpdate event and in AfterCellUpdate event. I noticed that after one of these are called the InitializeRow event is fired . When I stepped through the code I noticed that when the InitializeRow event is fired after one of these, and the cell value for the cell that updated was empty.
But I don't see why the InitializeRow event should be fired at this point, since the row has been added at an earlier stage. I'm adding some rows to the grid in code at run-time by using the DisplayLayout.Bands[0].AddNew(). Could this have something to do with the problem?
One of the main uses of the InitializeRow event is to apply a color to a cell or a row based on a Value in that row. So this event fires any time a value in the row changes.
There's a property on the event args call ReInitialize which will tell you if the row is being initialized for the first time.
InitializeRow will also be fired again for every print row when you print - since the printed rows are clones of the real rows.
I am experiencing the same problem. So, what's the solution?