Results 1 to 5 of 5

Thread: Datagrid how to show Selected columns

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Jan 2001
    Posts
    79

    Question Datagrid how to show Selected columns

    This is driving me nuts. I need to have a dataset binded to a datagrid. The data grid must not show all columns in the dataset but only a few. I will be adding records to the dataset in code and these should show in the datagrid, any kind of editing or adding is not allowed in the datagrid.

    I tried using also dataviews, basically it would have been nice to have a dataview with a select statement on the dataset, thus selecting only the fields required, but it seems that this is not possible.

    Any ideas are much appreciated.


    Thanks

  2. #2
    Sleep mode
    Join Date
    Aug 2002
    Location
    RUH
    Posts
    8,083
    simply do this to have dataset binded to datagrid :
    after initialization of connection and filling data do this :
    VB Code:
    1. DataSet1.DataSource = dataset.Tables("your table")

  3. #3

    Thread Starter
    Lively Member
    Join Date
    Jan 2001
    Posts
    79

    Resolved

    Thanks for the reply. Actually my problem was not to display a datagrid but to limit the number of columns. I did encounter the solution in various forums and issue was resolved.

  4. #4
    Sleep mode
    Join Date
    Aug 2002
    Location
    RUH
    Posts
    8,083
    Cool

  5. #5
    Hyperactive Member
    Join Date
    Mar 2002
    Location
    Dublin (Ireland)
    Posts
    304
    was that to set the column width to 0?, assuming you create a datagridstyle.

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