Results 1 to 3 of 3

Thread: DataGrid

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Sep 2002
    Location
    Pilipinas
    Posts
    441

    DataGrid

    Assuming this is my DataGrid and its record.

    ===========================
    |StudNo | StudName |
    ===========================
    |001 | MeeJee Joi |
    ------------------------------------------------
    |002 | Gou Li |
    ------------------------------------------------
    |003 | William Ho |
    ------------------------------------------------

    I tried: MessageBox.Show(DataGrid1.Columns(0).Text), but this code doesn't work.
    Please help me, I want to show the StudNo 001 using MessageBox!

  2. #2
    Your Ad Here! Edneeis's Avatar
    Join Date
    Feb 2000
    Location
    Moreno Valley, CA (SoCal)
    Posts
    7,339
    Get the data from the datasource not directly from the datagrid. The datagrid really only shows the data that it is bound to, but the actual data is still mainly in the source.

  3. #3
    Registered User
    Join Date
    Nov 2002
    Location
    Växjö, Sweden
    Posts
    314
    I agree with Edneeis, but if you still want to get the item from the grid you might try

    MessageBox.Show(DataGrid1.Item(0, 0))

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