Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>I did this on a previous job, but since you can add rows, I always had it visible in the footer row. To make it so that the grid shows up, I bound an empty row of the type that is normally bound </p> <pre><code>dim row as Datarow = table.NewRow() table.AddRow(row) gridView.DataSource = table gridView.Databind() </code></pre> <p>then it has all the columns and then you need. You can access the footer by pulling this:</p> <pre><code>'this will get the footer no matter how many rows there are in the grid. Dim footer as Control = gridView.Controls(0).Controls(gridView.Controls(0).Controls.Count -1) </code></pre> <p>then to access any of the controls in the footer you would go and do a:</p> <pre><code>Dim cntl as Control = footer.FindControl(&lt;Insert Control Name Here&gt;) </code></pre> <p>I'd assume you'd be able to do a:</p> <pre><code>footer.Visible = false </code></pre> <p>to make the footer row invisible.</p> <p>I hope this helps!</p> <p><em>Edit</em> I just figured out what you said. I basically delete the row when I add a new one, but to do this you need to check to see if there are any other rows, and if there are, check to see if there are values in it. </p> <p>To delete the dummy row do something like this: </p> <pre><code>If mTable.Rows.Count = 1 AndAlso mTable.Rows(0)(&lt;first column to check for null value&gt;) Is DBNull.Value AndAlso mTable.Rows(0)(&lt;second column&gt;) Is DBNull.Value AndAlso mTable.Rows(0)(&lt;thrid column&gt;) Is DBNull.Value Then mTable.Rows.Remove(mTable.Rows(0)) End If mTable.Rows.Add(row) gridView.Datasource = mTable gridView.Databind() </code></pre>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload