DataGridView - how to swap rows with columns.

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • A n g l e r

    DataGridView - how to swap rows with columns.

    Hi there.

    I'm just wondering how I could reassure that rows (of DataGridView) are
    of a certain data type rather than columns? I mean consider the following:

    Col1 (bool) Col2(int32)
    Row1 T 34
    Row2 T 34

    Now, I would rather have:

    Col1 Col2
    Row1 (bool) T T
    Row2 (int32) 34 34

    Hope this comes across enough clear :)

    Cheers.
  • Marc Gravell

    #2
    Re: DataGridView - how to swap rows with columns.

    I'm pretty sure you can't. PropertyGrid is based IList/IListSource for
    items (rows), using GetProperties() from either TypeDescriptor or
    ITypedList for properties (columns). It is expected that the metadata
    is the same for every row - it is queried for the entire list, not on
    a per-row basis.

    You could *perhaps* stick to text formatting (not checkboxes etc) and
    do a *lot* of work in the format/validate steps to shim it - I
    wouldn't be in a hurry to try this, though.

    There is no doubt an alternative grid that would better suit your
    needs, but I can't name any...

    Marc

    Comment

    • A n g l e r

      #3
      Re: DataGridView - how to swap rows with columns.

      You could *perhaps* stick to text formatting (not checkboxes etc) and
      do a *lot* of work in the format/validate steps to shim it - I
      wouldn't be in a hurry to try this, though.
      >
      There is no doubt an alternative grid that would better suit your
      needs, but I can't name any...
      Yep, I'd appreciate if anyone could come up with some recommendation of
      an alternative grid ... Don't mind if it comes as a whole package of UI
      components.

      Comment

      Working...