I am writing a control that prints any datagrid. My control gets passed a
datagrid object and examines it, formats, and prints it. I am, however,
encountering what I consider unexpected behavior of the grid....
The grid is named dgBudgets.
In the page Load event I fill the dataset and bind dgBudgets.
I store dgBudgets in Session("myGrid").
In response to the click event of the PrintMe button I pass
Session("myGrid") to my control and call the print method. When doing this,
every thing works great.
But, if I pass dgBudgets to my control instead of Session("myGrid"),
everything prints except that right aligned horizontal column alignments are
notSet and non-visible columns are visible - everything else prints ok.
So, it seems that on the response back, when the printMe button is hit,
dgBudgets loses some of its attributes (although it is still visibly
correct). My understanding is that the initializeComponent code on the
response back should completely reconstruct the grid.
Why does dgBudgets lose its alignment and non-visible settings and nothing
else?
Thanks,
G