Refresh Radtabcontrol Item in WPF

2 posts, 0 answers
  1. Dinakaran
    Dinakaran avatar
    9 posts
    Member since:
    Aug 2013

    Posted 02 Aug 2013 Link to this post

    I'm using radtabcontrol and added another screen(pending screen) as grid in the radcontrolItem like this,

    Radcontrol.xaml
    <telerik:RadTabItem  >
                        <telerik:RadTabItem.Content>
                         
     
                                <Grid  Name="displaypending" >
                                    <Grid.RowDefinitions>
     
                                        <RowDefinition Height="*" />
     
                                    </Grid.RowDefinitions>
     
                                </Grid>
                        
                        </telerik:RadTabItem.Content>
                    </telerik:RadTabItem>

    Radcontrol.xaml.cs

    if (displaypending != null)
                  {
                      displaypending.Children.Clear();
                      Pending pending = new Pending();
                      displaypending.Children.Add(pending);
                      IsScanningAllowed = ApplicationVariables.IsScannerInitiated;
                    }

    RadtabItem Content Header will be changed based on button click of pending screen, but i can't able to get changed header immediately after the button click, i need to reload the screen manually to get the changed header. So how to get the changed header without manually reload.
  2. Pavel R. Pavlov
    Admin
    Pavel R. Pavlov avatar
    1182 posts

    Posted 06 Aug 2013 Link to this post

    Hi Dinakaran,

    The best way to update the UI at runtime is to use DataTemplates in combination with bindings. In your case you can implement an MVVM approach to achieve your requirement. You can define the ItemTemplate property of the RadTabControl to customize the header of the RadTabItems (read more).

    Furthermore, you can implement the INotifyPropertyChanged interface in order to be able to change the headers text from code.

    For your convenience I prepared a sample demonstration project. Please take a look at it and let me know if it works for you.

    Regards,
    Pavel R. Pavlov
    Telerik
    TRY TELERIK'S NEWEST PRODUCT - EQATEC APPLICATION ANALYTICS for WPF.
    Learn what features your users use (or don't use) in your application. Know your audience. Target it better. Develop wisely.
    Sign up for Free application insights >>
  3. UI for WPF is Visual Studio 2017 Ready
Back to Top