Calculating Fields in an ASP Table using VB.Net

  • Thread starter Thread starter coleenholley
  • Start date Start date
C

coleenholley

Ok, after all the research on datagrids, I've found that they won't really work for what I'm trying to do...I have a table that I need to have three columns as static data (but each row has a different value) and two other columns that have to do calculations, and a summary row/footer at the bottom of the table.

I guess maybe I'm stupid, because even with the help and information I've been given, how to populate each static column with different data in each row - I don't get! So, I've gone back to an ASP Table that I can hard-code the columns with the static data and do the calculations. My question is, does anyone have an easy way to do my calculation columns and footer in the table? TIA

Coleen
 
Hi Coleen

I think you just have to think this over.

In a normal table is a calculation and footer row in my opinion only
something that is put on the page after normal calculations, maybe only some
other design but that is than normal HTML and maybe CSS,

Or am I seeing something wrong?

Cor
Ok, after all the research on datagrids, I've found that they won't really
work for what I'm trying to do...I have a table that I need to have three
columns as static data (but each row has a different value) and two other
columns that have to do calculations, and a summary row/footer at the bottom
of the table.
I guess maybe I'm stupid, because even with the help and information I've
been given, how to populate each static column with different data in each
row - I don't get! So, I've gone back to an ASP Table that I can hard-code
the columns with the static data and do the calculations. My question is,
does anyone have an easy way to do my calculation columns and footer in the
table? TIA
 
Thanks Cor - I need to do calculations in three Columns AND in the footer. I know this probably won't turn out but here is what I need:

Column1 Column2 Column3 Column4 Column5 Column5
Data Data Data Calc Data Calc
in this Data Data Calc Data Calc
Column Data Data Calc Data Calc
is hard Data Data Calc Data Calc
coded Data Data Calc Data Calc
and Data Data Calc Data Calc
different Data Data Calc Data Calc

Totals Sum Sum Sum Sum Sum

I need to do calculations in at least two columns AND a Footer. I think this could be done in a datagrid, but I don't know how to hard code Column1 - This column has different data for each row HARD coded. Ugh! Any suggestions? There's a lot going on in this table, it's all read only (for THIS table) so I was hoping to use a datagird. Thanks for any/all help :-) Coleen
 
Hi Colleen,

You said you did research on the datagrid,

Why are you not building your own datatable I think that will work, it is
not that hard to do
I type it here roughy
\\\
dim dt as new datatabel("Coleen")
dim dc1 as new datacolomn("Column1")
dt.columns.add(dc1)
dim dc2 as new datacolomn("Column2")
dt.columns.add(dc2)
till 5 than you can fill the table with all you want (but have a look at
datacolumn you can do more)


If you did this you can do to file a field as second item in the third row
dt.rows(2).item("Column2) =mydata or text
or just as I do
dt.rows(2)(1) = mydata or text
And than
datagrid1.datasource = dt
etc.
////

I hope this helps?

Cor
Thanks Cor - I need to do calculations in three Columns AND in the footer.
I know this probably won't turn out but here is what I need:
Column1 Column2 Column3 Column4 Column5 Column5
Data Data Data Calc Data Calc
in this Data Data Calc Data Calc
Column Data Data Calc Data Calc
is hard Data Data Calc Data Calc
coded Data Data Calc Data Calc
and Data Data Calc Data Calc
different Data Data Calc Data Calc

Totals Sum Sum Sum Sum Sum

I need to do calculations in at least two columns AND a Footer. I think
this could be done in a datagrid, but I don't know how to hard code
Column1 - This column has different data for each row HARD coded. Ugh! Any
suggestions? There's a lot going on in this table, it's all read only (for
THIS table) so I was hoping to use a datagird. Thanks for any/all help :-)
Coleen
 
Hi Cor :-

Actually, I did create a complete ASP Table...I just found that I will need to do my calculations all the way down for two columns and still have to create a sum total in the footer. If I do the table, then I have a LOT of code to get each column(0).row(0) and so on for everycolumn and row in the table. I like your suggestion, if I understand it correctly, instead of giving the value of the variable for the columns, I give it a text value and hard code it? Thanks - I will try that tommorrow when I get back to my office. Thanks a lot for your help :-

Coleen
 
Back
Top