C
Coleen
Hi All
No one has posted with any suggestions on how to get a grand total or computed column value back into a usable variable to perform percentage calculation on the same column you are getting the grand total for. I ended up creating another datagrid to dump the grand total in and calling the value of the cell from the new datagrid. The problem was that .Items().Cells().Value isn't available in the .Net Datagrid at this point, you have to use.Text instead of .Value and you then have to convert the text back into a double. The solution is:
pd_col_10_grnd_tot = Double.Parse(dtg_grand_totals.Items(0).Cells(0).Text)
But you MUST do this AFTER you do the databind to the Second datagrid.
I found that there is an aftermarket tool by Infragistics that allows much more freedom with doing this type of code. In the Infragistics webgrid, the code was:
pd_col_10_grnd_tot = utg_grand_tot.Rows(0).Cells(0).Value
Why oh why can't Microsoft be as easy to use? I spent about eight hours researching, testing, trying PreRender,compute column, .ToString, etc... EVERYTHING I could think of and the answer was extremely simple using the Infragistics UltraWebGrid, but although similar, it was not until I tried using the UWG that I discovered how to get this to work for me using .Net's Datagrid!!!
Coleen
No one has posted with any suggestions on how to get a grand total or computed column value back into a usable variable to perform percentage calculation on the same column you are getting the grand total for. I ended up creating another datagrid to dump the grand total in and calling the value of the cell from the new datagrid. The problem was that .Items().Cells().Value isn't available in the .Net Datagrid at this point, you have to use.Text instead of .Value and you then have to convert the text back into a double. The solution is:
pd_col_10_grnd_tot = Double.Parse(dtg_grand_totals.Items(0).Cells(0).Text)
But you MUST do this AFTER you do the databind to the Second datagrid.
I found that there is an aftermarket tool by Infragistics that allows much more freedom with doing this type of code. In the Infragistics webgrid, the code was:
pd_col_10_grnd_tot = utg_grand_tot.Rows(0).Cells(0).Value
Why oh why can't Microsoft be as easy to use? I spent about eight hours researching, testing, trying PreRender,compute column, .ToString, etc... EVERYTHING I could think of and the answer was extremely simple using the Infragistics UltraWebGrid, but although similar, it was not until I tried using the UWG that I discovered how to get this to work for me using .Net's Datagrid!!!
Coleen