Click here to Skip to main content
15,879,065 members
Please Sign up or sign in to vote.
2.00/5 (1 vote)
See more:
How would I format my XML, such that when bound to a radio button the value within the xml field would check or uncheck the button as necessary. I originally wanted to make <accttype> 1 of 2 possible values, 'Account' or 'COD'. I'm thinking now that it should either be 'Account' or null. Any tips?
XML
<Customer>
  <Name></Name>
  <Street>115 S Charlton St</Street>
  <CityStateZip>Louisville, KY 40206</CityStateZip>
  <Phone>502-583-1726</Phone>
  <Fax></Fax>
  <Cell>502-471-1137</Cell>
  <Other></Other>
  <Attn>Corey Brown</Attn>
  <Email></Email>
  <SalesPerson></SalesPerson>
  <AcctType>Account</AcctType>
</Customer>

XML
<RadioButton x:Name="optAcct" IsChecked="{Binding AcctType}" Content="On Account" HorizontalAlignment="Left" VerticalAlignment="Top" Margin="4,112,0,0"/>
Posted
Comments
PIEBALDconsult 19-Dec-14 15:36pm    
I wouldn't do it that way; it's less extensible than a drop-down or similar.
Sean Donnahoe 19-Dec-14 15:40pm    
That's kind of what I was starting to think.

1 solution

You can create schema file (*.xsd), which enables you to define possible values for AccType field.
See: <xsd:simpleType> Element[^]. It's possible to define custom collection. It might be a source od dropdown list ;)

how to find restriction values in a simple xsd element with c#[^]
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900