在我的表单上,我设置了 2 个字段。项目的位置和子区域。我正在尝试根据用户选择的位置填充子区域字段。例如,他们选择“位置 4”。该位置仅有的 3 个子区域是 A、B 和 C。在位置框中选择后,子区域框将仅显示 A、B 和 C。我拥有所有位置并允许名为 appsettings.xml 的 xml 文件中的子区域。如何让程序读取 xml 文件并允许子区域字段仅填充有效数据?下面是我如何设置 xml 文件的示例。
<?xml version="1.0" encoding="utf-8" ?>
<MerchandiseTrack>
<Merchandise_Zones Application_Data="Test-Run">
<KeyBoard_App>
<AppString>c windows osk.exe</AppString>
</KeyBoard_App>
<Storage_Location>
<head id="Location"> // Name of box on app
<body id="04"> // Name of Location within the box
<Sub-Area>A, B, C,</Sub-Area> // Allowed sub-areas
</body>
</head>
<head id="Location"> // Name of box on app
<body id="05"> //Name of Location within the box
<Sub-Area>P, L, R, B</Sub-Area> // Allowed sub-areas
</body>
</head>
<head id="Location"> // Name of box on app
<body id="14"> //Name of Location within the box
<Sub-Area>A, X, C </Sub-Area> //Name of Location within the box
</body>
</head>
</Storage_Location>
</Merchandise_Zones>
</MerchandiseTrack>