Results 1 to 3 of 3

Thread: datagrid

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Sep 2004
    Posts
    151

    datagrid

    Hi,

    I have a datagird in windows form, how I get the value from the column when user click then row.

    For example, a datagrid contains the following column

    productid,productname,productdesc

    if a user clicks a row, it should return the productid of that row.
    How could I do it?


    Thanks,
    Newbie

  2. #2

    Thread Starter
    Addicted Member
    Join Date
    Sep 2004
    Posts
    151
    Could anyone please give me some examples for this.

    Thanks,
    Newbie

  3. #3
    Frenzied Member mar_zim's Avatar
    Join Date
    Feb 2004
    Location
    Toledo Cebu City.
    Posts
    1,416

    Re: datagrid

    Originally posted by VB.NETNEWBIE
    Hi,

    I have a datagird in windows form, how I get the value from the column when user click then row.

    For example, a datagrid contains the following column

    productid,productname,productdesc

    if a user clicks a row, it should return the productid of that row.
    How could I do it?


    Thanks,
    Newbie
    VB Code:
    1. 'lets assume that you have a datatable and you bind it to your datagrid and your datatable has 3 columns productid,productname,productdesc
    2. 'in the datagrid click event
    3. datatable1.Rows(DataGrid1.CurrentCell.RowNumber)(0)---it gets the first column of your datatable (productid)

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