Rattlesnake
Freshman
- Joined
- Dec 23, 2003
- Messages
- 47
Hi,
I have a ASP.net form that has datagrid that is used to enter the timereport for employees.
The datagrid has 4 columns for 150% Overtime,200%OVertime,Annual Leave,Sick Leave
The datagrid will have 28,30 or 31 rows depending on the month for which the time report is.
The columns are TemplateColumns that have textboxes .
I want to create a CLIENT SIDE script that will automtically calculate the totals for each column in the time report. (It
should calculate without postbacks)
The text names are txtOT150,txtOT200,txtAnnualLeave,txtSickLeave.
How can I create this client side script? I know this will have to be done at the Datagrid_ItemDataBound event and then use
RegisterStartupScript method.
I have the following code ready in the Datagrid_ItemDataBound event . What I need is the code to create the javascipt.
Dim txtOT150 As New TextBox
Dim txtOT200 As New TextBox
Dim txtAnnualLeave As New TextBox
Dim txtSickLeave As New TextBox
txtOT150 = CType(e.Item.Cells(1).FindControl("txtCost"), TextBox)
txtOT200= CType(e.Item.Cells(iPriceCol).FindControl("txtCost"), TextBox)
txtAnnualLeave = CType(e.Item.Cells(1).FindControl("txtCost"), TextBox)
txtSickLeave = CType(e.Item.Cells(1).FindControl("txtCost"), TextBox)
Thanks
I have a ASP.net form that has datagrid that is used to enter the timereport for employees.
The datagrid has 4 columns for 150% Overtime,200%OVertime,Annual Leave,Sick Leave
The datagrid will have 28,30 or 31 rows depending on the month for which the time report is.
The columns are TemplateColumns that have textboxes .
I want to create a CLIENT SIDE script that will automtically calculate the totals for each column in the time report. (It
should calculate without postbacks)
The text names are txtOT150,txtOT200,txtAnnualLeave,txtSickLeave.
How can I create this client side script? I know this will have to be done at the Datagrid_ItemDataBound event and then use
RegisterStartupScript method.
I have the following code ready in the Datagrid_ItemDataBound event . What I need is the code to create the javascipt.
Dim txtOT150 As New TextBox
Dim txtOT200 As New TextBox
Dim txtAnnualLeave As New TextBox
Dim txtSickLeave As New TextBox
txtOT150 = CType(e.Item.Cells(1).FindControl("txtCost"), TextBox)
txtOT200= CType(e.Item.Cells(iPriceCol).FindControl("txtCost"), TextBox)
txtAnnualLeave = CType(e.Item.Cells(1).FindControl("txtCost"), TextBox)
txtSickLeave = CType(e.Item.Cells(1).FindControl("txtCost"), TextBox)
Thanks