Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. .NET (Core and Framework)
  4. How do I get a grid control to see MyDataView's column definitions?

How do I get a grid control to see MyDataView's column definitions?

Scheduled Pinned Locked Moved .NET (Core and Framework)
questioncss
1 Posts 1 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • T Offline
    T Offline
    ThomasBates
    wrote on last edited by
    #1

    I have implemented my own MyDataView so that I can process the raw data before it appears in a data grid. MyDataView implements IBindingList. MyDataView has a collection of MyDataRow objects. MyDataRow implements ICustomTypeDescriptor. MyDataView also has a collection of MyDataColumn objects, which it shares with the MyDataRow objects. MyDataRow exposes the collection of MyDataColumn through the ICustomTypeDescriptor interface. When assigning the DataSource property of the grid to an instance of MyDataView, it displays all the columns and rows correctly, as long as there is at least one row of data to display. However, when the MyDataView has no rows, the grid shows a single column called "Column" instead of the actual columns in the collection. This makes sense to me since the columns are exposed through the row, and there are no rows. Somehow, I need the grid to see MyDataView's column definitions even if there are no rows in the view. I tried modifying MyDataView to also implement ICustomTypeDescriptor, but it did not seem to have any effect. How do I get a grid to see MyDataView's column definitions even if there are no rows in the view? (I'm using the DevExpress.XtraGrid.GridControl from Developer Express.)

    1 Reply Last reply
    0
    Reply
    • Reply as topic
    Log in to reply
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes


    • Login

    • Don't have an account? Register

    • Login or register to search.
    • First post
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • World
    • Users
    • Groups