This is a migrated thread and some comments may be shown as answers.

Refresh Radtabcontrol Item in WPF

1 Answer 177 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Dinakaran
Top achievements
Rank 1
Dinakaran asked on 02 Aug 2013, 06:59 AM
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.

1 Answer, 1 is accepted

Sort by
0
Pavel R. Pavlov
Telerik team
answered on 06 Aug 2013, 02:10 PM
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 >>
Tags
General Discussions
Asked by
Dinakaran
Top achievements
Rank 1
Answers by
Pavel R. Pavlov
Telerik team
Share this question
or