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

RadTabControl problem

2 Answers 142 Views
TabControl
This is a migrated thread and some comments may be shown as answers.
Fatima
Top achievements
Rank 1
Fatima asked on 27 Oct 2011, 06:44 PM
hi,
i but 5 RadGridview in RadTabControl when we have many TabItem ,the problem is for each selected TabItem  the event load is launch.
for me all  RadGridView is loaded in the first time when i load the view. 

my question:there is a possibilty to stop load when i select TabItem  ?
i find just a possibilty to keep the already selected TabItem ,is not a solution for my problem because i want to block all event load.
 
thanks

2 Answers, 1 is accepted

Sort by
0
Petar Mladenov
Telerik team
answered on 01 Nov 2011, 02:55 PM
Hi Fatima,

When you select RadTabItem, the PreviewSelectionChanged event fires first and then comes the SelectionChanged event. You can perform some logic in the preview event and set e.handled = true so that the SelectionChanged is not fired.
On the other hand, how can you make so that not every GridView in your RadTabItems loads? You can use ContentTemplate like so:

<Grid x:Name="LayoutRoot">
 
        <Grid.Resources>
            <DataTemplate x:Key="contemplate">
                <telerik:RadGridViewView />
            </DataTemplate>
 
            <DataTemplate x:Key="itemplate">
                <TextBlock Text="{Binding Name}" />
            </DataTemplate>
        </Grid.Resources>
        <StackPanel>
 
            <telerik:RadTabControl ContentTemplate="{StaticResource contemplate}"
                                   ItemTemplate="{StaticResource itemplate}"
                                    
                                   x:Name="tab"/>
 
        </StackPanel>
    </Grid>
This way if you bind the TabControl to collection of 5 business objects , only the first RadGridView will load. If static RadTabItems were used, all the 5 RadGridView would have been loaded initially. 
Please let us know if this helped you.

Greetings,
Petar Mladenov
the Telerik team

Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

0
Fatima
Top achievements
Rank 1
answered on 01 Nov 2011, 06:53 PM
thanks for your answer ,it's helpful
Tags
TabControl
Asked by
Fatima
Top achievements
Rank 1
Answers by
Petar Mladenov
Telerik team
Fatima
Top achievements
Rank 1
Share this question
or