Last post Dec 01, 2017 06:11 PM by skeeneyman
Dec 01, 2017 04:04 PM|skeeneyman|LINK
I'm trying to figure out a way fill a gridview with data, count the number of rows the data generated Let's SAY 3, compare the number of rows to the number of rows the gridview MUST GENERATE let's say 5, then dynamically generate and append the 2 missing
rows to the bottom of the gridview with empty text boxes and a submit button. I've been searching the internet for a solution but everything I see wants there to be an "Add Row" button in the footer. I feel certain this is not only doable but is probably pretty
common. I just don't seem to be asking the right questions.
Thanks in advance
Dec 01, 2017 06:11 PM|skeeneyman|LINK
It seems I managed to figure it out myself. The below code adds 4 additional rows to the gridview.
Dim dt As New DataTable()
Dim ad As New SqlDataAdapter(sqlCommand)
Dim ds As New DataSet
dt = ds.Tables(0)
For i As Integer = 0 To 3
Dim dr As DataRow = dt.NewRow
dr("EMPLOYEE_NAME") = "VACANT"
dr("IsFcsEmployee") = 0
GvStaffing.DataSource = dt