Hello,
I have a column in my grid where I only want checkboxes in a few of the cells. To accomplish this I set the style to Checkbox on the specific cells I wanted. This works just fine - until I try and print the grid. No checkbox shows up and instead the values "True" and "False" are printed where I am expecting to see a checkbox.
I also tried setting the column Style to Checkbox and then setting the Style property of cells that I did not want to be checkboxes to something else (I experimented with Image and a few others). The print document showed checkboxes in every cell.
What is the easiest way to fix this? Thanks for your time.
- Martin
Hi Martin,
What options are you specifying to the Print method of the grid?
In what event are you setting the Style on the cell(s)?
When you print, the grid layout will be cloned along with all of the rows. No row-level settings are copied over to the clone by default, but the Print/PrintPreview method have optional params to allow you to choose what gets copied over.
Thanks for the responses. Setting the each cell's style to Checkbox in e.PrintLayout seemed to do the trick. Although I'm not too crazy about looping through each row in DisplayLayout to see if the cell's style is a checkbox.
The print method I'm using is: m_Spread.Print(m_Spread.DisplayLayout, doc, RowPropertyCategories.All);
I do not set the style of the cells in an event, but dynamically in other code.
Hi,
mjm6252 said:Thanks for the responses. Setting the each cell's style to Checkbox in e.PrintLayout seemed to do the trick. Although I'm not too crazy about looping through each row in DisplayLayout to see if the cell's style is a checkbox.
Do you really need to set the style on each individual cell? Or can you simply set it on the column?
If you need to set it for some cells in the column and not others, then the best place to do this is in the InitializeRow event. The event will fire both for your on-screen rows and for the print rows, so you can just do it in one place and you won't have to worry about it.