My program is updating the size of a asp:Table (both rows and columns)
This is using the standard logic as is suggested by the Help
as in the example under "How to: Add Rows and Cells Dynamically to a
Table Web Server Control"
The table size increases on the screen, but when my program looks at
Table, the number of rows and columns do not change. When my program
tries
to access the new rows, it gets a space out of range.

Sub FR (sender as Object, e as EventARgs)

    NumberOfRows = txtFR.text
    NumberOfColumns = txtFR.text
        Dim RR As Random
        RR = New Random
     T.Rows.Clear()
    for I = 0  to NumberOfRows - 1
       dim r as TableRow
       r = new TableRow()
       For J = 0 to NumberOfColumns - 1
          Dim C as TableCell
          C = New TableCell()
                v = RR.Next(0, 9)
          C.text = V
          r.Cells.add(C)
       Next J
            T.Rows.Add(r)

        Next I

    end sub

I tried putting at the end
        T.EnableViewState = False
That makes things worse, the table goes back to the original value.

I also tried removing the data from the Table Grid in the default.aspx
file.  That did not help.  I also tried setting
EnableViewState="false"
in the Default.aspx file which did not help either.

This is what I am doing to find out how many rows and columns my table
has
        NumberOfRows = T.Rows.Count()
        NumberOfColumns = T.Rows(1).Cells.Count()


here is the table from Default.aspx

<asp:table id="T" Font-Size="24" runat="server" GridLines="Both">
<asp:TableRow>
  <asp:TableCell>3</asp:TableCell><asp:TableCell>4</asp:TableCell>
  <asp:TableCell>7</asp:TableCell>
</asp:TableRow>
<asp:TableRow>
   <asp:TableCell>5</asp:TableCell><asp:TableCell>5</asp:TableCell>
  <asp:TableCell>8</asp:TableCell>
</asp:TableRow>
<asp:TableRow>
<asp:TableCell>12</asp:TableCell><asp:TableCell>4</asp:TableCell>
<asp:TableCell>9</asp:TableCell>
</asp:TableRow>
</asp:table>
<table >

Dr. Laurence Leff  Western Illinois University, Macomb IL 61455 ||
(309) 298-1315
Stipes 447 Assoc. Prof. of Computer Sci. Pager: 309-367-0787 FAX:
309-298-2302

Reply via email to