I have used the following code to display data from Text Boxes and combo boxes to a Grid View without saving the data to the database. When I enter the data in the Text Boxes, and click on the Button, those values will be displayed in the Grid view. It is working as expected without any errors.
But I want to tweak the code a bit so that the Grid View should be able to add new data from the Text boxes by retaining the old data as it is in the Grid view (multiple rows should be displayed in the Grid view instead of single rows).
It is an desktop application, I'm using visual basics and visual studio 2012. My code so far:
Public Sub DataTabel_TblDetali()
Dim TblDetali As New DataTable()
TblDetali.Columns.Add("BrojBaranje", GetType(String))
TblDetali.Columns.Add("RedBroj", GetType(Integer))
TblDetali.Columns.Add("Apoen", GetType(Decimal))
TblDetali.Columns.Add("Evidenciski_Broj", GetType(String))
TblDetali.Columns.Add("InventarenBroj", GetType(String))
TblDetali.Columns.Add("OznakaSerija", GetType(String))
TblDetali.Columns.Add("VidSeriskiBroj", GetType(String))
TblDetali.Columns.Add("GodinaIzdavanje", GetType(String))
TblDetali.Columns.Add("BrojParcinja", GetType(Integer))
TblDetali.Columns.Add("SeriskiBroj1", GetType(String))
TblDetali.Columns.Add("SeriskiBroj2", GetType(String))
TblDetali.Columns.Add("BrojIndikativ", GetType(String))
TblDetali.Columns.Add("TipKlasa", GetType(String))
TblDetali.Columns.Add("TipReprodukcija", GetType(String))
TblDetali.Columns.Add("BrojNalog", GetType(String))
Dim RedenBroj As Integer = 0
TblDetali.Rows.Add(BrojBaranje, RedenBroj + 1, Apoen, EvidenciskiBroj, InventarenBroj, OznakaZaSerija, VidSeriskibroj, GodinaIzdavanje, BrojParcinja, SeriskiBroj1, SeriskiBroj2, BrojIndikativ, TipKlasa, TipReprodukcija, "")
grdDetaliVnos.DataSource = TblDetali
RedenBroj = RedenBroj + 1