Results 1 to 3 of 3

Thread: Datagrids

  1. #1

    Thread Starter
    Lively Member flog3941's Avatar
    Join Date
    Nov 2002
    Posts
    123

    Datagrids

    I need to know how to arrange the columns in my data grid to any order, VB is doing it alphabetically by itself. In my access database they are in the order I want them, but vb just rearranges them?

    Any Suggestions?

  2. #2
    Frenzied Member
    Join Date
    Oct 2002
    Location
    Gammapolis
    Posts
    1,474
    I think if you just set the datasource and datamember of a datagrid, by default it sets the columns according to the order they are added to your dataset table, and this order is determined by the way you select your columns when you make a dataadapter, if you select * (all) they are added in alphabetical order.

    If you want to change the order at datagrid level you have to add a Tablestyle to your datagrid Tablestyles collection and then DataGirdColumnStyle to GridColumnStyles collection of that Tablestyle and set the mapping name for each column. Here you can rearrange them and set more properties of each column for example being Read-Only and so on. There is quite a good documentation about this in MSDN.

  3. #3

    Thread Starter
    Lively Member flog3941's Avatar
    Join Date
    Nov 2002
    Posts
    123
    thanks that exactly what I did was select "all", theres my problem.

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