Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Datagrid calculations

Status
Not open for further replies.

mikemardon

Programmer
May 23, 2005
71
GB
Is there a way I can perform calculations on cells in subsequent rows in a datagrid based on the input into a specific cell on the original row?

I have created a grid and have my fields in place, each cell contains a textbox control - some are for user input and others are not user editable.

For example, if the user changes the value in Row 0,Cell 2 to '1' I need this to subtract '1' from the total (cell 4) in every other row below.

Does this make sense?
 
You shoule be able to use a combination of the ItemCreated and ItemDataBound events of the datagrid to calculate any sums and create a total (this could either be in a footer row of the datagrid or simply a label).


____________________________________________________________

Need help finding an answer?

Try the Search Facility or read FAQ222-2244 on how to get better results.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top