Completed
Last Updated: 02 Aug 2018 10:08 by Dimitar
ADMIN
Dess | Tech Support Engineer, Principal
Created on: 25 Jul 2018 08:36
Category: TreeView
Type: Bug Report
2
ADD. RadTreeView - add functionality to specify a TypeConverter for the specified CheckedMember
Scenario: Populate RadTreeView with data coming from an XML: https://docs.telerik.com/devtools/winforms/treeview/data-binding/binding-to-xml-data The XML file stores a boolean value "IsActive" which will determine the check state of the node. Then, specify the RadTreeView. CheckMember property as well

            string fileName = @"TempFile.xml";
            DataSet tocDataSet = new DataSet("Toc");
            tocDataSet.ReadXml(fileName);
            this.radTreeView1.DataMember = "FlatNode";
            this.radTreeView1.DisplayMember = "Title";
            this.radTreeView1.ChildMember = "Id";
            this.radTreeView1.ParentMember = "ParentId";
            this.radTreeView1.CheckedMember = "IsActive";
            this.radTreeView1.DataSource = tocDataSet;

When you try to check/uncheck a node, an exception occurs indicating the inability to convert the string value "On" to ToggleState. Currently RadTreeView supports only bool, bool? to ToggleState and vice versa. The TypeConverter should be exposed so the developer can change it and implement the custom conversion.

<?xml version="1.0" encoding="utf-8"?>
<ArrayOfFlatNode xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
  <FlatNode>
    <Title>New Name</Title>
    <IsActive>false</IsActive>
    <ParentId>0</ParentId>
    <Id>1</Id>
  </FlatNode>
  <FlatNode>
    <Title>1st Node</Title>
    <IsActive>false</IsActive>
    <ParentId>1</ParentId>
    <Id>2</Id>
  </FlatNode>
  <FlatNode>
    <Title>1.1</Title>
    <IsActive>true</IsActive>
    <ParentId>2</ParentId>
    <Id>3</Id>
  </FlatNode>
  <FlatNode>
    <Title>1.2</Title>
    <IsActive>false</IsActive>
    <ParentId>2</ParentId>
    <Id>4</Id>
  </FlatNode>
  <FlatNode>
    <Title>1.3</Title>
    <IsActive>false</IsActive>
    <ParentId>2</ParentId>
    <Id>5</Id>
  </FlatNode>
  <FlatNode>
    <Title>2.0</Title>
    <IsActive>true</IsActive>
    <ParentId>1</ParentId>
    <Id>6</Id>
  </FlatNode>
  <FlatNode>
    <Title>2.1</Title>
    <IsActive>true</IsActive>
    <ParentId>6</ParentId>
    <Id>7</Id>
  </FlatNode>
  <FlatNode>
    <Title>2.2</Title>
    <IsActive>true</IsActive>
    <ParentId>6</ParentId>
    <Id>8</Id>
  </FlatNode>
  <FlatNode>
    <Title>2.3</Title>
    <IsActive>true</IsActive>
    <ParentId>6</ParentId>
    <Id>9</Id>
  </FlatNode>
  <FlatNode>
    <Title>3.0</Title>
    <IsActive>true</IsActive>
    <ParentId>1</ParentId>
    <Id>10</Id>
  </FlatNode>
  <FlatNode>
    <Title>4.0</Title>
    <IsActive>false</IsActive>
    <ParentId>1</ParentId>
    <Id>11</Id>
  </FlatNode>
  <FlatNode>
    <Title>5.0</Title>
    <IsActive>true</IsActive>
    <ParentId>1</ParentId>
    <Id>12</Id>
  </FlatNode>
  <FlatNode>
    <Title>3.1</Title>
    <IsActive>false</IsActive>
    <ParentId>10</ParentId>
    <Id>13</Id>
  </FlatNode>
  <FlatNode>
    <Title>New Item</Title>
    <IsActive>true</IsActive>
    <ParentId>8</ParentId>
    <Id>15</Id>
  </FlatNode>
  <FlatNode>
    <Title>New Item</Title>
    <IsActive>true</IsActive>
    <ParentId>8</ParentId>
    <Id>16</Id>
  </FlatNode>
</ArrayOfFlatNode>

0 comments