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
75
How to ActiveDataItem current row by RecordExpanding Event ?
posted

Hello,

i want to select current row into ActiveDataItem property by recordExpanding Event in xaml.
actually i used event trigger in xaml and i handled it into ViewModel and i don't want to use ViewModel or Code behind

<igDP:XamDataGrid x:Name="AlarmGrid"
                              DataSource="{Binding Path=Items}"
                              Padding="1"
                              FontSize="11"
                              BorderThickness="1"
                              BorderBrush="#E6000000"
                              ActiveDataItem="{Binding Path=ActiveItem, Mode=TwoWay}">
                <interactivity:Interaction.Triggers>
                    <interactivity:EventTrigger EventName="RecordExpanding">
                        <prism:InvokeCommandAction Command="{Binding RowExpandCommand}" />
                    </interactivity:EventTrigger>
                </interactivity:Interaction.Triggers>

  • 5875
    Offline posted

    Hello Reza,

    Thank you for your post. You can do something like this:

    <ig:XamDataGrid DataSource="{Binding People}" Grid.Row="1" InitializeRecord="XamDataGrid_InitializeRecord"
    ActiveDataItem="{Binding Path=ActiveItem, Mode=TwoWay}">

    <behaviors:Interaction.Behaviors>
    <loc:RecordExpandingBehavior />
    </behaviors:Interaction.Behaviors>
    <ig:XamDataGrid.FieldSettings>
    <ig:FieldSettings AllowRecordFiltering="true" CellClickAction="SelectRecord" />
    </ig:XamDataGrid.FieldSettings>

    </ig:XamDataGrid>

    Attached a project for your reference .Let me know if you have any question.


    Sincerely,
    Divya Jain

    TestSample.zip