Welcome to the Xceed Community Sign in | Join | Help
Community Search  

Grid 3.0 Duplicate Column Fields

Sort Posts: Previous Next
  •  08-19-2008, 2:02 PM Post no. 14213

    Grid 3.0 Duplicate Column Fields

    I often have DateTime fields which I need to display in the Grid. Many times I separate out the Date (short Date) and Time using a custom cell template but re-use the same DB field in the Grid. This is so I can group by Month/Day/Time etc.

    The new version of the Grid (v.3.0) will not allow this - apparently because of the new Column Virtualization is using the Field Name in an internal collection. If I have two columns bound to the same field name, I now get an exception saying the Key is already part of the collection. 

    Ooops!

    Only a minor inconviencience, I'm now just retreiving the Date 2x with different names and the problem goes away. But I sure don't like to retreive DB data if I don't have to...

     

  •  08-21-2008, 11:42 AM Post no. 14318 in reply to 14213

    Re: Grid 3.0 Duplicate Column Fields

    I am noticing this same problem.

    I was displaying the same field in two columns, as they had different display styles. (Text and Icon) and in Grid 3.0, this causes duplicate key errors.

    I would like to know if this is a permanent change in that it will not be allowed to display the same field in 2 columns.

  •  08-21-2008, 3:33 PM Post no. 14339 in reply to 14318

    Re: Grid 3.0 Duplicate Column Fields

    In fact, you should be able to get around that problem using ItemProperties:

    <xcdg:DataGridCollectionViewSource x:Key="cvs" Source="{Binding}" AutoCreateItemProperties="True">
      <xcdg:DataGridCollectionViewSource.ItemProperties>
        <xcdg:DataGridItemProperty Name="SecondOrderID"
                                                  ValuePath="[OrderID]"
                                                  DataType="{x:Type s:Int32}" />
      </xcdg:DataGridCollectionViewSource.ItemProperties>
                     

    Its editable, sortable, groupable, whateverable!



    Marc Laroche
    Software Developer
    Xceed Software Inc.


    I don’t suffer from insanity, I enjoy every minute of it. - Unknown
View as RSS news feed in XML
Contact | Site Map | Reviews | Legal Terms of Use | Trademarks | Privacy Statement Copyright 2008 Xceed Software Inc.