Transition with two Grids?

10 posts, 0 answers
  1. Kennet
    Kennet avatar
    104 posts
    Member since:
    Jun 2009

    Posted 07 Jun 2011 Link to this post

    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
  2. Miroslav Nedyalkov
    Admin
    Miroslav Nedyalkov avatar
    1718 posts

    Posted 08 Jun 2011 Link to this post

    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
  3. UI for WPF is Visual Studio 2017 Ready
  4. Joao Paulo
    Joao Paulo avatar
    6 posts
    Member since:
    Dec 2012

    Posted 09 Jan 2013 Link to this post

    Hi Miroslav,

    Can you provide a simple sample?
  5. Miroslav Nedyalkov
    Admin
    Miroslav Nedyalkov avatar
    1718 posts

    Posted 11 Jan 2013 Link to this post

    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.

  6. Joao Paulo
    Joao Paulo avatar
    6 posts
    Member since:
    Dec 2012

    Posted 11 Jan 2013 Link to this post

    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.
  7. Vladi
    Admin
    Vladi avatar
    744 posts

    Posted 14 Jan 2013 Link to this post

    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.

  8. Amine
    Amine avatar
    4 posts
    Member since:
    Oct 2012

    Posted 15 Feb 2014 in reply to Vladi Link to this post

    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
  9. Vladi
    Admin
    Vladi avatar
    744 posts

    Posted 17 Feb 2014 Link to this post

    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).

  10. Amine
    Amine avatar
    4 posts
    Member since:
    Oct 2012

    Posted 18 Feb 2014 in reply to Vladi Link to this post

    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 :)
  11. Dimitrina
    Admin
    Dimitrina avatar
    3769 posts

    Posted 20 Feb 2014 Link to this post

    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
Back to Top
UI for WPF is Visual Studio 2017 Ready