GridView rowDataBound eventThe rowDataBound event is raised for each row rendered by the GridView control after the GridView control is bound to its data source. The below code demonstrates how to calculate the total of amounts in the credit amount and debit amount columns. The current row's RowType property is checked to verify that the row is a DataRow. If the current row is a DataRow, we can add the amounts in the debit and credit columns separately.
The below code demonstrates how to use the DataItem property to access the properties of the data object in rowDataBound event of the GridView control.
The _tcamt and _tdamt variables are used to hold the running totals for the Credit and Debit fields respectively.
private int _tcamt = 0; private int _tdamt = 0;
Become an Expert
People also viewed: Create your own ERP Software using ASP Core>>