If ViewState("CurrentTable") IsNot Nothing Then Dim dtCurrentTable As DataTable = DirectCast(ViewState("CurrentTable"), DataTable) Dim drCurrentRow As DataRow = Nothing If dtCurrentTable.Rows.Count > 0 Then For i As Integer = 1 To dtCurrentTable.Rows.Count Dim txtfunob As TextBox = DirectCast(grv_set_func_obj.Rows(rowIndex).Cells(1).FindControl("txtfuncobj"), TextBox) Dim txtmeasur As TextBox = DirectCast(grv_set_func_obj.Rows(rowIndex).Cells(2).FindControl("txtmeasuredvar"), TextBox) Dim txtd_line As TextBox = DirectCast(grv_set_func_obj.Rows(rowIndex).Cells(3).FindControl("txtdeadline"), TextBox) Dim txtwtfact As TextBox = DirectCast(grv_set_func_obj.Rows(rowIndex).Cells(4).FindControl("txtweight_fact"), TextBox) Dim temp As String = txtwtfact.Text.ToString tot = tot + Convert.ToDouble(temp) 'count = count + 1 'MsgBox(count) MsgBox(tot) If tot = 1.0F Then lbltot.Visible = True lbltot.Text = " Your weighting factor becomes one.." End If If tot > 1.0F Then lbltot.Visible = True lbltot.Text = " Your weighting factor exceeds one.." Else lbltot.Visible = False End If drCurrentRow = dtCurrentTable.NewRow() drCurrentRow("RowNumber") = i + 1 dtCurrentTable.Rows(i - 1)("Col1") = txtfunob.Text dtCurrentTable.Rows(i - 1)("Col2") = txtmeasur.Text dtCurrentTable.Rows(i - 1)("Col3") = txtd_line.Text dtCurrentTable.Rows(i - 1)("Col4") = txtwtfact.Text rowIndex += 1 Next dtCurrentTable.Rows.Add(drCurrentRow) ViewState("CurrentTable") = dtCurrentTable grv_set_func_obj.DataSource = dtCurrentTable grv_set_func_obj.DataBind() Dim txtfnobj As TextBox = DirectCast(grv_set_func_obj.Rows(rowIndex).Cells(1).FindControl("txtfuncobj"), TextBox) txtfnobj.Focus() End If
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)