Click here to Skip to main content
15,887,746 members
Home / Discussions / WPF
   

WPF

 
AnswerRe: How can i add simple .net control (net wpf control ) into wpf window ? Pin
Abhinav S14-Aug-10 22:37
Abhinav S14-Aug-10 22:37 
GeneralRe: How can i add simple .net control (net wpf control ) into wpf window ? Pin
Yanshof14-Aug-10 22:43
Yanshof14-Aug-10 22:43 
GeneralRe: How can i add simple .net control (net wpf control ) into wpf window ? Pin
Abhinav S15-Aug-10 0:49
Abhinav S15-Aug-10 0:49 
GeneralRe: How can i add simple .net control (net wpf control ) into wpf window ? Pin
Yanshof15-Aug-10 0:58
Yanshof15-Aug-10 0:58 
GeneralRe: How can i add simple .net control (net wpf control ) into wpf window ? Pin
Abhinav S15-Aug-10 0:58
Abhinav S15-Aug-10 0:58 
QuestionPlaying a list of files on after the other. Pin
Tichaona J13-Aug-10 12:29
Tichaona J13-Aug-10 12:29 
AnswerRe: Playing a list of files on after the other. Pin
#realJSOP14-Aug-10 0:09
mve#realJSOP14-Aug-10 0:09 
QuestionBinding ComboBox Selected Item value Pin
BRShroyer13-Aug-10 5:01
BRShroyer13-Aug-10 5:01 
I have been working on this for a day or two and can't seem to find the answer on the internet, or at least I don't get the answer if I have seen it.

I have a window showing various settings for an object:
<Grid x:Name="PalletGrid">
  <Grid.DataContext><XmlDataProvider x:Name="xmlPalletConfiguration" XPath="/PalletConfig/Pallets/Pallet" 
                                     Source="C:\ProgramData\Pallet Configuration.xml" />
  </Grid.DataContext>
  <TextBox x:Name="PickupSequenceTextBox" Text="{Binding XPath=/PalletConfig/PickupSequence}"/>
  <TextBox x:Name="DropoffSequenceTextBox" Text="{Binding XPath=/PalletConfig/DropoffSequence}"/>
  <ComboBox x:Name="SelectedPalletComboBox" ItemsSource="{Binding Mode=OneWay}" IsSynchronizedWithCurrentItem="True"
            SelectedValuePath="@display" DisplayMemberPath="@display"/>
  <TextBox x:Name="RowCount" Text="{Binding XPath=Rows}"/>
  <TextBox x:Name="ColumnCount" Text="{Binding XPath=Columns}"/>
  <TextBox x:Name="ColumnDimension" Text="{Binding XPath=YDimension}"/>
  <TextBox x:Name="RowDimension" Text="{Binding XPath=XDimension}"/>
</Grid>


The Pallet Configuration.xml file I'm databinding to looks like this:
<PalletConfig>
  <NumberOfPallets>2</NumberOfPallets>
  <CurrentPallet>3/8</CurrentPallet>
  <PickupSequence>B</PickupSequence>
  <DropoffSequence>A</DropoffSequence>
  <Pallets>
    <Pallet display="6.0mm">
      <Rows>10</Rows>
      <Columns>10</Columns>
      <XDimension>100.000</XDimension>
      <YDimension>100.000</YDimension>
      <PalletALocation>295, -5, -19, 0, -8, L</PalletALocation>
      <PalletBLocation>93, -6, -19, 0, 0, -8, L</PalletBLocation>
    </Pallet>
    <!--More pallet tags ...-->
  </Pallets>
</PalletConfig>


I set the datacontext for the grid to be at the individual pallet level. When I select a new pallet in the combo box, all of the textboxes below update with the values for the selected pallet.

What I can't figure out how to do is databind the <CurrentPallet> in the XML file to the selected item. I want it to save the selected item so the next time the application is ran, the combobox will select the pallet type that was last selected.

I've tried binding to the selecteditem, but haven't been successful. Nothing I have tried has updated the <CurrentPallet> tag when the changes were saved. Also, whatever I have tried made the combobox display a blank line the first one or two times you select a pallet type. It would display like it whould after that. I've also heard that the selecteditem doesn't do well with updating the combobox when whatever it is bound to changes, not that it matters I only want to do this at startup. Any solution that works will be appreciated.
Brad

Deja Moo - When you feel like you've heard the same bull before.

AnswerRe: Binding ComboBox Selected Item value Pin
Ian Shlasko13-Aug-10 5:14
Ian Shlasko13-Aug-10 5:14 
GeneralRe: Binding ComboBox Selected Item value Pin
BRShroyer13-Aug-10 5:18
BRShroyer13-Aug-10 5:18 
GeneralRe: Binding ComboBox Selected Item value Pin
Ian Shlasko13-Aug-10 5:25
Ian Shlasko13-Aug-10 5:25 
GeneralRe: Binding ComboBox Selected Item value Pin
BRShroyer13-Aug-10 5:33
BRShroyer13-Aug-10 5:33 
GeneralRe: Binding ComboBox Selected Item value Pin
Ian Shlasko13-Aug-10 5:39
Ian Shlasko13-Aug-10 5:39 
GeneralRe: Binding ComboBox Selected Item value Pin
BRShroyer13-Aug-10 5:47
BRShroyer13-Aug-10 5:47 
QuestionData Template Issue Pin
Tauseef A12-Aug-10 22:34
Tauseef A12-Aug-10 22:34 
AnswerRe: Data Template Issue Pin
Abhinav S12-Aug-10 22:54
Abhinav S12-Aug-10 22:54 
GeneralRe: Data Template Issue Pin
Tauseef A12-Aug-10 23:11
Tauseef A12-Aug-10 23:11 
QuestionMasking textblock in wpf Pin
sumit703412-Aug-10 21:26
sumit703412-Aug-10 21:26 
AnswerRe: Masking textblock in wpf Pin
Abhinav S12-Aug-10 22:49
Abhinav S12-Aug-10 22:49 
QuestionRegarding DateTime in Datagrid [modified] Pin
PrabhatSharp12-Aug-10 7:27
PrabhatSharp12-Aug-10 7:27 
AnswerRe: Regarding DateTime in Datagrid Pin
Frank W. Wu24-Aug-10 13:17
Frank W. Wu24-Aug-10 13:17 
Questionbind to textblock in listbox selected item in wpf Pin
sumit703412-Aug-10 0:17
sumit703412-Aug-10 0:17 
AnswerRe: bind to textblock in listbox selected item in wpf Pin
Ian Shlasko12-Aug-10 3:33
Ian Shlasko12-Aug-10 3:33 
QuestionSet Button inactive Pin
eric koston11-Aug-10 23:27
eric koston11-Aug-10 23:27 
AnswerRe: Set Button inactive Pin
#realJSOP12-Aug-10 2:45
mve#realJSOP12-Aug-10 2:45 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.