Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
225
MVVM Removing ActiveRecord on the DataPresenter
posted

Hi,

I have a datapresenter and i have 2 buttons (an up arrow and down arrow).

the purpose of the buttons is this:

if i select a record by clicking on a row, then i press the up arrow, it will move the activeRecord to the previous row.  If i click on the down arrow, it will move to the next record.

 

The problem i have is that when i set the CurrentRow in the view model to the row i want, the row I had selected still remains selected but is no longer active.  I need the row to also be deselected.

<igDP:XamDataPresenter.ActiveRecord>

                    <MultiBinding Converter="{StaticResource dataItemToRecordConverter}" Mode="TwoWay">

                        <Binding ElementName="DataPresenter" />

                        <Binding Path="CurrentRow" Mode="TwoWay" />

                    </MultiBinding>

                </igDP:XamDataPresenter.ActiveRecord>

 

I have tried binding IsActive and IsSelected Properties in my row's view model to reflect this.  the following is my xaml code:

 

<Style TargetType="{x:Type igDP:DataRecordPresenter}">

                    <Setter Property="IsActive" Value="{Binding IsActive, Mode=TwoWay}" />

                    <Setter Property="IsSelected" Value="{Binding IsSelected, Mode=TwoWay}" />

                </Style>

 

In my command after clicking a button, I set the viewmodel's IsActive and IsSelected to false, and I also set the previous record to the CurrentRow property however this solution did not work.

 

Any help would be great!

Parents
No Data
Reply
  • 4850
    Offline posted

    Hi,

    I'm not sure what exactly is happening here, but this may help. In the latest service release of 9.2 we added a property called ActiveDataItem. Binding this property to your underlying data item (not its associated record) will sync up the ActiveRecord. If this value goes to null it should null out the ActiveRecord.

    I hope this helps.

     

     

Children
No Data