Home Forums WinForms controls Xceed Grid for WinForms Only selected fields from list datasource

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • User (Old forums)
    Member
    Post count: 23064
    #17451 |

    Hi,

    I’m trying to make the Xceed Grid use a List(Of T) as its datasource and display defined columns only.

    I defined some columns in the designer (Add column (unbound)) and set the fieldnames.

    Then calling this:

    grid.AutoCreateColumns = False 

    grid.DataSource = myList

    Gives me the following exception:

    The new data binding could not be set because there is an unbound column in the grid that has the same field name as one of the bound columns. FieldName: ItemNo

     

    Is there a way to achieve this, or will I have to hide all unwanted columns in code? The standard DataGridView works fine this way.

    Thanks

    Imported from legacy forums. Posted by Sven (had 868 views)

    Xceed Support
    Member
    Post count: 5658

     

    Hi Sven,

    It seems that the unbound column added via the designer has the same fieldname as one of the column generated from the bound data source.
    Please ensure that the Fieldnames are different to avoid the observed error.

    Imported from legacy forums. Posted by Mohamed [Xceed] (had 1114 views)

Viewing 2 posts - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.