I've a xml file with an element that contains an optional attribute (it's only available when it's true).In my xsd scheme i use: <xs:attribute name="hit" type="xs:boolean" use="optional" default="false" />I load the xml into a DataSet and set the winGrid datasource to that DataSet. this.newDataSet.ReadXml(xmlFileName, XmlReadMode.Auto);When the xml file is loaded, the cell 'hit' in my Grid is always true. (checkbox checked).
Is there a property for the column 'hit' is need to change ?
I've tried a lot of things, but the cell 'hit' in my Grid remains true.
My guess is that use="optional" makes the boolean values tri-state (true, false, indeterminate/not set), but the DataSet picks it up as typeof(bool). Try setting the column's Style property to 'TriStateCheckBox', which should make the null values appear as indeterminate.
Datatype is 'system.boolean'. Checked the default value. This is set to 'false'.
Changing the column's Style property to 'TriStateCheckBox' doesn't make sence.
Fixed.
XSD validation problem.
I doubt that this has anything to do with the grid. The grid just shows the data that the DataSource gives it. My guess is that your DataSet does not contain the data that you are expecting.
I recommend that you check the following at run-time after binding the grid:
When the attribute is missing in the Checkkbox and TriStateCheckBox the tick mark is greyd. When the atrribute is available the tick mark is black.So changing to TriStateCheckBox does't solve the problem.
Are there other solutions ?