Splliter inside RadTabItem

2 posts, 0 answers
  1. sachin
    sachin avatar
    7 posts
    Member since:
    Nov 2008

    Posted 27 Mar 2009 Link to this post


    I have a RAD TabControl and I want under one tab of it i a grid (to the Left) and  a textbox(to the Right) and a splitter in between them. 
    I am Creating grid dyanamically in C# file.following code will add grid into Tab.



    item = new RadTabItem();


    item.Content = dataGrid;

    But I have created Textbox and Splitter control in .xaml file as below code









    <Grid HorizontalAlignment="Stretch" VerticalAlignment="Stretch">




    <Grid.ColumnDefinitions><ColumnDefinition Width="3*"/><ColumnDefinition Width="1*" /></Grid.ColumnDefinitions>




    <Grid.RowDefinitions><RowDefinition Height="*"/></Grid.RowDefinitions>




    <telerik:RadTabControl x:Name="rtcTabControl"  Grid.Column="0" Grid.ColumnSpan="2" VerticalAlignment="Stretch" HorizontalAlignment="Stretch"  HorizontalContentAlignment="Stretch" VerticalContentAlignment="Stretch" />
    <basics:GridSplitter x:Name="gsBottom" Grid.Row="0" Canvas.ZIndex="200" Grid.Column="0" Grid.ColumnSpan="1" Width="10" HorizontalAlignment="Right" VerticalAlignment="Stretch"/>




    <TextBox x:Name="txtMailView"  Grid.Row="0" Grid.Column="1"></TextBox>










    Now my spliiter control Comes ahead of TabControl and also as its not child of TabItem, its height is also bigger than grid and Textbox.

    Please help me how can i do this ?
    Do i need to create Textbox and GridSplitter dyanamically ? if yes can anyone provide me source code of it ?


  2. Bobi
    Bobi avatar
    513 posts

    Posted 30 Mar 2009 Link to this post

    Hello sachin,

    I suggest that you try to format the elements using some grid for example. First add all the elements ( I mean the DataGrid,Splitter and TextBox controls) to the grid and format it correctly and after that add the grid to the TabItem. (You can do this in XMAL or CodeBehind).
    Your mistake is that you set the content of the TabItem to dataGrid without adding the splitter and the TextBox into the Tabitem.

    The second choice is similar to our online example:

    You can Define in XAML:
    <telerik:RadTabControl x:Name="rtcTabControl" >
      <telerik:RadTabItem Header="SomeText">
            <StackPanel Orientation="Horizontal">
                <Grid x:name="MainGrid"/>

    And after that in code behind just add something like this:


    I hope that this will help you.

    Best wishes,
    the Telerik team

    Check out Telerik Trainer , the state of the art learning tool for Telerik products.
Back to Top