Telerik Forums
UI for WPF Forum
1 answer
483 views
Hi all,

we have problems with the RadDocking Control.
Any RadPane's in the xaml file are declared as Hidden.
After Start my Program, you can click on the textblock control in Left Pane
for showing 2 Top Panes. When i click on the Pane 2 showing 3 additional Panes on Bottom.
The Program crashed when i click often on any Bottom Pane.

Here is my code:

XAML
<Window x:Class="DockingTest.MainWindow"
        Title="MainWindow" Height="350" Width="525">
    <Grid>
        <telerik:RadDocking Name="RadDocking" ActivePaneChanged="RadDocking_ActivePaneChanged">
            <telerik:RadDocking.DocumentHost>
                <telerik:RadSplitContainer>
                    <telerik:RadPaneGroup Name="RadPaneGroup_Top">
                        <telerik:RadPane Header="Informationen zur Analyse" Name="RadPane_Informationen" IsHidden="True">
                            <telerik:RadPane.Content>
                                <Grid>
                                    <TextBlock Text="Here is a Text in Pane Top #1"/>
                                </Grid>
                            </telerik:RadPane.Content>
                        </telerik:RadPane>
                        <telerik:RadPane Header="Teilbauwerke" Name="RadPane_Teilbauwerke" IsHidden="True">
                            <telerik:RadPane.Content>
                                <Grid>
                                    <TextBlock Text="Here is a Text in Pane Top #2"/>
                                </Grid>
                            </telerik:RadPane.Content>
                        </telerik:RadPane>
                    </telerik:RadPaneGroup>
                </telerik:RadSplitContainer>
            </telerik:RadDocking.DocumentHost>
            <telerik:RadSplitContainer telerik:DockingPanel.InitialSize="250,150" MaxWidth="600" InitialPosition="DockedLeft">
                <telerik:RadPaneGroup>
                    <telerik:RadPane Header="Übersicht Analysen" CanUserClose="False">
                        <Grid>
                            <TextBlock Text="Here is a Text in Pane Left... Click to Show Top Panes." TextWrapping="Wrap" MouseDown="TextBlock_MouseDown"/>
                        </Grid>
                    </telerik:RadPane>
                </telerik:RadPaneGroup>
            </telerik:RadSplitContainer>
            <telerik:RadSplitContainer Name="RadSplitContainer_Bottom" telerik:DockingPanel.InitialSize="400, 250" InitialPosition="DockedBottom" Orientation="Horizontal" HorizontalAlignment="Stretch">
                <telerik:RadPaneGroup HorizontalAlignment="Stretch" Name="RadPaneGroup_Bottom" >
                    <telerik:RadPane Header="Grundinformationen" Name="RadPane_Teilbauwerk_Pane1" IsHidden="True" IsSelected="True">
                        <telerik:RadPane.Content>
                            <Grid>
                                <TextBlock Text="Here is a Text in Pane #1"/>
                            </Grid>
                        </telerik:RadPane.Content>
                    </telerik:RadPane>
                    <telerik:RadPane Header="Pane #2" x:Name="RadPane_Teilbauwerk_Pane2" IsHidden="True">
                        <telerik:RadPane.Content>
                            <Grid>
                                <TextBlock Text="Here is a Text in Pane #2"/>
                            </Grid>
                        </telerik:RadPane.Content>
                    </telerik:RadPane>
                    <telerik:RadPane Header="Pane #3" Name="RadPane_Teilbauwerk_Pane3" IsHidden="True">
                        <telerik:RadPane.Content>
                            <Grid>
                                <TextBlock Text="Here is a Text in Pane #3"/>
                            </Grid>
                        </telerik:RadPane.Content>
                    </telerik:RadPane>
                </telerik:RadPaneGroup>
            </telerik:RadSplitContainer>
        </telerik:RadDocking>
    </Grid>
</Window>

Code behind:

private void RadDocking_ActivePaneChanged(object sender, Telerik.Windows.Controls.Docking.ActivePangeChangedEventArgs e)
{
    if (this.RadDocking.ActivePane.Header.ToString() == "Teilbauwerke")
    {
        this.RadPane_Teilbauwerk_Pane1.IsHidden = false;
        this.RadPane_Teilbauwerk_Pane2.IsHidden = false;
        this.RadPane_Teilbauwerk_Pane3.IsHidden = false;
 
    }
    else
    {
        this.RadPane_Teilbauwerk_Pane1.IsHidden = true;
        this.RadPane_Teilbauwerk_Pane2.IsHidden = true;
        this.RadPane_Teilbauwerk_Pane3.IsHidden = true;
    }
}
 
private void TextBlock_MouseDown(object sender, MouseButtonEventArgs e)
{
    this.RadPane_Teilbauwerk_Pane1.IsHidden = true;
    this.RadPane_Teilbauwerk_Pane2.IsHidden = true;
    this.RadPane_Teilbauwerk_Pane3.IsHidden = true;
 
    this.RadPane_Informationen.IsHidden = false;
    this.RadPane_Teilbauwerke.IsHidden = false;
 
 
    this.RadPane_Informationen.IsSelected = true;
}

Thanks for helping.
Armin
Top achievements
Rank 1
 answered on 19 Sep 2012
1 answer
86 views
Hi Team,

When ever i used grid column width as * , the width of the next column value is changing dynamically based on the content of * width Column. But the same code working nicely in RibbonBar and  Normal Window. But when the same code paste in Ribbon View BackstageItem the designing is disturbing. Please look at the below code snippet and help me.

  <Grid DataContext="{StaticResource ViewModel}">
                                <Grid.RowDefinitions>
                                    <RowDefinition Height="11"></RowDefinition>
                                    <RowDefinition Height="auto"></RowDefinition>
                                    <RowDefinition Height="7"></RowDefinition>
                                    <RowDefinition Height="*"></RowDefinition>
                                    <RowDefinition Height="7"></RowDefinition>
                                    <RowDefinition Height="auto"></RowDefinition>
                                    <RowDefinition Height="11"></RowDefinition>
                                </Grid.RowDefinitions>
                                <Grid.ColumnDefinitions>
                                    <ColumnDefinition Width="11"></ColumnDefinition>
                                    <ColumnDefinition Width="*"></ColumnDefinition> ( if  Width="1000' , it is working superb..)
                                    <ColumnDefinition Width="7"></ColumnDefinition>
                                    <ColumnDefinition Width="auto"></ColumnDefinition>
                                    <ColumnDefinition Width="7"></ColumnDefinition>
                                    <ColumnDefinition Width="auto"></ColumnDefinition>
                                    <ColumnDefinition Width="11"></ColumnDefinition>
                                </Grid.ColumnDefinitions>
                                
                                <ItemsControl Name="lstLocations" Grid.Row="1" Grid.Column="1" Grid.ColumnSpan="5"  ItemsSource="{Binding _lstLevels}">
                                    <ItemsControl.ItemTemplate>
                                        <DataTemplate>
                                            <Button Margin="10" Name="btnLevel" Command="{Binding GetRoomsbyLevelCommand,Source={StaticResource ViewModel}}" CommandParameter="{Binding Path=Tag,ElementName=btnLevel}" Tag="{Binding}" MinHeight="80" MinWidth="80" Content="{Binding Name}"/>
                                        </DataTemplate>
                                    </ItemsControl.ItemTemplate>
                                    <ItemsControl.ItemsPanel>
                                        <ItemsPanelTemplate>
                                            <telerik:RadWrapPanel />
                                        </ItemsPanelTemplate>
                                    </ItemsControl.ItemsPanel>
                                </ItemsControl>


                                <Border Background="LightGray" Grid.Row="3" Grid.Column="1" Grid.ColumnSpan="5" CornerRadius="10">
                                <ItemsControl Name="lstRooms" Grid.Row="3" Grid.Column="1" Grid.ColumnSpan="5" ItemsSource="{Binding lstRooms,Mode=TwoWay}">
                                        <ItemsControl.ItemTemplate>
                                            <DataTemplate>
                                                <Button Margin="25,10,0,10" Background="{Binding RoomClass.Color,Converter={StaticResource ColorConverter}}" Name="btnRooms" Height="50" Width="50" Content="{Binding Name}"/>
                                            </DataTemplate>
                                        </ItemsControl.ItemTemplate>
                                        <ItemsControl.ItemsPanel>
                                            <ItemsPanelTemplate>
                                                <WrapPanel HorizontalAlignment="Left"></WrapPanel>
                                            </ItemsPanelTemplate>
                                        </ItemsControl.ItemsPanel>
                                    </ItemsControl>
                                </Border>


                                <Border Background="Gray" CornerRadius="10"  Grid.Row="5" Grid.Column="1">
                                    <ItemsControl Name="lstRoomsClass"  ItemsSource="{Binding _lstRoomClass}">
                                        <ItemsControl.ItemTemplate>
                                            <DataTemplate>
                                                <Button Margin="25,10,0,10" Name="btnRoomClass"  Background="{Binding Color,Converter={StaticResource ColorConverter}}" Command="{Binding CreateRoomsInLevelCommand,Source={StaticResource ViewModel}}" CommandParameter="{Binding Path=Tag,ElementName=btnRoomClass}" Tag="{Binding}" Height="50" Width="50" Content="{Binding Name}"/>
                                            </DataTemplate>
                                        </ItemsControl.ItemTemplate>
                                        <ItemsControl.ItemsPanel>
                                            <ItemsPanelTemplate>
                                                <WrapPanel Orientation="Horizontal" HorizontalAlignment="Left"></WrapPanel>
                                            </ItemsPanelTemplate>
                                        </ItemsControl.ItemsPanel>
                                    </ItemsControl>
                                </Border>

                                <Button IsDefault="True" Content="OK" Grid.Row="5" Grid.Column="3" Height="80" Width="80"  Name="btnAddRooms"  Command="{Binding SaveFirmDataCommand}"    />

                                <Button  Content="Cancel" Grid.Row="5" Grid.Column="5" Height="80" Width="80"  Name="btnCancelRooms" />

                            </Grid> 

Thanks, 
Srinivas.
Tina Stancheva
Telerik team
 answered on 19 Sep 2012
1 answer
151 views
Hi, I try binding command, but it doesn't work.

private readonly EmployeeContextViewModel _ucvm;
public MainWindow() // RadWindow
{
    InitializeComponent();
     _ucvm = new EmployeeContextViewModel();
     DataContext = _ucvm;  // <<<<<<<<<
}

xaml:

<t:RadButton Content="Exit"
        x:Name="LoginButton"
      Command="{Binding LogoutCommand}"/>

But it works when I indicates the specific component:

public MainWindow()
{
    InitializeComponent();
     _ucvm = new EmployeeContextViewModel();
    LoginButton.DataContext = _ucvm; // <<<<<<<<<<<<<< 
}
everything works fine.
Why doesnot work in the first case and how to fix it?

Vladi
Telerik team
 answered on 19 Sep 2012
1 answer
131 views
The default time format seems to be 12hr format that shows AM and PM.

Is there a way to display the time format in 24h time instead?
Tsvetie
Telerik team
 answered on 19 Sep 2012
4 answers
225 views

Hi,

The IsBusy property of my RadGridView is Bound to the IsChecked property of a checkbox, so if the checkbox is checked the grid shows the loading animation, if you uncheck it the grid shows the data. The problem is that, it only works once. So if you check the chkbx loading is displayed, uncheck and data is shown. Try the second time, third, forth, etc and the loading animation does not appear anymore.

Any ideas how to make it work every time I check the checkbox?

Thanks, Bye,

Andras

Vlad
Telerik team
 answered on 19 Sep 2012
2 answers
125 views
I follow the example in the WPF Control Examples application and Telerik website http://www.telerik.com/help/wpf/raddraganddrop-within-radgridview.html . I was able to make it work with the sample "MessageViewModel" as the RadGridView.ItemSource. However, when I change the RadGridView.ItemSource to DataView (data is retreiving from DB as DataTable), I got error "Cannot insert external objects to this list." at line:

((sender 

as RadGridView).ItemsSource as IList).Insert(index, draggedItem);

Does this feature work with DataView as ItemSource? How do I need to change to make it work?

Thanks

 

Insight
Top achievements
Rank 1
 answered on 18 Sep 2012
8 answers
277 views
I saw this post: http://www.telerik.com/community/forums/wpf/tileview/tileview-item-header-background.aspx but it really seems overkill for such a simple property change. Is there a better(easier) way to just set the background bush for the header? For certain tiles that need to reflect a change I want to set the header background to a custom linear brush. I tried using a custom template but it only changed it for the text area and not the whole header item. I also tried the example attached in the other forum post but it didn't look correct, maybe cause we're using the metro theme?

Anyway, is there a solution I've overlooked?

Robert
Tina Stancheva
Telerik team
 answered on 18 Sep 2012
0 answers
81 views
Hi, I have got a GridView in Metro style. 
Why some column separator is disappeared? When I resize the window, some separators disappear and another appear.
Please see atache.
Thanks


// edited
RadGricView have got ColumnWidth="*"
Sergiy
Top achievements
Rank 1
 asked on 18 Sep 2012
5 answers
203 views
I am currently using the solution outlined this post http://blogs.telerik.com/vladimirenchev/posts/10-05-31/how-to-synchronize-your-ui-selected-items-with-your-data-context-using-mvvm-and-blend-behaviors-for-silverlight-and-wpf.aspx 

to set my SelectedItem and SelectedItems from a RadGrid to a property on my viewModel (this works great by the way -thank you). What I am trying to do now is the same approach for a child grid of that same grid. I need to set SelectedDetailItem and SelectedDetailItems I believe the same approach will work but I cannot access my SelectedDetailItem  and SelectedDetailItems properties (which belong to my view model) from this child grid. I simply cannot get them to bind.

I have tried a few different things such as neither of which have worked.

SelectedItem="{Binding RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type UserControl}}, Path=DataContext.
SelectedDetailItem}"

and

SelectedItem="{Binding SelectedDetailItem,ElementName=myViewName}"
 

Do you have any ideas on how to bind the SelectedItem from a child grid to a property on a view model?
papadi
Top achievements
Rank 1
 answered on 18 Sep 2012
2 answers
193 views
Hi,

I'm looking at using the Docking control in my application, I have used the RadDock in a WinForms app and was wondering if this works in a similar way? 

What I want to have is a RibbonBar where different views/windows can be loaded into the the RadDocking. is it possible to load views/windows this way or how should this be done.

thanks 

David.
Ivo
Telerik team
 answered on 18 Sep 2012
Narrow your results
Selected tags
Tags
+? more
Top users last month
Jay
Top achievements
Rank 3
Iron
Iron
Iron
Benjamin
Top achievements
Rank 3
Bronze
Iron
Veteran
Radek
Top achievements
Rank 2
Iron
Iron
Iron
Bohdan
Top achievements
Rank 2
Iron
Iron
Richard
Top achievements
Rank 4
Bronze
Bronze
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Jay
Top achievements
Rank 3
Iron
Iron
Iron
Benjamin
Top achievements
Rank 3
Bronze
Iron
Veteran
Radek
Top achievements
Rank 2
Iron
Iron
Iron
Bohdan
Top achievements
Rank 2
Iron
Iron
Richard
Top achievements
Rank 4
Bronze
Bronze
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?