Link to home
Start Free TrialLog in
Avatar of Victor  Charles
Victor CharlesFlag for United States of America

asked on

Help with disabling displaying field in combobox if exist in an xml file

Hi,

I'm using the code below to display data from a DataGrid in a combobox:

 ComboBox2.DataSource = (From col As C1.Win.C1TrueDBGrid.C1DataColumn In C1Data.Columns Select col.Caption).ToList()
       

How do I modify the code to display data in the combobox only if the field name in C1Data exist in an xmlmfile?

For example if Main.xml contains the following data elements (NSC,FIF,AGD,UVN) in C1Data contains the following columns((NSC,FIF,NAS, PCS,NMN) I want the dropdown list to only contain (NSC,FIF)

Thanks,

Victor
Avatar of Fernando Soto
Fernando Soto
Flag of United States of America image

Hi Victor;

And what does the schema/structure  of the XML look like?
Avatar of Victor  Charles

ASKER

Hi Fernando,

The XML format file is in the following format:

<Root>
<Fields>
<NSC></NSC>
<FIF></FIF>
<AGD></AGD>
<UVN></UVN>
</Fields
</Root>

Thanks,

victor
ASKER CERTIFIED SOLUTION
Avatar of Fernando Soto
Fernando Soto
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Hi Fernando,

It works. Thank You.

Is it possible to modify the code using multiple xml files? For example I want to load the combobox with values in the Grid matching fields in both Main.xml and Sub.xml. Other option is to create one xml file from Main and Sub.xml and use the existing code.

If necessary I can open a new issue.

Victor
Please see my last comments.
Hi Victory;

I believe you would be better off using one XML file because you will then need to read in two or more XML files then query both and then combine the results into one list.