WPF Datagrid combobox (with Checkboxes) dynamically binded to xml

zafrenren

New Member
I am trying to do something that seems to be somewhat complicated since I have been searching for answers for days without success so maybe someone here can help.I have one xml file that contains data which is organized like this:\[code\]<Company> <Store> <ID>10192820</ID> <Type>1, 2, 3</Type> <SqFt>2000</SqFt> </Store> <Store> <ID>10192821</ID> <Type>2, 4</Type> <SqFt>2500</SqFt> </Store> <Store> <ID>10192822</ID> <Type>1</Type> <SqFt>3000</SqFt> </Store></Company>\[/code\]As you can see in this XML example, the type is just a code identifier so I have another xml file which describes what these codes mean and it looks like this:\[code\]<CodeGroups> <Type> <Code>1</Code> <Description>Grocery</Description> </Type> <Type> <Code>2</Code> <Description>Floral</Description> </Type><CodeGroups>\[/code\]You can also see that each store can be of multiple types so what I have is a data grid in my WPF VB.NET Application that I want to display each store in. Each store would have it's own row and binded to the xml file. THe first question is how can I add binding dynamically using vb.net when I create the datagrid dynamically. I can get it to bind correctly when I use xaml and the xmldataprovider but can't get it to work when creating it dynamically. Is there any trick to doing this using the xmldataprovider?My second question is adding some sort of multi-select field in the datagrid cell for the type of store. I imagine a combobox with checkboxes but it could be anything that works. Does anyone have any suggestions on this or know how to do it?My third question involves the data binding to the combobox with checkboxes. I would like it to display the "Description" field from my codegroup xml but still have the "Code" value behind so that when it is changed, it will write the code to the xml and not the description all the while keeping the description visible to the user.Any help you can give me on these three questions preferably in vb.net would be greatly appreciated.Thanks!
 
Back
Top