Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SetFocusOnEntryCompletedBehavior - to set focus on the cell in the next row #177

Open
RafalZe opened this issue May 1, 2024 · 3 comments

Comments

@RafalZe
Copy link

RafalZe commented May 1, 2024

How to use toolkit 'SetFocusOnEntryCompletedBehavior' or other to set focus on the cell in the next row and current column 'Stock'?

<dg:DataGridColumn Title="Stock">
    <dg:DataGridColumn.CellTemplate >
          <DataTemplate>
             <Grid BackgroundColor="White">

                 <Entry
                     x:Name="Entry_SetStock"
                     toolkit:SetFocusOnEntryCompletedBehavior.NextElement=" ... "
                     x:DataType="model:BoxedBearingDgItem"
                     Focused="Entry_Focused"
                     IsEnabled="True"
                     ReturnCommand="{Binding Source={RelativeSource AncestorType={x:Type vm:BoxedBearingVM}},
                                                      Path=Dg_EntrySetStock_ReturnCommand}"
                     ReturnCommandParameter="{Binding Source={x:Reference Entry_SetStock}}"
                     ReturnType="Default"
                     Text="{Binding Stock}" />

                     <!--ReturnCommandParameter="{Binding Source={x:RelativeSource AncestorType={x:Type 
                                                                            pages:BoxedBearingPage}}, Path=Dg}"-->

             </Grid>
         </DataTemplate>
     </dg:DataGridColumn.CellTemplate>
</dg:DataGridColumn>
@symbiogenesis
Copy link
Collaborator

Is the idea to have some kind of stock ticker? You should be able to continually add to the beginning of a collection, and subscribe to the CollectionChanged event of the grid to set the focus.

@RafalZe
Copy link
Author

RafalZe commented May 7, 2024

'Stock' is a property inside the database entity model. It is presented being a part of the item source of data grid.

@symbiogenesis
Copy link
Collaborator

Did you figure anything out for this?

It still isn't fully clear what you mean, but it sounds like a workaround for now might involve walking up or down the visual tree using codebehind.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants