# C1.Win.FlexGrid.BaseFilter.ReadXmlDefinition

## Content

<div class="doc-site-dotnet-api-container">



<h1 id="C1_Win_FlexGrid_BaseFilter_ReadXmlDefinition_" data-uid="C1.Win.FlexGrid.BaseFilter.ReadXmlDefinition*">ReadXmlDefinition Method
</h1>
<div class="markdown level0 summary"></div>
<div class="markdown level0 conceptual"></div>



<a id="C1_Win_FlexGrid_BaseFilter_ReadXmlDefinition_" data-uid="C1.Win.FlexGrid.BaseFilter.ReadXmlDefinition*"></a>
<h4 id="C1_Win_FlexGrid_BaseFilter_ReadXmlDefinition_System_Xml_XmlReader_" data-uid="C1.Win.FlexGrid.BaseFilter.ReadXmlDefinition(System.Xml.XmlReader)">ReadXmlDefinition(XmlReader)</h4>
<div class="markdown level1 summary"><p>Reads XML definition of the filter.</p>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="declaration">Declaration</h5>
<div class="codewrapper">
  <pre><code class="lang-csharp hljs">public abstract void ReadXmlDefinition(XmlReader xr)</code></pre>
</div>
<div class="codewrapper">
  <pre><code class="lang-vbnet hljs">Public MustOverride Sub ReadXmlDefinition(xr As XmlReader)</code></pre>
</div>
<h5 class="parameters">Parameters</h5>
<table class="table table-bordered table-condensed">
  <thead>
    <tr>
      <th>Type</th>
      <th>Name</th>
      <th>Description</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.xml.xmlreader">XmlReader</a></td>
      <td><span class="parametername">xr</span></td>
      <td><p>The instance of the <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.xml.xmlreader">XmlReader</a> which used to read xml filter definition.</p>
</td>
    </tr>
  </tbody>
</table>
<h5 class="implements">Implements</h5>
    <div><a class="xref" href="C1.Win.FlexGrid.IC1ColumnFilter2.ReadXmlDefinition.html#C1_Win_FlexGrid_IC1ColumnFilter2_ReadXmlDefinition_System_Xml_XmlReader_">IC1ColumnFilter2.ReadXmlDefinition(XmlReader)</a></div>
<h5 id="C1_Win_FlexGrid_BaseFilter_ReadXmlDefinition_System_Xml_XmlReader__examples">Examples</h5>
<p>The code below reads xml node value to integer filter field:</p>
<pre><code class="lang-csharp">while (xr.Read())
{
    // read xml node value
    if (xr.NodeType == XmlNodeType.Text)
    {
        int.TryParse(xr.Value, out _field1);
    }
}</code></pre>
<p>The code below reads two xml nodes attributes to integer filter fields:</p>
<pre><code class="lang-csharp">while (xr.Read())
{
    if (xr.NodeType == XmlNodeType.Element)
    {
        // read "Minimum" xml node attribute
        if (xr.Name == "Minimum")
        {
            int.TryParse(xr.GetAttribute("Value"), out _minimum);
        }

        // read "Maximum" xml node attribute
        if (xr.Name == "Maximum")
        {
            int.TryParse(xr.GetAttribute("Value"), out _maximum);
        }
    }
}</code></pre>

</div>
