User (Old forums)MemberApril 17, 2007 at 6:51 pmPost count: 23064
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 SupportMemberApril 19, 2007 at 9:26 amPost 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)MemberNovember 29, 2007 at 3:01 pmPost 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>
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.
Imported from legacy forums. Posted by Marty (had 631 views)
- You must be logged in to reply to this topic.