locked
Access Data Inside HubSection RRS feed

  • Question

  • Please,Help me.
    If I have a text box in a hup section, How I can get data from in if the grid that have the textbox in a DataTemplete?


    <Hub Style="{StaticResource HubStyle1}">
                <Hub.Header>
    
                  **********
                </Hub.Header>
    
    <HubSection Width="731" Style="{StaticResource HubSectionStyle1}">
    
     <DataTemplate>
    
    
     <Grid  FlowDirection="RightToLeft" Margin=" 0,10,0,0" >
    *
    *
    *
                         
    <TextBox  Grid.Row="0" Grid.Column="1"     Style="{StaticResource AddTextBlockStyle}" />
    *
    *
    *
    




    Monday, December 30, 2013 8:10 PM

Answers

  • Typically you would bind the Text to a property in your code-behind. The next most common would be to access it from an event.

    If you need more specific answers please provide more details about how and why you need this data. Sharing a minimal sample app that demonstrates how you are trying to use it may help.

    --Rob

    • Proposed as answer by L A U R E N S Tuesday, December 31, 2013 12:25 PM
    • Marked as answer by Anne Jing Monday, January 6, 2014 8:35 AM
    Monday, December 30, 2013 8:33 PM
    Moderator
  • Since it is not possible to access your controls inside DataTemplate therefore, either you should do any actions on their Loaded Event or make a separate UserControl and add it to the Hub Section.
    • Marked as answer by GhadaNaim Wednesday, January 8, 2014 6:55 PM
    Tuesday, December 31, 2013 7:31 AM

All replies

  • Typically you would bind the Text to a property in your code-behind. The next most common would be to access it from an event.

    If you need more specific answers please provide more details about how and why you need this data. Sharing a minimal sample app that demonstrates how you are trying to use it may help.

    --Rob

    • Proposed as answer by L A U R E N S Tuesday, December 31, 2013 12:25 PM
    • Marked as answer by Anne Jing Monday, January 6, 2014 8:35 AM
    Monday, December 30, 2013 8:33 PM
    Moderator
  • Since it is not possible to access your controls inside DataTemplate therefore, either you should do any actions on their Loaded Event or make a separate UserControl and add it to the Hub Section.
    • Marked as answer by GhadaNaim Wednesday, January 8, 2014 6:55 PM
    Tuesday, December 31, 2013 7:31 AM