Windows Form Datagrid
-
:confused:What property controls the initial visible default state of a datagrid? My application fills a datagrid during form load from a oledb database query. When the form is loaded the datagrid is blank except for a cell with a + sign Once the + is clicked then a second cell is shown containing a link. After the link is clicked the grid then is filled with the data. How can I programmatically complete the first two clicks so that when the form is loaded the user sees a full grid of data instead of having to click on the + and then on the link. Thanks so much Milancie
-
:confused:What property controls the initial visible default state of a datagrid? My application fills a datagrid during form load from a oledb database query. When the form is loaded the datagrid is blank except for a cell with a + sign Once the + is clicked then a second cell is shown containing a link. After the link is clicked the grid then is filled with the data. How can I programmatically complete the first two clicks so that when the form is loaded the user sees a full grid of data instead of having to click on the + and then on the link. Thanks so much Milancie
Hi There What does your code look like, if I use the following the grid immediately shows all the data (I think it may be from using a DataTable or not?) Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click Dim oDA As SqlClient.SqlDataAdapter Dim oCon As SqlClient.SqlConnection = New SqlClient.SqlConnection Dim oTBL As DataTable = New DataTable oCon.ConnectionString = "Initial Catalog = Northwind;Data Source = (local);uid = sa;pwd=;" Try oCon.Open() Catch ex As Exception MessageBox.Show(ex.ToString) End Try oDA = New SqlClient.SqlDataAdapter("Select * from Customers", "Initial Catalog = Northwind;Data Source = (local);uid = sa;pwd=;") oDA.Fill(oTBL) Me.DataGrid1.DataSource = oTBL End Sub Regards Peet Schultz