D
Don
Hi
I have the following XML Schema
<xs:element name="MotionParameters">
<xs:complexType>
<xs:sequence>
<xs:element name="FeedRateMAX" >
<xs:simpleType>
<xs:restriction base="xs:double">
<xs:minExclusive value="0.0"/>
<xs:maxExclusive value="1000.0"/>
</xs:restriction>
</xs:simpleType>
</xs:element>
<xs:element name="PlungeRateMAX" type="xs:double"
minOccurs="0" />
<xs:element name="TravelRateMAX" type="xs:double"
minOccurs="0" />
<xs:element name="TravelRate" type="xs:double" minOccurs="0" />
<xs:element name="PlungeRate" type="xs:double" minOccurs="0" />
<xs:element name="FeedRate" type="xs:double" minOccurs="0" />
<xs:element name="JogSpeedMode" type="xs:integer"
minOccurs="0" />
<xs:element name="SeekXYSpeed" type="xs:double" minOccurs="0" />
<xs:element name="SeekZSpeed" type="xs:double" minOccurs="0" />
<xs:element name="JerkGrate" type="xs:double" minOccurs="0" />
<xs:element name="AccelerationG" type="xs:double"
minOccurs="0" />
<xs:element name="AccelMAX" type="xs:double" minOccurs="0" />
<xs:element name="JerkMAX" type="xs:double" minOccurs="0" />
<xs:element name="CentripetalG" type="xs:double" minOccurs="0"
/>
<xs:element name="BrakeG" type="xs:double" minOccurs="0" />
<xs:element name="ArcError" type="xs:double" minOccurs="0" />
<xs:element name="MinLength" type="xs:double" minOccurs="0" />
<xs:element name="CornerPause" type="xs:double" minOccurs="0" />
<xs:element name="StartPause" type="xs:double" minOccurs="0" />
<xs:element name="JerkFactor" type="xs:integer" minOccurs="0" />
<xs:element name="CentripetalAcceleration" type="xs:double"
minOccurs="0" />
<xs:element name="LinearAcceleration" type="xs:double"
minOccurs="0" />
</xs:sequence>
</xs:complexType>
</xs:element>
I read the schema in using a dataset as in the following:
dsMachineParameters = new DataSet("MachineParameters");
mydatagrid = new DataGrid();
mydatagrid.DataSource = dsMachineParameters;
dataGridView1.Controls.Add(mydatagrid);
try
{
dsMachineParameters.ReadXmlSchema(xmlSchemaPath);
dsMachineParameters.ReadXml(xmlPath);
mydatagrid.Controls.Clear();
}
catch (Exception err)
{
MessageBox.Show(err.Message);
return;
}
I am still able to set values outside the range I set for FeedRateMAX?
How do I make the grid understand the restrictions I have put on this value?
I still able to change this value in the grid outside of the range I have set.
I have the following XML Schema
<xs:element name="MotionParameters">
<xs:complexType>
<xs:sequence>
<xs:element name="FeedRateMAX" >
<xs:simpleType>
<xs:restriction base="xs:double">
<xs:minExclusive value="0.0"/>
<xs:maxExclusive value="1000.0"/>
</xs:restriction>
</xs:simpleType>
</xs:element>
<xs:element name="PlungeRateMAX" type="xs:double"
minOccurs="0" />
<xs:element name="TravelRateMAX" type="xs:double"
minOccurs="0" />
<xs:element name="TravelRate" type="xs:double" minOccurs="0" />
<xs:element name="PlungeRate" type="xs:double" minOccurs="0" />
<xs:element name="FeedRate" type="xs:double" minOccurs="0" />
<xs:element name="JogSpeedMode" type="xs:integer"
minOccurs="0" />
<xs:element name="SeekXYSpeed" type="xs:double" minOccurs="0" />
<xs:element name="SeekZSpeed" type="xs:double" minOccurs="0" />
<xs:element name="JerkGrate" type="xs:double" minOccurs="0" />
<xs:element name="AccelerationG" type="xs:double"
minOccurs="0" />
<xs:element name="AccelMAX" type="xs:double" minOccurs="0" />
<xs:element name="JerkMAX" type="xs:double" minOccurs="0" />
<xs:element name="CentripetalG" type="xs:double" minOccurs="0"
/>
<xs:element name="BrakeG" type="xs:double" minOccurs="0" />
<xs:element name="ArcError" type="xs:double" minOccurs="0" />
<xs:element name="MinLength" type="xs:double" minOccurs="0" />
<xs:element name="CornerPause" type="xs:double" minOccurs="0" />
<xs:element name="StartPause" type="xs:double" minOccurs="0" />
<xs:element name="JerkFactor" type="xs:integer" minOccurs="0" />
<xs:element name="CentripetalAcceleration" type="xs:double"
minOccurs="0" />
<xs:element name="LinearAcceleration" type="xs:double"
minOccurs="0" />
</xs:sequence>
</xs:complexType>
</xs:element>
I read the schema in using a dataset as in the following:
dsMachineParameters = new DataSet("MachineParameters");
mydatagrid = new DataGrid();
mydatagrid.DataSource = dsMachineParameters;
dataGridView1.Controls.Add(mydatagrid);
try
{
dsMachineParameters.ReadXmlSchema(xmlSchemaPath);
dsMachineParameters.ReadXml(xmlPath);
mydatagrid.Controls.Clear();
}
catch (Exception err)
{
MessageBox.Show(err.Message);
return;
}
I am still able to set values outside the range I set for FeedRateMAX?
How do I make the grid understand the restrictions I have put on this value?
I still able to change this value in the grid outside of the range I have set.