Solution to ARGH! ...

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
 
C

Coleen

Well, I spoke to soon again, because I still get the Infinity in all the rows where I tried to use the variable I got from the second datagrid, although I now know how to get the value from .Net's datagrid almost as easily as from Infragistic's WebGrid. I am going to have to create another datagrid to use to do all the calculations using the Grand total amount and make sure to call the variables from my first datagrid After I do the databind. It really seams as though there would be an easier way to do this. It can be done SO easily in Excel, that it is frustrating NOT to be able to do the same thing in .Net or any other language!
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
 
C

Cor Ligthert

Coleen,

See my sample in the second thread about this (while this is the thirth, so
please keep in the original threads).

Cor
 
O

One Handed Man \( OHM - Terry Burns \)

I agree, the DataGrid is crap.

In VS2005, a lot of these types of issues are removed with a new control called GridView. I know that doesent help you now, but have some faith that MS are addressing these issues. VS2005 is a 'Vast' improvement over VS2003.



--

OHM ( Terry Burns )
. . . One-Handed-Man . . .
If U Need My Email ,Ask Me

Time flies when you don't know what you're doing

Well, I spoke to soon again, because I still get the Infinity in all the rows where I tried to use the variable I got from the second datagrid, although I now know how to get the value from .Net's datagrid almost as easily as from Infragistic's WebGrid. I am going to have to create another datagrid to use to do all the calculations using the Grand total amount and make sure to call the variables from my first datagrid After I do the databind. It really seams as though there would be an easier way to do this. It can be done SO easily in Excel, that it is frustrating NOT to be able to do the same thing in .Net or any other language!
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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top