I have a DataGridView item on my form, and when I add an item to it, it doesn't add an extra row to add new items.
Here is the code I use to load a file dialog box:
Once a file is chosen, I use the following to add it to the grid:Code:Private Sub Loader_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Loader.Click If loadFile.ShowDialog Then loadData(loadFile.FileName) End If End Sub
It loads it to the gird, and doesn't automatically add a second empty row.Code:Private Sub loadData(ByVal fileLocation As String) Dim fileName = GetFileNameWithoutExtension(fileLocation) Dim outputLocation = System.IO.Path.GetDirectoryName(fileLocation) Dim rowCount = Files.RowCount Dim good = True Dim i = rowCount - 1 Files.Item(1, i).Value = fileLocation Files.Item(2, i).Value = outputLocation Files.Item(3, i).Value = fileName End Sub
The only way for me to add another row, is by typing into one of the fields in the column, and it adds the next row for me.
How can I get it to add the other row without me having to type into the field?
If that doesn't make sense, please let me know!
Thanks for the Help!




Reply With Quote