Click here to Skip to main content
15,911,030 members
Home / Discussions / WPF
   

WPF

 
AnswerRe: find ancestor Pin
#realJSOP18-Aug-10 4:12
professional#realJSOP18-Aug-10 4:12 
AnswerRe: find ancestor Pin
Ian Shlasko18-Aug-10 4:31
Ian Shlasko18-Aug-10 4:31 
QuestionGETTING THIS ERROR IN SILVERLIGHT CHAT PROJECT Pin
kibok17-Aug-10 6:36
kibok17-Aug-10 6:36 
AnswerRe: GETTING THIS ERROR IN SILVERLIGHT CHAT PROJECT Pin
Abhinav S17-Aug-10 18:38
Abhinav S17-Aug-10 18:38 
QuestionWPF: Converting nested DrawingGroup to nested DrawingVisual [modified] Pin
Paul Selormey16-Aug-10 19:57
Paul Selormey16-Aug-10 19:57 
QuestionCustom Rendering Ink Pin
Tony Honter16-Aug-10 5:32
Tony Honter16-Aug-10 5:32 
Questionhtmlpage.window.navigation help Pin
yogesh_kumar_agarwal16-Aug-10 4:40
yogesh_kumar_agarwal16-Aug-10 4:40 
AnswerRe: htmlpage.window.navigation help Pin
yogesh_kumar_agarwal18-Aug-10 20:40
yogesh_kumar_agarwal18-Aug-10 20:40 
QuestionHow to bind data for wpf datagridcombobox column in browser application Pin
krajasekhar216-Aug-10 3:08
krajasekhar216-Aug-10 3:08 
QuestionHow can i add simple .net control (net wpf control ) into wpf window ? Pin
Yanshof14-Aug-10 21:47
Yanshof14-Aug-10 21:47 
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
professional#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 

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.