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

Splliter inside RadTabItem

1 Answer 87 Views
TabControl
This is a migrated thread and some comments may be shown as answers.
sachin
Top achievements
Rank 1
sachin asked on 27 Mar 2009, 11:54 AM
Hi

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.

RadTabItem

 

item = new RadTabItem();

 

item.Content = dataGrid;


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

 

 

<

 

telerikExpand:RadExpander.Content>

 

 

 

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

 

 

 

</Grid></telerikExpand:RadExpander.Content>

 

 

 

 

 

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 ?

Regards,
sachin

1 Answer, 1 is accepted

Sort by
0
Bobi
Telerik team
answered on 30 Mar 2009, 12:07 PM
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:
http://demos.telerik.com/silverlight/default.aspx#TabControl/FirstLook

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


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

MainGrid.Children(dataGrid);

I hope that this will help you.

Best wishes,
Boryana
the Telerik team

Check out Telerik Trainer , the state of the art learning tool for Telerik products.
Tags
TabControl
Asked by
sachin
Top achievements
Rank 1
Answers by
Bobi
Telerik team
Share this question
or