Results 1 to 3 of 3

Thread: DataGrid Selection

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Oct 2000
    Location
    Chesterfield, UK
    Posts
    298

    DataGrid Selection

    Hi,

    In a listview you can change the property of "fullrowselect" to true or false, is there a way to do this within a datagrid???

    What I would like to do (after being able to do a "full row select" thingy if possible) would be to when I doubleclick on a row I could throw up a messagebox specifying one of the values out of that row.

    But I keep seeing a lot of info about datagridstyles, do I really need to use them before I can 1) find out which column I am in, 2) Set the text in a column to bold???

    Cheers,


    Matt

  2. #2
    Hyperactive Member
    Join Date
    Mar 2002
    Location
    Dublin (Ireland)
    Posts
    304
    okay a couple of pointers.
    remember datagrids only reflect the underlying data and it is not the datagrid that dictates the display it is the dataset.

    In your particular example you want to select all rows.

    here is some example code:
    Dr1 and Ds1 already declared
    dim rowno as integer = 0


    For Each Dr1 In ds1.Tables.Item("mydata").Rows
    DataGrid1.select(rowno)
    rowno = rowno + 1
    Next

    this will highlight the rows and then of course you can run through the dataset again to determine whether the IsSelected property is true or false and take the required action.

  3. #3

    Thread Starter
    Hyperactive Member
    Join Date
    Oct 2000
    Location
    Chesterfield, UK
    Posts
    298
    Thanks for you assistance.

    Tried it and it works.

    Thanks!!

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