hi
i have 5 datagridview in my form . i create a Sub to fill all these 3 datagridview.i want this sub also set the visibility of 3 first row of these datagridviews to false . here is my code :
the problem is that in 2 first dgv (dgv1 and dgv2) the visibility of first row (rows(0)) dont set to false.the visibility of rows(1) and rows(2) is set to false and is ok . only the visibility of all 3 rows of last dgv (dgv3) is false and ok.
can you help me ?
i have 5 datagridview in my form . i create a Sub to fill all these 3 datagridview.i want this sub also set the visibility of 3 first row of these datagridviews to false . here is my code :
VB.NET:
Public cn As New System.Data.SqlClient.SqlConnection
Public DA As SqlDataAdapter
Public DT As New DataTable()
Public SqlCommandBuilder As SqlCommandBuilder
Public Sub FillDataGridViews(ByVal dgv As DataGridView)
cn.ConnectionString = "Data Source=pooyan-pc\SQLEXPRESS;Initial Catalog=Faravaresh Produce Control;UID=pooya1072;password=ahmadreza"
NFFeedDataAdapter = New SqlDataAdapter("select * from T1", cn)
NFFeedDataAdapter.FillSchema(NFFeedDataTable, SchemaType.Source)
NFFeedDataAdapter.Fill(NFFeedDataTable)
SqlCommandBuilder = New SqlCommandBuilder(NFFeedDataAdapter)
dgv.DataSource = NFFeedDataTable
dgv.CurrentCell = Nothing
dgv.Rows(0).Visible = False
dgv.Rows(1).Visible = False
dgv.Rows(2).Visible = False
End Sub
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
FillDataGridViews(dgv1)
FillDataGridViews(dgv2)
FillDataGridViews(dgv3)
End Sub
can you help me ?