Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
545
Optional (boolean) attribute from xml always true in Wingrid
posted

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.

 

 

 

Parents
No Data
Reply
  • 69832
    Offline posted

    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.

Children