Datagrid


DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 2 of 2

Thread: Datagrid

  1. #1
    Holly Guest

    Datagrid


    After i display data from Database in datagrid, how could i place the cursor
    at the first column in datagrid in sub form_load?

    Many many thanks!

    Holly

  2. #2
    Jeff Johnson Guest

    Re: Datagrid


    "Holly" <Holly248@hotmail.com> wrote:
    >
    >After i display data from Database in datagrid, how could i place the cursor
    >at the first column in datagrid in sub form_load?
    >
    >Many many thanks!
    >
    >Holly


    The cursor seems to end up in the row 1, column 1 datagrid textbox on its
    on....

    Maybe you need to make sure the Datagrid has the lowest Tab Index of all
    the controls on your form??


    Dim dt As New DataTable()

    dt.Columns.Add(New System.Data.DataColumn("Field1"))
    dt.Columns.Add(New System.Data.DataColumn("Field2"))

    Dim r As DataRow
    r = dt.NewRow
    r("Field1") = 2
    r("Field2") = 6
    dt.Rows.Add(r)

    Dim r2 As DataRow
    r2 = dt.NewRow
    r2("Field1") = 8
    r2("Field2") = 45
    dt.Rows.Add(r2)

    DataGrid1.DataSource = dt

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center