|
-
July 10th, 2007, 09:51 PM
#1
datagridview help with basics[resolved]
Hi I am just starting to learn the advanced parts of VB....this datagridview is new to me and I have no idea how to use it properly. Right now when I need to input data into the dgv, I have to do this:
If vdgv = 0 Then
dt.Columns.Add("Item")
dt.Columns.Add(" ")
dt.Columns.Add("Particulars")
dt.Columns.Add("QTY")
vdgv = 1
End If
The counter stops the program from adding the headers twice. I then input the data with this
dgv1.DataSource = dt
dt.Rows.Add(New Object() {"", txtquan.Text, txtfin.Text, ""})
dgv1.CurrentCell = dgv1.Rows(0).Cells(0)
---------------------------------------------------------------------------------------------
Is there a proper way for me to add the columns before hand and not have it in the coding???I can add the columns manually but I have no idea how to input the data in....Thanks for your help!!
Last edited by quantzie; July 16th, 2007 at 07:47 PM.
Reason: problem resolved
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|