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

    How is the Xceed datagrid informed of the datatype of the data that is bound to it? I noticed a comment in one of the sample programs:

    <!– This column will use the DatePicker editor by default. You don’t have
    to specify anything. Xceed DataGridControl will always select an
    appropriate CellEditor according to the DataType. –>

    Is it required that a DataTemplate be created to specify the datatype somehow? Sorry for my ignorance and thanks for any help.

    Imported from legacy forums. Posted by Marty (had 3000 views)

    Xceed Support
    Member
    Post count: 5658

    In fact, we detect the type of columns in several different ways:

    – If the data source implements ITypedList, we used the interface to determine the “columns” and their type.

    Then we look for the presence of a data item.

    – If the data item implements ICustomTypeDescriptor, we use the interface to determine the “columns” and their type.
    – Otherwise, we look for public properties on the data item and determine it this way.

    At columns automatic creation, to determine the “editor” to be used for a data type, we first look in the “dataGridControl.DefaultCelllEditors” dictionary(empty by default) for an editor matching the type specified (you can populate this dictionary… at your discretion ).

    If none are found in the dictionary, then we have a collection of default editor (for basic types) which we can use.

    If the data type cannot be resolved into an editor, then the CellEditor for the column is left blank… Making the column not editable.

    Imported from legacy forums. Posted by Marcus [Xceed] (had 307 views)

    User (Old forums)
    Member
    Post count: 23064

    We are using XML for our datasource. So our case is:

    “Otherwise, we look for public properties on the data item and determine it this way”

    So my question is, are you expecting a type attribute to be on each cell in the xml? Maybe something like this:
    <Row> <column0 xsd:type=”integer”>41</column0>
    <column1 xsd:type=”string”>This is my text</column1>
    </Row>

    I’m playing with this now but no luck so far. Note that our data and xaml are created on the fly so we don’t know what kind of data will be presented in a column until runtime.

    Thanks for your help and sorry for the big delay in responding.

    Marty

    Imported from legacy forums. Posted by Marty (had 631 views)

    User (Old forums)
    Member
    Post count: 23064

    Marty,

    DataType detection for XML sources is not supported yet. We have this on our list, but it won’t be in the next release.

    Imported from legacy forums. Posted by Pascal (had 4397 views)

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