Textbox Sum

B

BD

I have a windows form bound to 2 tables. Main table is orders for one
customer, second table is for line items related to one customer's
order. The second table is bound to datagridview where I have created
local column (Sub-Total) to multiply unitprice by quantity. I want to
place a textbox (Total) to SUM the 'sub-total' column records related
to one customer. Any help is appreciated.
 
N

Nicholas Paldino [.NET/C# MVP]

BD,

I would create another table in your dataset which is related to the
tables with the sub-total column. In that table, I would have one row with
a calculated column which is the sum of the sub-totals.

Then, all you have to do is bind the textbox to the row and column in
the new table you created.
 
B

BD

BD,

I would create another table in your dataset which is related to the
tables with the sub-total column. In that table, I would have one row with
a calculated column which is the sum of the sub-totals.

Then, all you have to do is bind the textbox to the row and column in
the new table you created.

--
- Nicholas Paldino [.NET/C# MVP]
- (e-mail address removed)


I have a windows form bound to 2 tables. Main table is orders for one
customer, second table is for line items related to one customer's
order. The second table is bound to datagridview where I have created
local column (Sub-Total) to multiply unitprice by quantity. I want to
place a textbox (Total) to SUM the 'sub-total' column records related
to one customer. Any help is appreciated.

Forgive me, how would I write the calculation expression? I had
thought of this, but the expression threw me.
 
B

BD

BD,

I would create another table in your dataset which is related to the
tables with the sub-total column. In that table, I would have one row with
a calculated column which is the sum of the sub-totals.

Then, all you have to do is bind the textbox to the row and column in
the new table you created.

--
- Nicholas Paldino [.NET/C# MVP]
- (e-mail address removed)


I have a windows form bound to 2 tables. Main table is orders for one
customer, second table is for line items related to one customer's
order. The second table is bound to datagridview where I have created
local column (Sub-Total) to multiply unitprice by quantity. I want to
place a textbox (Total) to SUM the 'sub-total' column records related
to one customer. Any help is appreciated.

Nicholas,

I thought about the addition of a table like you said. However, not
sure about how to do the calculation expression.
 
N

Nicholas Paldino [.NET/C# MVP]

BD,

Check the documentation for the Expression property on the DataColumn
class to see how to write an expression for the sum of the fields on the
related table.


--
- Nicholas Paldino [.NET/C# MVP]
- (e-mail address removed)

BD said:
BD,

I would create another table in your dataset which is related to the
tables with the sub-total column. In that table, I would have one row
with
a calculated column which is the sum of the sub-totals.

Then, all you have to do is bind the textbox to the row and column in
the new table you created.

--
- Nicholas Paldino [.NET/C# MVP]
- (e-mail address removed)


I have a windows form bound to 2 tables. Main table is orders for one
customer, second table is for line items related to one customer's
order. The second table is bound to datagridview where I have created
local column (Sub-Total) to multiply unitprice by quantity. I want to
place a textbox (Total) to SUM the 'sub-total' column records related
to one customer. Any help is appreciated.

Nicholas,

I thought about the addition of a table like you said. However, not
sure about how to do the calculation expression.
 
B

BD

BD,

I would create another table in your dataset which is related to the
tables with the sub-total column. In that table, I would have one row with
a calculated column which is the sum of the sub-totals.

Then, all you have to do is bind the textbox to the row and column in
the new table you created.

--
- Nicholas Paldino [.NET/C# MVP]
- (e-mail address removed)


I have a windows form bound to 2 tables. Main table is orders for one
customer, second table is for line items related to one customer's
order. The second table is bound to datagridview where I have created
local column (Sub-Total) to multiply unitprice by quantity. I want to
place a textbox (Total) to SUM the 'sub-total' column records related
to one customer. Any help is appreciated.

Forgive me, how would I write the calculation expression? I had
thought of this, but the expression threw me.
 

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

Similar Threads


Top