Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. Visual Basic
  4. Windows Form Datagrid

Windows Form Datagrid

Scheduled Pinned Locked Moved Visual Basic
databasequestioncss
2 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • M Offline
    M Offline
    Milancie
    wrote on last edited by
    #1

    :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

    P 1 Reply Last reply
    0
    • M 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

      P Offline
      P Offline
      Peet Schultz
      wrote on last edited by
      #2

      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

      1 Reply Last reply
      0
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      • Login

      • Don't have an account? Register

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • World
      • Users
      • Groups