Popup doesn't bind to Toggle when inside DataGrid (xceed)











up vote
1
down vote

favorite












I've made a Toggle, which expands a Popup window with a ListBox inside. It looks like so:



<ToggleButton Name="Toggle" Height="20" Width="150" >
<StackPanel>
<TextBlock Text="TestListPopup"/>
<Popup Height="200" Width="150"
IsOpen="{Binding ElementName=Toggle, Path=IsChecked}"
PlacementTarget="{Binding ElementName=Toggle}"
HorizontalAlignment="Left"
VerticalAlignment="Bottom">
<ListBox SelectionMode="Multiple" SelectionChanged="TypeSelectionChanged" >
<ListBoxItem Content="Test1"/>
<ListBoxItem Content="Test2"/>
<ListBoxItem Content="Test3"/>
</ListBox>
</Popup>
</StackPanel>
</ToggleButton>


It works perfectly, but I want to use it inside the FilterRow of my xceed DataGrid here:



<xcdg:DataGridControl x:Name="dataGrid"
ItemsSource="{Binding Source={StaticResource DataSource}}">
<xcdg:DataGridControl.View>
<xcdg:TableflowView>
<xcdg:TableflowView.FixedHeaders>
<DataTemplate>
<xcdg:ColumnManagerRow/>
</DataTemplate>
<DataTemplate>
<xcdg:FilterRow>
<xcdg:FilterCell FieldName="Name" IsEnabled="True"/>
<xcdg:FilterCell FieldName="Type" IsEnabled="True">
<!-- TestListPopup control here -->
</xcdg:FilterCell>
</xcdg:FilterRow>
</DataTemplate>
</xcdg:TableflowView.FixedHeaders>
</xcdg:TableflowView>
</xcdg:DataGridControl.View>
<xcdg:DataGridControl.Columns>
<xcdg:Column FieldName="Name" Title="Name" />
<xcdg:Column FieldName="Type" Title="Type" Width="160"/>
</xcdg:DataGridControl.Columns>
</xcdg:DataGridControl>


In here though, the popup will not bind to the toggle button. Pressing the toggle button doesn't do anything.



I narrowed it down to the binding being broken, because if you set IsOpen="True", it's open (and not adhering to PlacementTarget), but again; it works perfectly outside of the DataGrid..



Why does a perfectly functional control break once put inside the FilterRow?



Any help is appreciated! :)










share|improve this question




























    up vote
    1
    down vote

    favorite












    I've made a Toggle, which expands a Popup window with a ListBox inside. It looks like so:



    <ToggleButton Name="Toggle" Height="20" Width="150" >
    <StackPanel>
    <TextBlock Text="TestListPopup"/>
    <Popup Height="200" Width="150"
    IsOpen="{Binding ElementName=Toggle, Path=IsChecked}"
    PlacementTarget="{Binding ElementName=Toggle}"
    HorizontalAlignment="Left"
    VerticalAlignment="Bottom">
    <ListBox SelectionMode="Multiple" SelectionChanged="TypeSelectionChanged" >
    <ListBoxItem Content="Test1"/>
    <ListBoxItem Content="Test2"/>
    <ListBoxItem Content="Test3"/>
    </ListBox>
    </Popup>
    </StackPanel>
    </ToggleButton>


    It works perfectly, but I want to use it inside the FilterRow of my xceed DataGrid here:



    <xcdg:DataGridControl x:Name="dataGrid"
    ItemsSource="{Binding Source={StaticResource DataSource}}">
    <xcdg:DataGridControl.View>
    <xcdg:TableflowView>
    <xcdg:TableflowView.FixedHeaders>
    <DataTemplate>
    <xcdg:ColumnManagerRow/>
    </DataTemplate>
    <DataTemplate>
    <xcdg:FilterRow>
    <xcdg:FilterCell FieldName="Name" IsEnabled="True"/>
    <xcdg:FilterCell FieldName="Type" IsEnabled="True">
    <!-- TestListPopup control here -->
    </xcdg:FilterCell>
    </xcdg:FilterRow>
    </DataTemplate>
    </xcdg:TableflowView.FixedHeaders>
    </xcdg:TableflowView>
    </xcdg:DataGridControl.View>
    <xcdg:DataGridControl.Columns>
    <xcdg:Column FieldName="Name" Title="Name" />
    <xcdg:Column FieldName="Type" Title="Type" Width="160"/>
    </xcdg:DataGridControl.Columns>
    </xcdg:DataGridControl>


    In here though, the popup will not bind to the toggle button. Pressing the toggle button doesn't do anything.



    I narrowed it down to the binding being broken, because if you set IsOpen="True", it's open (and not adhering to PlacementTarget), but again; it works perfectly outside of the DataGrid..



    Why does a perfectly functional control break once put inside the FilterRow?



    Any help is appreciated! :)










    share|improve this question


























      up vote
      1
      down vote

      favorite









      up vote
      1
      down vote

      favorite











      I've made a Toggle, which expands a Popup window with a ListBox inside. It looks like so:



      <ToggleButton Name="Toggle" Height="20" Width="150" >
      <StackPanel>
      <TextBlock Text="TestListPopup"/>
      <Popup Height="200" Width="150"
      IsOpen="{Binding ElementName=Toggle, Path=IsChecked}"
      PlacementTarget="{Binding ElementName=Toggle}"
      HorizontalAlignment="Left"
      VerticalAlignment="Bottom">
      <ListBox SelectionMode="Multiple" SelectionChanged="TypeSelectionChanged" >
      <ListBoxItem Content="Test1"/>
      <ListBoxItem Content="Test2"/>
      <ListBoxItem Content="Test3"/>
      </ListBox>
      </Popup>
      </StackPanel>
      </ToggleButton>


      It works perfectly, but I want to use it inside the FilterRow of my xceed DataGrid here:



      <xcdg:DataGridControl x:Name="dataGrid"
      ItemsSource="{Binding Source={StaticResource DataSource}}">
      <xcdg:DataGridControl.View>
      <xcdg:TableflowView>
      <xcdg:TableflowView.FixedHeaders>
      <DataTemplate>
      <xcdg:ColumnManagerRow/>
      </DataTemplate>
      <DataTemplate>
      <xcdg:FilterRow>
      <xcdg:FilterCell FieldName="Name" IsEnabled="True"/>
      <xcdg:FilterCell FieldName="Type" IsEnabled="True">
      <!-- TestListPopup control here -->
      </xcdg:FilterCell>
      </xcdg:FilterRow>
      </DataTemplate>
      </xcdg:TableflowView.FixedHeaders>
      </xcdg:TableflowView>
      </xcdg:DataGridControl.View>
      <xcdg:DataGridControl.Columns>
      <xcdg:Column FieldName="Name" Title="Name" />
      <xcdg:Column FieldName="Type" Title="Type" Width="160"/>
      </xcdg:DataGridControl.Columns>
      </xcdg:DataGridControl>


      In here though, the popup will not bind to the toggle button. Pressing the toggle button doesn't do anything.



      I narrowed it down to the binding being broken, because if you set IsOpen="True", it's open (and not adhering to PlacementTarget), but again; it works perfectly outside of the DataGrid..



      Why does a perfectly functional control break once put inside the FilterRow?



      Any help is appreciated! :)










      share|improve this question















      I've made a Toggle, which expands a Popup window with a ListBox inside. It looks like so:



      <ToggleButton Name="Toggle" Height="20" Width="150" >
      <StackPanel>
      <TextBlock Text="TestListPopup"/>
      <Popup Height="200" Width="150"
      IsOpen="{Binding ElementName=Toggle, Path=IsChecked}"
      PlacementTarget="{Binding ElementName=Toggle}"
      HorizontalAlignment="Left"
      VerticalAlignment="Bottom">
      <ListBox SelectionMode="Multiple" SelectionChanged="TypeSelectionChanged" >
      <ListBoxItem Content="Test1"/>
      <ListBoxItem Content="Test2"/>
      <ListBoxItem Content="Test3"/>
      </ListBox>
      </Popup>
      </StackPanel>
      </ToggleButton>


      It works perfectly, but I want to use it inside the FilterRow of my xceed DataGrid here:



      <xcdg:DataGridControl x:Name="dataGrid"
      ItemsSource="{Binding Source={StaticResource DataSource}}">
      <xcdg:DataGridControl.View>
      <xcdg:TableflowView>
      <xcdg:TableflowView.FixedHeaders>
      <DataTemplate>
      <xcdg:ColumnManagerRow/>
      </DataTemplate>
      <DataTemplate>
      <xcdg:FilterRow>
      <xcdg:FilterCell FieldName="Name" IsEnabled="True"/>
      <xcdg:FilterCell FieldName="Type" IsEnabled="True">
      <!-- TestListPopup control here -->
      </xcdg:FilterCell>
      </xcdg:FilterRow>
      </DataTemplate>
      </xcdg:TableflowView.FixedHeaders>
      </xcdg:TableflowView>
      </xcdg:DataGridControl.View>
      <xcdg:DataGridControl.Columns>
      <xcdg:Column FieldName="Name" Title="Name" />
      <xcdg:Column FieldName="Type" Title="Type" Width="160"/>
      </xcdg:DataGridControl.Columns>
      </xcdg:DataGridControl>


      In here though, the popup will not bind to the toggle button. Pressing the toggle button doesn't do anything.



      I narrowed it down to the binding being broken, because if you set IsOpen="True", it's open (and not adhering to PlacementTarget), but again; it works perfectly outside of the DataGrid..



      Why does a perfectly functional control break once put inside the FilterRow?



      Any help is appreciated! :)







      wpf listbox popup toggle xceed






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited Nov 8 at 13:18









      mm8

      79.1k81731




      79.1k81731










      asked Nov 8 at 11:21









      Hjalte Tagmose

      4518




      4518
























          1 Answer
          1






          active

          oldest

          votes

















          up vote
          1
          down vote



          accepted











          Why does a perfectly functional control break once put inside the FilterRow?




          Because the ToggleButton and the FilterCell don't belong to the same namescope.



          You may try to bind using an x:Reference:



          IsOpen="{Binding Path=IsChecked, Source={x:Reference Toggle}}"


          The other option would be to bind the IsChecked property of the ToggleButton to a bool property of a view model and also bind the IsOpen property of the Popup to the same source property. Make sure that the view model implements the INotifyPropertyChanged interface and raise change notifications when the source property is set.






          share|improve this answer





















          • Thank you! I knew there had to be a reasonable explanation. However the x:Reference solution puts the app into breakmode, with following error Cannot call MarkupExtension.ProvideValue because of a cyclical dependency. Properties inside a MarkupExtension cannot reference objects that reference the result of the MarkupExtension. The other solution isn't really gonna work for me either, because I might want multiple controls pr grid/view and I dont want a bunch of IsOpenX-vars. All that said you definitely gave me a big push in the right direction so thank you! :)
            – Hjalte Tagmose
            Nov 8 at 13:14










          • Okay I found out what was happening. Apparently a child cannot x:Reference its parent, so I just put the Popup beside the Toggle instead of inside it!
            – Hjalte Tagmose
            Nov 8 at 13:21











          Your Answer






          StackExchange.ifUsing("editor", function () {
          StackExchange.using("externalEditor", function () {
          StackExchange.using("snippets", function () {
          StackExchange.snippets.init();
          });
          });
          }, "code-snippets");

          StackExchange.ready(function() {
          var channelOptions = {
          tags: "".split(" "),
          id: "1"
          };
          initTagRenderer("".split(" "), "".split(" "), channelOptions);

          StackExchange.using("externalEditor", function() {
          // Have to fire editor after snippets, if snippets enabled
          if (StackExchange.settings.snippets.snippetsEnabled) {
          StackExchange.using("snippets", function() {
          createEditor();
          });
          }
          else {
          createEditor();
          }
          });

          function createEditor() {
          StackExchange.prepareEditor({
          heartbeatType: 'answer',
          convertImagesToLinks: true,
          noModals: true,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: 10,
          bindNavPrevention: true,
          postfix: "",
          imageUploader: {
          brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
          contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
          allowUrls: true
          },
          onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          });


          }
          });














           

          draft saved


          draft discarded


















          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53206739%2fpopup-doesnt-bind-to-toggle-when-inside-datagrid-xceed%23new-answer', 'question_page');
          }
          );

          Post as a guest
































          1 Answer
          1






          active

          oldest

          votes








          1 Answer
          1






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes








          up vote
          1
          down vote



          accepted











          Why does a perfectly functional control break once put inside the FilterRow?




          Because the ToggleButton and the FilterCell don't belong to the same namescope.



          You may try to bind using an x:Reference:



          IsOpen="{Binding Path=IsChecked, Source={x:Reference Toggle}}"


          The other option would be to bind the IsChecked property of the ToggleButton to a bool property of a view model and also bind the IsOpen property of the Popup to the same source property. Make sure that the view model implements the INotifyPropertyChanged interface and raise change notifications when the source property is set.






          share|improve this answer





















          • Thank you! I knew there had to be a reasonable explanation. However the x:Reference solution puts the app into breakmode, with following error Cannot call MarkupExtension.ProvideValue because of a cyclical dependency. Properties inside a MarkupExtension cannot reference objects that reference the result of the MarkupExtension. The other solution isn't really gonna work for me either, because I might want multiple controls pr grid/view and I dont want a bunch of IsOpenX-vars. All that said you definitely gave me a big push in the right direction so thank you! :)
            – Hjalte Tagmose
            Nov 8 at 13:14










          • Okay I found out what was happening. Apparently a child cannot x:Reference its parent, so I just put the Popup beside the Toggle instead of inside it!
            – Hjalte Tagmose
            Nov 8 at 13:21















          up vote
          1
          down vote



          accepted











          Why does a perfectly functional control break once put inside the FilterRow?




          Because the ToggleButton and the FilterCell don't belong to the same namescope.



          You may try to bind using an x:Reference:



          IsOpen="{Binding Path=IsChecked, Source={x:Reference Toggle}}"


          The other option would be to bind the IsChecked property of the ToggleButton to a bool property of a view model and also bind the IsOpen property of the Popup to the same source property. Make sure that the view model implements the INotifyPropertyChanged interface and raise change notifications when the source property is set.






          share|improve this answer





















          • Thank you! I knew there had to be a reasonable explanation. However the x:Reference solution puts the app into breakmode, with following error Cannot call MarkupExtension.ProvideValue because of a cyclical dependency. Properties inside a MarkupExtension cannot reference objects that reference the result of the MarkupExtension. The other solution isn't really gonna work for me either, because I might want multiple controls pr grid/view and I dont want a bunch of IsOpenX-vars. All that said you definitely gave me a big push in the right direction so thank you! :)
            – Hjalte Tagmose
            Nov 8 at 13:14










          • Okay I found out what was happening. Apparently a child cannot x:Reference its parent, so I just put the Popup beside the Toggle instead of inside it!
            – Hjalte Tagmose
            Nov 8 at 13:21













          up vote
          1
          down vote



          accepted







          up vote
          1
          down vote



          accepted







          Why does a perfectly functional control break once put inside the FilterRow?




          Because the ToggleButton and the FilterCell don't belong to the same namescope.



          You may try to bind using an x:Reference:



          IsOpen="{Binding Path=IsChecked, Source={x:Reference Toggle}}"


          The other option would be to bind the IsChecked property of the ToggleButton to a bool property of a view model and also bind the IsOpen property of the Popup to the same source property. Make sure that the view model implements the INotifyPropertyChanged interface and raise change notifications when the source property is set.






          share|improve this answer













          Why does a perfectly functional control break once put inside the FilterRow?




          Because the ToggleButton and the FilterCell don't belong to the same namescope.



          You may try to bind using an x:Reference:



          IsOpen="{Binding Path=IsChecked, Source={x:Reference Toggle}}"


          The other option would be to bind the IsChecked property of the ToggleButton to a bool property of a view model and also bind the IsOpen property of the Popup to the same source property. Make sure that the view model implements the INotifyPropertyChanged interface and raise change notifications when the source property is set.







          share|improve this answer












          share|improve this answer



          share|improve this answer










          answered Nov 8 at 12:50









          mm8

          79.1k81731




          79.1k81731












          • Thank you! I knew there had to be a reasonable explanation. However the x:Reference solution puts the app into breakmode, with following error Cannot call MarkupExtension.ProvideValue because of a cyclical dependency. Properties inside a MarkupExtension cannot reference objects that reference the result of the MarkupExtension. The other solution isn't really gonna work for me either, because I might want multiple controls pr grid/view and I dont want a bunch of IsOpenX-vars. All that said you definitely gave me a big push in the right direction so thank you! :)
            – Hjalte Tagmose
            Nov 8 at 13:14










          • Okay I found out what was happening. Apparently a child cannot x:Reference its parent, so I just put the Popup beside the Toggle instead of inside it!
            – Hjalte Tagmose
            Nov 8 at 13:21


















          • Thank you! I knew there had to be a reasonable explanation. However the x:Reference solution puts the app into breakmode, with following error Cannot call MarkupExtension.ProvideValue because of a cyclical dependency. Properties inside a MarkupExtension cannot reference objects that reference the result of the MarkupExtension. The other solution isn't really gonna work for me either, because I might want multiple controls pr grid/view and I dont want a bunch of IsOpenX-vars. All that said you definitely gave me a big push in the right direction so thank you! :)
            – Hjalte Tagmose
            Nov 8 at 13:14










          • Okay I found out what was happening. Apparently a child cannot x:Reference its parent, so I just put the Popup beside the Toggle instead of inside it!
            – Hjalte Tagmose
            Nov 8 at 13:21
















          Thank you! I knew there had to be a reasonable explanation. However the x:Reference solution puts the app into breakmode, with following error Cannot call MarkupExtension.ProvideValue because of a cyclical dependency. Properties inside a MarkupExtension cannot reference objects that reference the result of the MarkupExtension. The other solution isn't really gonna work for me either, because I might want multiple controls pr grid/view and I dont want a bunch of IsOpenX-vars. All that said you definitely gave me a big push in the right direction so thank you! :)
          – Hjalte Tagmose
          Nov 8 at 13:14




          Thank you! I knew there had to be a reasonable explanation. However the x:Reference solution puts the app into breakmode, with following error Cannot call MarkupExtension.ProvideValue because of a cyclical dependency. Properties inside a MarkupExtension cannot reference objects that reference the result of the MarkupExtension. The other solution isn't really gonna work for me either, because I might want multiple controls pr grid/view and I dont want a bunch of IsOpenX-vars. All that said you definitely gave me a big push in the right direction so thank you! :)
          – Hjalte Tagmose
          Nov 8 at 13:14












          Okay I found out what was happening. Apparently a child cannot x:Reference its parent, so I just put the Popup beside the Toggle instead of inside it!
          – Hjalte Tagmose
          Nov 8 at 13:21




          Okay I found out what was happening. Apparently a child cannot x:Reference its parent, so I just put the Popup beside the Toggle instead of inside it!
          – Hjalte Tagmose
          Nov 8 at 13:21


















           

          draft saved


          draft discarded



















































           


          draft saved


          draft discarded














          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53206739%2fpopup-doesnt-bind-to-toggle-when-inside-datagrid-xceed%23new-answer', 'question_page');
          }
          );

          Post as a guest




















































































          Popular posts from this blog

          鏡平學校

          ꓛꓣだゔៀៅຸ໢ທຮ໕໒ ,ໂ'໥໓າ໼ឨឲ៵៭ៈゎゔit''䖳𥁄卿' ☨₤₨こゎもょの;ꜹꟚꞖꞵꟅꞛေၦေɯ,ɨɡ𛃵𛁹ޝ޳ޠ޾,ޤޒޯ޾𫝒𫠁သ𛅤チョ'サノބޘދ𛁐ᶿᶇᶀᶋᶠ㨑㽹⻮ꧬ꧹؍۩وَؠ㇕㇃㇪ ㇦㇋㇋ṜẰᵡᴠ 軌ᵕ搜۳ٰޗޮ޷ސޯ𫖾𫅀ल, ꙭ꙰ꚅꙁꚊꞻꝔ꟠Ꝭㄤﺟޱސꧨꧼ꧴ꧯꧽ꧲ꧯ'⽹⽭⾁⿞⼳⽋២៩ញណើꩯꩤ꩸ꩮᶻᶺᶧᶂ𫳲𫪭𬸄𫵰𬖩𬫣𬊉ၲ𛅬㕦䬺𫝌𫝼,,𫟖𫞽ហៅ஫㆔ాఆఅꙒꚞꙍ,Ꙟ꙱エ ,ポテ,フࢰࢯ𫟠𫞶 𫝤𫟠ﺕﹱﻜﻣ𪵕𪭸𪻆𪾩𫔷ġ,ŧآꞪ꟥,ꞔꝻ♚☹⛵𛀌ꬷꭞȄƁƪƬșƦǙǗdžƝǯǧⱦⱰꓕꓢႋ神 ဴ၀க௭எ௫ឫោ ' េㇷㇴㇼ神ㇸㇲㇽㇴㇼㇻㇸ'ㇸㇿㇸㇹㇰㆣꓚꓤ₡₧ ㄨㄟ㄂ㄖㄎ໗ツڒذ₶।ऩछएोञयूटक़कयँृी,冬'𛅢𛅥ㇱㇵㇶ𥄥𦒽𠣧𠊓𧢖𥞘𩔋цѰㄠſtʯʭɿʆʗʍʩɷɛ,əʏダヵㄐㄘR{gỚṖḺờṠṫảḙḭᴮᵏᴘᵀᵷᵕᴜᴏᵾq﮲ﲿﴽﭙ軌ﰬﶚﶧ﫲Ҝжюїкӈㇴffצּ﬘﭅﬈軌'ffistfflſtffतभफɳɰʊɲʎ𛁱𛁖𛁮𛀉 𛂯𛀞నఋŀŲ 𫟲𫠖𫞺ຆຆ ໹້໕໗ๆทԊꧢꧠ꧰ꓱ⿝⼑ŎḬẃẖỐẅ ,ờỰỈỗﮊDžȩꭏꭎꬻ꭮ꬿꭖꭥꭅ㇭神 ⾈ꓵꓑ⺄㄄ㄪㄙㄅㄇstA۵䞽ॶ𫞑𫝄㇉㇇゜軌𩜛𩳠Jﻺ‚Üမ႕ႌႊၐၸဓၞၞၡ៸wyvtᶎᶪᶹစဎ꣡꣰꣢꣤ٗ؋لㇳㇾㇻㇱ㆐㆔,,㆟Ⱶヤマފ޼ޝަݿݞݠݷݐ',ݘ,ݪݙݵ𬝉𬜁𫝨𫞘くせぉて¼óû×ó£…𛅑הㄙくԗԀ5606神45,神796'𪤻𫞧ꓐ㄁ㄘɥɺꓵꓲ3''7034׉ⱦⱠˆ“𫝋ȍ,ꩲ軌꩷ꩶꩧꩫఞ۔فڱێظペサ神ナᴦᵑ47 9238їﻂ䐊䔉㠸﬎ffiﬣ,לּᴷᴦᵛᵽ,ᴨᵤ ᵸᵥᴗᵈꚏꚉꚟ⻆rtǟƴ𬎎

          Why https connections are so slow when debugging (stepping over) in Java?