Results 1 to 5 of 5

Thread: Datagrid expand on load ****resolved******

Threaded View

  1. #1

    Thread Starter
    Addicted Member Halon's Avatar
    Join Date
    Oct 2002
    Location
    under desk choking on rage
    Posts
    228

    Datagrid expand on load ****resolved******

    I have a datagrdid on my form, on page load it calls a function to connect to a sql db and populate it as shown in the code below.
    Code:
    Dim myDataSet As New DataSet()
            Dim connString As String = SQL_CONNECTION_STRING
            Dim cnn As SqlConnection = New SqlConnection(connString)
            Dim myCommand As SqlCommand = New SqlCommand("Select * FROM Orders", cnn)
            myCommand.CommandType = CommandType.Text
            cnn.Open()
    
            Dim myDataAdapter As SqlDataAdapter = New SqlDataAdapter(myCommand)
            Try
                myDataAdapter.Fill(myDataSet, "Employees")
            Catch
                MsgBox("Error in connecting to database. Call Computer about to implode!!")
            End Try
    
            cnn.Close()
    
            dgEmployees.DataSource = myDataSet
    All works fine, problem is, i have to click on a node to open up the table to show all records. I want it to open with the datagrid completely expanded.

    I do this in other apps but i bind all columns etc at design time, the table i am sending in changes dynamically, i just want to display all the data without having the user click on a plu sign to expand the table.

    i have tried
    Code:
    dgEmployees.DataSource = myDataSet.DefaultViewManager
    but to no avail


    Any ideas?
    Last edited by Halon; May 2nd, 2003 at 10:27 AM.
    Soylent Green tastes like chicken

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width