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

Transition with two Grids?

9 Answers 238 Views
TransitionControl
This is a migrated thread and some comments may be shown as answers.
Kennet
Top achievements
Rank 2
Kennet asked on 07 Jun 2011, 11:12 AM
Hi,

I already have to Grid's (with controls inside) on my Window. How  do I transitions between these two Grid's. XAML code?

/Ken

9 Answers, 1 is accepted

Sort by
0
Miroslav Nedyalkov
Telerik team
answered on 08 Jun 2011, 08:14 AM
Hello Kennet,

 The TransitionControl is designed to displayed transitions between different Contents or ContentTemplates. Because of this you need to set either the Content or ContentTemplate in order to run the transition. For the sake of simplicity I suggest to change between your two grids the way you would do it if you had to change the Content or ContentTemplate of a normal ContentControl.

Hope this helps.

Regards,
Miroslav Nedyalkov
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
0
Joao Paulo
Top achievements
Rank 1
answered on 09 Jan 2013, 12:20 PM
Hi Miroslav,

Can you provide a simple sample?
0
Miroslav Nedyalkov
Telerik team
answered on 11 Jan 2013, 05:17 PM
Hello Joao,

You could refer to the demos application. You could also take a look at the Silverlight demos of the control here (the WPF version works exactly the same way).

Hope this helps.

All the best,
Miroslav Nedyalkov
the Telerik team

Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

0
Joao Paulo
Top achievements
Rank 1
answered on 12 Jan 2013, 01:48 AM
HI ,Miroslav.

Thank you for replying.
The samples provided use data binding.
I don't want use data bindind.
What I need is show one or another grid, using the control efect.

Regards, JP.
0
Vladi
Telerik team
answered on 14 Jan 2013, 04:00 PM
Hello Joao,

I created and attached a sample project for you showing how to use RadTransitionControl with GridView without bindings.

Hope this is helpful.

Kind regards,
Vladi
the Telerik team

Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

0
Amine
Top achievements
Rank 1
answered on 15 Feb 2014, 07:15 PM
hi
can you please tell me how i can pass datatable from mainwin to gridview in user control
can you please give a very small project to do this
thx in advance
0
Vladi
Telerik team
answered on 17 Feb 2014, 10:58 AM
Hi,

I am not sure what you mean by "datatable from mainwin" but if you want to pass the DataContext that is set in the MainWindow you could simply pass it by element name to the content that is set to the RadTransitionControl. The next code snippets shows the described approach:
  • In the MainWidnow:

<Window.Resources>
    <local:ViewModel x:Key="ViewModel"/>
</Window.Resources>
<Grid ShowGridLines="True" DataContext="{StaticResource ViewModel}" x:Name="MainGrid">
    <Grid.RowDefinitions>
        <RowDefinition Height="Auto"/>
        <RowDefinition/>
    </Grid.RowDefinitions>
    <StackPanel Grid.Row="0" Orientation="Horizontal" VerticalAlignment="Center" HorizontalAlignment="Center">
        <Button Content="Show GridView1.xaml" Click="Button_Click_1" Margin="10"/>
        <Button Content="Show GridView2.xaml" Click="Button_Click_2" Margin="10"/>
    </StackPanel>
    <telerik:RadTransitionControl x:Name="RadTransitionControl" Grid.Row="1" VerticalAlignment="Bottom">
        <telerik:RadTransitionControl.Content>
            <local:GridView1 DataContext="{Binding ElementName=MainGrid, Path=DataContext}"/>
        </telerik:RadTransitionControl.Content>
        <telerik:RadTransitionControl.Transition>
            <telerik:SlideAndZoomTransition />
        </telerik:RadTransitionControl.Transition>
    </telerik:RadTransitionControl>
</Grid>
  • And in the code behind where the content is changed:

private void Button_Click_1(object sender, RoutedEventArgs e)
{
    var gridView1 = new GridView1() { DataContext = this.MainGrid.DataContext };
    this.RadTransitionControl.Content = gridView1;
}
 
private void Button_Click_2(object sender, RoutedEventArgs e)
{
    var gridView2 = new GridView1() { DataContext = this.MainGrid.DataContext };
    this.RadTransitionControl.Content = gridView2;
}

The code snippets are taken from the previously attached sample project. Hope this is helpful.

Regards,
Vladi
Telerik

Check out the new Telerik Platform - the only modular platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native apps. Register for the free online keynote and webinar to learn more about the Platform on Wednesday, February 12, 2014 at 11:00 a.m. ET (8:00 a.m. PT).

0
Amine
Top achievements
Rank 1
answered on 18 Feb 2014, 09:59 PM
thx for response
i explain my case
i have an wpf application with a maiwindow and two control user,each control user contain a gridview,in the mainwindow i have a datatable that contain some data,when i click on a button in mainwindow the user control move normally(with transitioncontrol) and the gridview(contained on this user control) must be filled by the data contained in datable that belong to the mainwindow.

so,how can i pass the datatable to the the user control?

thx :)
0
Dimitrina
Telerik team
answered on 20 Feb 2014, 03:25 PM
Hi,

I would suggest you to check the "Various Data Sources" WPF Demo on how to set the ItemsSource specifying a valid Source for the Binding. There is also an option populating data from a DataTable.

Regards,
Didie
Telerik
Tags
TransitionControl
Asked by
Kennet
Top achievements
Rank 2
Answers by
Miroslav Nedyalkov
Telerik team
Joao Paulo
Top achievements
Rank 1
Vladi
Telerik team
Amine
Top achievements
Rank 1
Dimitrina
Telerik team
Share this question
or