Thanks for the response.
I believe the expression is: PBCK - "Problem Between Chair and Keyboard"
I was using multiple template types in the gridview, and during table row add, didn't include record type. Never finding record type, gridview wisely declined to display that row.
So, problem solved.
For an example of a test bed for using datatable as object data source, adding to it, and seeing the add row displayed, here's this.
===========PAGE================
<%@ Page Language="VB" AutoEventWireup="false" CodeFile="AppTestManager.aspx.vb" Inherits="MemberPages_AppTestManager_Default" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "
<html xmlns="
>
<head runat="server">
<title>Untitled Page</title>
<link href="../../MemberPages/CSS/Standard.css" rel="stylesheet" type="text/css" />
<script language="javascript" type="text/javascript">
<!--
function Button2_onclick() {
//alert("html button click")
document.getElementById("Hidden1").value = "AddRow"
document.forms[0].submit()
}
// -->
</script>
</head>
<body>
<form id="form1" runat="server">
<div>
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<asp:Button ID="Button1" runat="server" Style="z-index: 100; left: 320px; position: absolute;
top: 16px" Text="MakeTable" Width="72px" />
<br />
<input id="Button2" style="z-index: 104; left: 288px; width: 164px; position: absolute;
top: 144px" type="button" value="AddRow HTML Submit" language="javascript" onclick="return Button2_onclick()" />
<br />
</div>
<asp:GridView ID="GridView1" runat="server" DataSourceID="ObjectDataSource1" Style="z-index: 102;
left: 8px; position: absolute; top: 12px" Width="216px">
</asp:GridView>
<asp:Button ID="Button3" runat="server" Text="AddRow" style="z-index: 103; left: 320px; position: absolute; top: 100px" />
<asp:ObjectDataSource ID="ObjectDataSource1" runat="server" SelectMethod="GetTestTable"
TypeName="TestTable"></asp:ObjectDataSource>
<asp:HiddenField ID="Hidden1" runat="server" />
</form>
</body>
</html>
==================
================== CODE BEHIND
Imports System.Diagnostics
Imports System.data
Partial Class MemberPages_AppTestManager_Default
Inherits System.Web.UI.Page
Public AC = System.Web.HttpContext.Current.Application
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
'MsgBox("page load")
Debug.WriteLine("---------------------PAGE LOAD--------------------")
If IsPostBack Then
Debug.WriteLine("---------------------IS POSTBACK --------------------")
If Me.Hidden1.Value = "AddRow" Then
AddNewFromPageCB()
Me.Hidden1.Value = ""
End If
End If
End Sub
Protected Sub Button3_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button3.Click
Debug.WriteLine("---------------------ASP ADD ROW BUTTON--------------------")
'MsgBox("add row from asp button")
Dim exe As New TestTable
exe.AddTableRow()
Dim wrkTable As DataTable = AC("TestTable")
Debug.WriteLine("-------JUST AFTER ADD ROW BEFOR DATABIND------")
For n1 As Integer = 0 To wrkTable.Rows.Count - 1
Dim wrkR As DataRow = wrkTable.Rows(n1)
For n2 As Integer = 0 To wrkR.ItemArray.Length - 1
Debug.Write(wrkR.Item(n2).ToString & " ")
Next
Debug.WriteLine("")
Next
Debug.WriteLine("-----------------------------------")
Me.GridView1.DataBind()
End Sub
Protected Sub Button1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button1.Click
Debug.WriteLine("---------------------MAKE TABLE BUTTON --------------------")
'MsgBox("make table")
Dim exe As New TestTable
exe.MakeTestTable()
Me.GridView1.DataBind()
End Sub
Public Sub AddNewFromPageCB()
Debug.WriteLine("---------------------HTML ADD ROW BUTTON--------------------")
'MsgBox("add row from html button")
Dim exe As New TestTable
exe.AddTableRow()
Dim wrkTable As DataTable = AC("TestTable")
Debug.WriteLine("--From HTML Button------")
For n1 As Integer = 0 To wrkTable.Rows.Count - 1
Dim wrkR As DataRow = wrkTable.Rows(n1)
For n2 As Integer = 0 To wrkR.ItemArray.Length - 1
Debug.Write(wrkR.Item(n2).ToString & " ")
Next
Debug.WriteLine("")
Next
Debug.WriteLine("-----------------------------------")
Me.GridView1.DataBind()
End Sub
End Class
==================
================== CUSTOM CLASS
Imports Microsoft.VisualBasic
Imports System.Data
Imports System.Data.Common
Imports System.Diagnostics
Imports System.IO
Imports System.Data.OleDb
Imports System.Data.Common.DbConnection
Public Class TestTable
Public AC = System.Web.HttpContext.Current.Application
Public Sub MakeTestTable()
'MsgBox("making table")
Dim TestTable As DataTable = New DataTable("TestTable")
Dim wrkArr1 As New ArrayList ' name
Dim wrkArr2 As New ArrayList ' type
Dim wrkArr3 As New ArrayList ' default value
'--------------------fill arrays with particulars
For n As Integer = 1 To 5
wrkArr1.Add("Field" & Trim(Str

)) : wrkArr2.Add("String") : wrkArr3.Add("")
Next
'------------------------convert arrays to datatable columns
For n As Integer = 0 To wrkArr1.Count - 1
Dim wrkColumn As DataColumn = New DataColumn
wrkColumn.DataType = System.Type.GetType("System." & wrkArr2

)
wrkColumn.AllowDBNull = True
wrkColumn.Caption = wrkArr1

wrkColumn.ColumnName = wrkArr1

wrkColumn.DefaultValue = wrkArr3

TestTable.Columns.Add(wrkColumn)
Next
TestTable.Constraints.Clear()
For n As Integer = 1 To 5
Dim wrkRow As DataRow = TestTable.NewRow
Dim wrkVal As String = ""
For n1 As Integer = 1 To 5
wrkVal = wrkVal & Mid("ABCDEF", n, 1)
Next
For n2 As Integer = 0 To 4
wrkRow.Item(n2) = wrkVal
Next
TestTable.Rows.Add(wrkRow)
Next
AC.Lock()
AC("TestTable") = TestTable
AC.UnLock()
'------------debug.write table content
Debug.WriteLine("---------AFTER MAKE TABLE ------------")
For n1 As Integer = 0 To TestTable.Rows.Count - 1
Dim wrkR As DataRow = TestTable.Rows(n1)
For n2 As Integer = 0 To wrkR.ItemArray.Length - 1
Debug.Write(wrkR.Item(n2).ToString & " ")
Next
Debug.WriteLine("")
Next
Debug.WriteLine("-----------------------------------")
End Sub
Public Sub AddTableRow()
Dim TestTable As DataTable = AC("TestTable")
Dim wrkRow As DataRow = TestTable.NewRow
For n1 As Integer = 0 To 4
wrkRow.Item(n1) = Mid("ABCDEFGHJKLMNOP", n1 + 1, 4)
Next
TestTable.Rows.Add(wrkRow)
Debug.WriteLine("---------AFTER ADD ROW-------")
For n1 As Integer = 0 To TestTable.Rows.Count - 1
Dim wrkR As DataRow = TestTable.Rows(n1)
For n2 As Integer = 0 To wrkR.ItemArray.Length - 1
Debug.Write(wrkR.Item(n2).ToString & " ")
Next
Debug.WriteLine("")
Next
Debug.WriteLine("-----------------------------------")
End Sub
Public Function GetTestTable() As DataTable
Dim wrkTable As DataTable = AC("TestTable")
Debug.WriteLine("-------DURING GET TABLE------")
For n1 As Integer = 0 To wrkTable.Rows.Count - 1
Dim wrkR As DataRow = wrkTable.Rows(n1)
For n2 As Integer = 0 To wrkR.ItemArray.Length - 1
Debug.Write(wrkR.Item(n2).ToString & " ")
Next
Debug.WriteLine("")
Next
Debug.WriteLine("-----------------------------------")
Return wrkTable
End Function
End Class