Telerik Forums
UI for WPF Forum
2 answers
148 views
Hi,

Can telerik datagrid has a feature of zoom in and zoom out?
so grid data can be viewed properly.
Guru
Top achievements
Rank 2
 answered on 09 Sep 2011
11 answers
302 views
Hello,

I have a WPF application in which I load a multipage tiff file and use the TileView Control to display the BitmapFrames in tiles. The end user needs to change the order of the pages(tiles) and the save the tiff. The dragging of the tiles works ok but I also need to change the order of the objects in the ObservableCollection<PageViewModel> which is bound to the ItemsSource of the TileView. How can I achieve that ?

Thanks,

Alex.
Peter
Top achievements
Rank 1
 answered on 09 Sep 2011
5 answers
2.3K+ views

Hello,
how i can multi bind a column? I tried the to set multibinding to DataMemeberBinding but i gives me a compilation error

<tel:GridViewColumn.DataMemberBinding> 
     <MultiBinding Converter="{StaticResource PriceByCurrency}" Mode="OneWay">  
            <Binding Path="Price"/>  
            <Binding Path="DefaultCurrency"/>  
      </MultiBinding> 
</tel:GridViewColumn.DataMemberBinding> 

Thanks
Vanya Pavlova
Telerik team
 answered on 09 Sep 2011
4 answers
178 views
I'm dragging and dropping from one of two RadGridViews (Players and Teams) to another RadGridView (Games) which is configured as a 2-level-deep hierarchical grid.  I'm trying to allow users to drag Teams to a Game row and then Players to Game rows, as below:


  1. Team A
  2. Team B
  3. Team C
  • Game A
    • Team A
      • Player A
      • Player B
    • Team B
      • Player C
    • Team C
  • Game B
    • Team A
    • Team B
      • Player A
      • Player G

  1. Player A
  2. Player B
  3. Player C





How can I determine which row has had (or is about to have) something dropped on it?

I've tried your example that uses

private void RadGridView_Drop(object sender, DragEventArgs e) {
    var destinationRow = SampleGrid.GetElementsInHostCoordinates<GridViewRow>(Mouse.GetPosition(null)).First();
 
    if (destinationRow != null) {
        MessageBox.Show("Dropped on row:" + ((IList) SampleGrid.ItemsSource).IndexOf(destinationRow.DataContext));
    }
}


but it doesn't work, if for no other reason than that Mouse.GetPosition(null) always returns {0,0} if the drag cue is non-null.

How can I determine which target row the droppable object is over at any given time?
Lynne
Top achievements
Rank 1
 answered on 08 Sep 2011
3 answers
158 views
Hello,

I have a a RibbonView hosted in my MainWiindow. All the RibbonTabs (and the ContextualTabs) are defined in the MainWindow.xaml. The second part in the MainWindow is a RadTabControl that is used for showing all ViewModels (and the corresponding Views).
Every UserControl in the RadTabControl has a corresponding ContextualRibbonTab. The Command of the RibbonButtons inside the ContextualTabs are bound to commands in the SelectedItem of the RadTabControl (Commands defined in the ViewModel). Everything works fine, the only problem is, that everytime a new Tab get's loaded in the RadTabControl, WPF tries to bind all the Commands of all ContextualTabs to the currently SelectedItem in the RadTabControl, which causes a lot of binding errors for those commands that don't exist in the currentyl active viewmodel. Is there a way to prevent WPF from rebinding alle the commands, i all want to bind the Commands of the corresponding ContextualTab.

Here is the definition of my RibbonTabs:
<!--Kontext Tab's-->
            <telerik:RadRibbonView.ContextualGroups>
                <telerik:RadRibbonContextualGroup  x:Name="uxContextualGroupCustomerOverview"
                                                       Header="Kunden"
                                                       Color="Goldenrod">
                    <telerik:RadRibbonContextualGroup.Style>
                        <Style TargetType="telerik:RadRibbonContextualGroup">
                            <Style.Triggers>
                                <DataTrigger Binding="{Binding WorkspaceView.CurrentItem.ContextualTabGroup}" Value="Kundenübersicht">
                                    <Setter Property="IsActive" Value="True"/>
                                </DataTrigger>
                            </Style.Triggers>
                        </Style>
                    </telerik:RadRibbonContextualGroup.Style>
                </telerik:RadRibbonContextualGroup>
                <telerik:RadRibbonContextualGroup  x:Name="uxContextualGroupEvents"
                                                       Header="Veranstaltungen"
                                                       Color="Orchid">
                    <telerik:RadRibbonContextualGroup.Style>
                        <Style TargetType="telerik:RadRibbonContextualGroup">
                            <Style.Triggers>
                                <DataTrigger Binding="{Binding WorkspaceView.CurrentItem.ContextualTabGroup}" Value="Veranstaltungsübersicht">
                                    <Setter Property="IsActive" Value="True"/>
                                </DataTrigger>
                            </Style.Triggers>
                        </Style>
                    </telerik:RadRibbonContextualGroup.Style>
                </telerik:RadRibbonContextualGroup>
                <telerik:RadRibbonContextualGroup  x:Name="uxContextualGroupEmployeeOverView"
                                                       Header="Mitarbeiter"
                                                       Color="IndianRed">
                    <telerik:RadRibbonContextualGroup.Style>
                        <Style TargetType="telerik:RadRibbonContextualGroup">
                            <Style.Triggers>
                                <DataTrigger Binding="{Binding WorkspaceView.CurrentItem.ContextualTabGroup}" Value="Mitarbeiterübersicht">
                                    <Setter Property="IsActive" Value="True"/>
                                </DataTrigger>
                            </Style.Triggers>
                        </Style>
                    </telerik:RadRibbonContextualGroup.Style>
                </telerik:RadRibbonContextualGroup>
                <telerik:RadRibbonContextualGroup  x:Name="uxContextualGroupReport"
                                                           Header="Report"
                                                           Color="ForestGreen">
                    <telerik:RadRibbonContextualGroup.Style>
                        <Style TargetType="telerik:RadRibbonContextualGroup">
                            <Style.Triggers>
                                <DataTrigger Binding="{Binding WorkspaceView.CurrentItem.ContextualTabGroup}" Value="Bericht">
                                    <Setter Property="IsActive" Value="True"/>
                                </DataTrigger>
                            </Style.Triggers>
                        </Style>
                    </telerik:RadRibbonContextualGroup.Style>
                </telerik:RadRibbonContextualGroup>
                <telerik:RadRibbonContextualGroup  x:Name="uxContextualGroupMap"
                                                               Header="Karte"
                                                               Color="DarkRed">
                    <telerik:RadRibbonContextualGroup.Style>
                        <Style TargetType="telerik:RadRibbonContextualGroup">
                            <Style.Triggers>
                                <DataTrigger Binding="{Binding WorkspaceView.CurrentItem.ContextualTabGroup}" Value="Karte">
                                    <Setter Property="IsActive" Value="True"/>
                                </DataTrigger>
                            </Style.Triggers>
                        </Style>
                    </telerik:RadRibbonContextualGroup.Style>
                </telerik:RadRibbonContextualGroup>
                <telerik:RadRibbonContextualGroup  x:Name="uxContextualGroupEventRegistrationOverView"
                                                               Header="Veranstaltungsanmeldungen"
                                                               Color="LightSalmon">
                    <telerik:RadRibbonContextualGroup.Style>
                        <Style TargetType="telerik:RadRibbonContextualGroup">
                            <Style.Triggers>
                                <DataTrigger Binding="{Binding WorkspaceView.CurrentItem.ContextualTabGroup}" Value="Veranstaltungsanmeldungsübersicht">
                                    <Setter Property="IsActive" Value="True"/>
                                </DataTrigger>
                            </Style.Triggers>
                        </Style>
                    </telerik:RadRibbonContextualGroup.Style>
                </telerik:RadRibbonContextualGroup>
            </telerik:RadRibbonView.ContextualGroups>
 
            <!--Tabs-->
            <telerik:RadRibbonTab Header="Start">
                <telerik:RadRibbonGroup Header="Gehe zu">
                    <telerik:RadRibbonButton Text="Start" Command="{Binding Path=ShowWorkspaceCommand}" CommandParameter="StartViewModel" LargeImage="/SigiNX;component/Images/32/sigi.png" Size="Large" />
                    <telerik:RadRibbonButton Text="Kunden" Command="{Binding Path=ShowWorkspaceCommand}" CommandParameter="CustomerOverViewModel" LargeImage="/SigiNX;component/Images/32/customer.png" Size="Large" />
                    <telerik:RadRibbonButton Text="Mitarbeiter" Command="{Binding Path=ShowWorkspaceCommand}" CommandParameter="EmployeeOverViewModel" LargeImage="/SigiNX;component/Images/32/employee.png" Size="Large"/>
                    <telerik:RadRibbonButton Text="Veranstaltungs termine" Command="{Binding Path=ShowWorkspaceCommand}" CommandParameter="EventDateOverViewModel" LargeImage="/SigiNX;component/Images/32/event_date.png" Size="Large"/>
                    <telerik:RadRibbonButton Text="Veranstaltungs anmeldungen" Command="{Binding Path=ShowWorkspaceCommand}" CommandParameter="EventRegistrationOverViewModel" LargeImage="/SigiNX;component/Images/32/event_registration.png" Size="Large"/>
                    <telerik:RadRibbonButton Text="Karte" Command="{Binding Path=ShowWorkspaceCommand}" CommandParameter="MapViewModel" LargeImage="/SigiNX;component/Images/32/map.png" Size="Large"/>
               </telerik:RadRibbonGroup>
            </telerik:RadRibbonTab>
 
            <telerik:RadRibbonTab Header="Anzeige" ContextualGroupName="uxContextualGroupCustomerOverview">
                <telerik:RadRibbonGroup Header="Bearbeiten">
                        <telerik:RadRibbonSplitButton Text="Neu" Size="Large" LargeImage="/SigiNX;component/Images/32/customer_new.png"
                                                  Command="{Binding WorkspaceView.CurrentItem.CreateCommand}" CommandParameter="CustomerDetailViewModel"  DropDownButtonPosition="Bottom" DropDownIndicatorVisibility="Visible">
                        <telerik:RadRibbonSplitButton.DropDownContent>
                           <telerik:RadContextMenu BorderThickness="0">
                                <telerik:RadMenuItem Header="neuer Mitarbeiter" Command="{Binding WorkspaceView.CurrentItem.CreateCommand}" CommandParameter="EmployeeDetailViewModel">
                                    <telerik:RadMenuItem.Icon>
                                        <Image Source="/SigiNX;component/Images/16/employee_new.png" />
                                    </telerik:RadMenuItem.Icon>
                                </telerik:RadMenuItem>
                                <telerik:RadMenuItem Header="neuer Vertrag" Command="{Binding WorkspaceView.CurrentItem.CreateCommand}" CommandParameter="">
                                    <telerik:RadMenuItem.Icon>
                                        <Image Source="/SigiNX;component/Images/16/contract_new.png" />
                                    </telerik:RadMenuItem.Icon>
                                </telerik:RadMenuItem>
                                <telerik:RadMenuItem Header="neue Zustimmungserklärung" Command="{Binding WorkspaceView.CurrentItem.CreateCommand}" CommandParameter="">
                                    <telerik:RadMenuItem.Icon>
                                        <Image Source="/SigiNX;component/Images/16/sign_new.png" />
                                    </telerik:RadMenuItem.Icon>
                                </telerik:RadMenuItem>
                            </telerik:RadContextMenu>
                        </telerik:RadRibbonSplitButton.DropDownContent>
                    </telerik:RadRibbonSplitButton>
                    <StackPanel>
                        <telerik:RadRibbonButton Text="Bearbeiten" Command="{Binding WorkspaceView.CurrentItem.EditCommand}" Size="Medium" SmallImage="/SigiNX;component/Images/16/edit.png"/>
                    </StackPanel>
                </telerik:RadRibbonGroup>
                <telerik:RadRibbonGroup Header="Anzeige">
                    <telerik:RadRibbonSplitButton Text="gruppiern" DropDownButtonPosition="Bottom" Size="Large" LargeImage="/SigiNX;component/Images/32/group_by.png">
                        <telerik:RadSplitButton.DropDownContent>
                            <telerik:RadContextMenu BorderThickness="0">
                                <telerik:RadMenuItem Header="nach Typ" Command="{Binding WorkspaceView.CurrentItem.GroupCommand}" CommandParameter="Typ">
                                    <telerik:RadMenuItem.Icon>
                                        <Image Source="/SigiNX;component/Images/16/employee.png" />
                                    </telerik:RadMenuItem.Icon>
                                </telerik:RadMenuItem>
                                <telerik:RadMenuItem Header="nach Bezirk" Command="{Binding WorkspaceView.CurrentItem.GroupCommand}" CommandParameter="Bezirk">
                                    <telerik:RadMenuItem.Icon>
                                        <Image Source="/SigiNX;component/Images/16/contract.png" />
                                    </telerik:RadMenuItem.Icon>
                                </telerik:RadMenuItem>
                                <telerik:RadMenuItem Header="nach Zone" Command="{Binding WorkspaceView.CurrentItem.GroupCommand}" CommandParameter="Zone">
                                    <telerik:RadMenuItem.Icon>
                                        <Image Source="/SigiNX;component/Images/16/trainer.png" />
                                    </telerik:RadMenuItem.Icon>
                                </telerik:RadMenuItem>
                            </telerik:RadContextMenu>
                        </telerik:RadSplitButton.DropDownContent>
                    </telerik:RadRibbonSplitButton>
                    <telerik:RadRibbonButton Text="Bericht" Command="{Binding WorkspaceView.CurrentItem.ShowReportCommand}" CommandParameter=".\\Reports\\Kundenbericht.mrt"  Size="Large" SmallImage="/SigiNX;component/Images/32/report.png"/>
                </telerik:RadRibbonGroup>
                <telerik:RadRibbonGroup Header="Gehe zu">
                    <telerik:RadRibbonButton Text="Mitarbeiter" Command="{Binding WorkspaceView.CurrentItem.ShowFilteredWorkspaceCommand}" CommandParameter="EmployeeOverView" Size="Large" LargeImage="/SigiNX;component/Images/32/employee.png" />
                    <StackPanel>
                        <telerik:RadRibbonButton Text="Karte" Command="{Binding WorkspaceView.CurrentItem.ShowFilteredWorkspaceCommand}" CommandParameter="MapView" Size="Medium" SmallImage="/SigiNX;component/Images/16/map.png" />
                        <telerik:RadRibbonButton Text="Verträge" Size="Medium" SmallImage="/SigiNX;component/Images/16/contract.png" />
                        <telerik:RadRibbonButton Text="Produkte" Size="Medium" SmallImage="/SigiNX;component/Images/16/product.png" />
                    </StackPanel>
                    <StackPanel>
                        <telerik:RadRibbonButton Text="Konto" Size="Medium" SmallImage="/SigiNX;component/Images/16/accounting.png" />
                        <telerik:RadRibbonButton Text="Veranstaltungen" Command="{Binding WorkspaceView.CurrentItem.ShowFilteredWorkspaceCommand}" CommandParameter="EventDateOverView" Size="Medium" SmallImage="/SigiNX;component/Images/16/event_date.png" />
                        <telerik:RadRibbonButton Text="Zustimmungen" Size="Medium" SmallImage="/SigiNX;component/Images/16/sign.png" />
                    </StackPanel>
                </telerik:RadRibbonGroup>
            </telerik:RadRibbonTab>
            <telerik:RadRibbonTab Header="Berichte" ContextualGroupName="uxContextualGroupCustomerOverview">
            </telerik:RadRibbonTab>
...

Tina Stancheva
Telerik team
 answered on 08 Sep 2011
3 answers
78 views
Hi All,

i have encountered a problem when selecting a TreeViewItem. The Focused Item seems not to be the selected Item. I bound the TreeView to a list of entities and added hierarchical datatemplates for displaying them.

  • node1
             node1a
             node2a
  • node2
            node2a
            node2b

When i now open node2 and select node2a the focus is set to node2a, but the selected item will be node1a. This happens only if i opened the node1 before. I used the Microsoft TreeView instead and expected the same result but this one seems to work correct. Has somebody had a similar problem before ?

Greetings Markus
Kiril Stanoev
Telerik team
 answered on 08 Sep 2011
5 answers
112 views
RadGridView gets empty when I use CollectionViesSource with different inherited classes. Here is the example:

I created following window:
<Window x:Class="WpfApplication6.MainWindow"
        Title="MainWindow" Height="350" Width="525">
    <Window.Resources>
        <CollectionViewSource Source="{Binding Source={x:Static Application.Current}, Path=Employees}" x:Key="employees"/>
    </Window.Resources>
    <Grid>
        <telerik:RadGridView ItemsSource="{Binding Source={StaticResource employees}}" Margin="12,12,0,120" />
        <ListBox ItemsSource="{Binding Source={StaticResource employees}}" Margin="12" Height="102" VerticalAlignment="Bottom" >
            <ListBox.ItemTemplate>
                <DataTemplate>
                    <StackPanel Orientation="Horizontal">
                        <TextBlock Text="{Binding Name}" Margin="8" />
                        <TextBlock Text="{Binding Id}" Margin="8"  />
                        <TextBlock Text="{Binding Class}" Margin="8"  />
                    </StackPanel>
                </DataTemplate>
            </ListBox.ItemTemplate>
        </ListBox>
    </Grid>
</Window>


And codebehind:
namespace WpfApplication6
{
    public partial class App : Application
    {
        public ObservableCollection<Employee> Employees { get; set; }
 
        private void Application_Startup(object sender, StartupEventArgs e)
        {          
            Employees = new ObservableCollection<Employee>();
            Employees.Add(new Employee() { Name = "Alice", Id = 1 });
            Employees.Add(new Employee() { Name = "Bob", Id = 2 });
            Employees.Add(new Employee() { Name = "Charlie", Id = 3 });
            new MainWindow().Show();
        }      
    }
 
    public class Employee
    {
        public string Name { get; set; }
        public int Id { get; set; }
        public virtual string Class { get { return "Base"; } }
    }
 
    public class ExtendedEmployee : Employee
    {
        public override string Class { get { return "Extended"; } }
    }
}


In this example everything is ok, RadGridView and ListView displays same results. In following example everything is ok too:
Employees.Add(new ExtendedEmployee() { Name = "Alice", Id = 1 });
Employees.Add(new ExtendedEmployee() { Name = "Bob", Id = 2 });
Employees.Add(new ExtendedEmployee() { Name = "Charlie", Id = 3 });


But if I'll use mixed collection RadGridView become empty and ListBox will display correct results:
Employees.Add(new Employee() { Name = "Alice", Id = 1 });
Employees.Add(new Employee() { Name = "Bob", Id = 2 });
Employees.Add(new ExtendedEmployee() { Name = "Charlie", Id = 3 });

Screenshot is attached.
What's the problem here?
Dimitrina
Telerik team
 answered on 08 Sep 2011
1 answer
95 views
I am not sure if I missed it but I am unable to find any property or setting where I can keep the Transition Control pages from reloading. For example I have the control load with three web browsers. I do a Google search in one of them, switch to another one, come back to the Google page and my search results are gone as the control has reloaded. If this is by design I'll need to come up with another solution as I was wanting to use the Transition control for pages (and I could have anything on those pages from a win32 wrapped exe to web browser to pure wpf controls) that stay active until closed.

TIA
JB
Miroslav Nedyalkov
Telerik team
 answered on 08 Sep 2011
2 answers
114 views
Is there a way with the RadMAskedCurrencyInput to not have the long __,__,__ with it?


Thanks,

S
Alex Fidanov
Telerik team
 answered on 08 Sep 2011
1 answer
153 views
Hi ... we have found some strange behviour when hosting Windows Workflows inside the RadDocking component. I have attached an example solution which demonstrates the problem. Basically it seems that the Click is being captured somewhere and is not making it to the combo to open it. The Workflow designer in the soltuion is shown working outside the Docking component, and not working inside it. To test the problem, just run the solution and then try and click the 2 combos.

Demo Solution
Miroslav Nedyalkov
Telerik team
 answered on 08 Sep 2011
Narrow your results
Selected tags
Tags
+? more
Top users last month
Rob
Top achievements
Rank 3
Iron
Iron
Iron
Atul
Top achievements
Rank 1
Iron
Iron
Iron
Alexander
Top achievements
Rank 1
Veteran
Iron
Serkan
Top achievements
Rank 1
Iron
Shawn
Top achievements
Rank 1
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Rob
Top achievements
Rank 3
Iron
Iron
Iron
Atul
Top achievements
Rank 1
Iron
Iron
Iron
Alexander
Top achievements
Rank 1
Veteran
Iron
Serkan
Top achievements
Rank 1
Iron
Shawn
Top achievements
Rank 1
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?