Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
850
Showing different editors in different rows of a column
posted

I'm trying to create a control something like PropertyGrid, where each row is displaying a heading in column 0 and a corresponding value in column 1. The values are of different types, and I'd like to use different editors depending on their types. Is this possible in WinGrid? As far as I can tell, it wants to do everything on a column-by-column basis, which is no good for me.

Is there a more appropriate control that I should be using? I'm not using PropertyGrid because a bunch of these values are dynamic, and creating an object with appropriate properties at runtime just so I could get PropertyGrid to show the right things seemed like too many hoops to jump through.

Thanks,
   Aaron

  • 469350
    Suggested Answer
    Offline posted

    Hi Aaron,

    You could do this with the grid. There is an Editor property and an EditorControl property on the grid column, but these same two properties also exist on the grid cell, so you could set them on each individual cell in a row.

    You cannot set the DataType for the individual cell - the DataType has to be on the column, but you could probably use object as the DataType of the column so it can store any data you need.

    Having said all that, there is a sample included in NetAdvantage that simulates the PropertyGrid using the UltraWinTree control, not the WinGrid. WinTree allows heterogeneous data, so it's a little better suited a PropertyGrid than the WinGrid.