I would to use the RagDocking control as container of the views of my application as described in you documentation at the page
http://docs.telerik.com/devtools/wpf/controls/raddocking/features/panes/panesource.html .
In my main windows xaml file I added the following lines:
<
telerik:RadDocking
PanesSource
=
"{Binding Views}"
>
<
telerik:RadDocking.DockingPanesFactory
>
<
telerik:DockingPanesFactory
/>
</
telerik:RadDocking.DockingPanesFactory
>
</
telerik:RadDocking
>
In my mainViewModel I added this code to add a new view using this code all works fine:
RadDocumentPane view =
new
RadDocumentPane() { Header =
"Customer"
};
_views.Add(view);
RaisePropertyChanged(() => Views);
Now, I would to define the vews of my application in separated xaml files. I added a new UserControl to my project named view1 and I changed the view1.xaml file in this way
<
telerik:RadDocumentPane
x:Class
=
"MyApp.Views.TestView"
xmlns:telerik
=
"http://schemas.telerik.com/2008/xaml/presentation"
mc:Ignorable
=
"d"
d:DesignHeight
=
"300"
d:DesignWidth
=
"300" Header="Test"
>
<
Grid
>
<
TextBlock
>Test</
TextBlock
>
</
Grid
>
</
telerik:RadDocumentPane
>
and the view1.cs file in this way
namespace
MyApp.Views
{
public
partial
class
TestView : RadDocumentPane
{
public
TestView()
{
InitializeComponent();
}
}
}
Then I changed the code to add a new in this way:
//RadDocumentPane view = new RadDocumentPane() { Header = "Customer" };
TestView view =
new
TestView();
_views.Add(view);
RaisePropertyChanged(() => Views);
With this changes, the new pane is added to the docking view but unfortunately without the header tab.
Is it possible to define de panes in separated xaml file as I done? Or have I to use the RadDocumentPane class and place my view in the Content property of the RadDocumentPane?
Thanks in advance
I have at WPF app with a main window using MVVM and EF.
In the MainView I have RadGridView with a GridViewComboBoxColumn that is bound to a property on my model,
I would like to use it with a Enum when the user want to edit the value.
XAML in MainView
<Window>
<UserControl.DataContext>
<viewModel:MainViewModel/>
</UserControl.DataContext>
<Grid>
<telerik:RadGridView ItemsSource="{Binding MyUserList}">
<telerik:RadGridView.Columns>
<telerik:GridViewDataColumn Header="ID"
DataMemberBinding="{Binding Id}"
IsReadOnly="True" />
<telerik:GridViewComboBoxColumn DataMemberBinding="{Binding UseName}"
ItemsSource="{Binding AvailableUserNameEnum}"
UniqueName="UseTheName"
</telerik:RadGridView.Columns>
</telerik:RadGridView>
</Grid>
</Window>
Code in MainViewmodel
public enumUseNameEnum
{
NA,
No,
Yes
}
public List<UseNameEnum> AvailableUseNameEnum { get; set; }
private void Fill AvailableUseNameEnums()
{
AvailableUseNameEnum = new List<UseNameEnum>
{
UseNameEnum.Yes,
UseNameEnum.No,
UseNameEnum.NA
};
}
Data from the Table
User is hold the this list, that is bound to the grid:
public ObservableCollection<Users> MyUserList { get; set; }
Table User
has 2 Columns: ID and UseName
The Grid
shows data fine, except for the UseName Column, that is blank. When clicked in the combobox , it has data ,
the 3 options, but when one is selected
the values is not showing in the cell. It is still blank.
I have a Main form with a tab control where I am trapping the tab change event in the view model.
<
i:Interaction.Triggers
>
<
i:EventTrigger
EventName
=
"SelectionChanged"
>
<
i:InvokeCommandAction
Command
=
"{Binding TabChanged}"
CommandParameter
=
"{Binding ElementName=TCMain}"
/>
</
i:EventTrigger
>
</
i:Interaction.Triggers
>
Note the element name
In my view model I successfully trap the event for processing relying on the name to identify the tab control
private
void
tabChanged(
object
o)
{
if
(o ==
null
) {
return
; }
if
(o.GetType() ==
typeof
(Telerik.Windows.Controls.RadTabControl))
{
if
((o
as
Telerik.Windows.Controls.RadTabControl).Name !=
"TCMain"
)
{
return
;
}
}
}
One of the main window tab items also has a user control which has a tab control called UCTab, it has no tabchanged event processing.
When I change tabs on the UCTab the event on TCMain fires and the name passed to the event in the view model is the TCMain tab.
Is it possible to isolate the UCTab from the event processing.
(I have solved this by changing the UCTab to a standard MS tab control but it is very unsatisfactory).
I have a sample project to demonstrate the problem if required.
I'm developing a new feature with Schedule View, where i need to add a drag & drop feature and allow merging two appointments if they are dragged over another.
Is it possible to acomplish that? I have an event - OnAppointmentSlotChanged - where I can re-schedule appointments, but how can i know if it is dragged over another appointment?
Thanks for any help that you can give,
Manuel
Hi,
I'm using a simple setup with some items (just some strings) in a RadListBox with drag and drop to another RadListBox. The drag and drops works fine, but it seems like the property ListBoxDragDropBehavior.AllowReorder does not always work. As you can see I have set it to "false", and when dragging items in normal speed it prevents the items from being reordered. But if i drag and drop a bit more aggressively I can actually reorder the items within the same RadListBox. I added a custom implementation of the ListBoxDragDropBehavior with an override of CanDrop, but that method is never called when dragging aggressively.
<
TabItem
Header
=
"DragTest"
>
<
TabItem.Resources
>
<
ResourceDictionary
>
<
Style
TargetType
=
"telerik:RadListBoxItem"
BasedOn
=
"{StaticResource {x:Type telerik:RadListBoxItem}}"
>
<
Setter
Property
=
"telerik:DragDropManager.AllowCapturedDrag"
Value
=
"True"
/>
</
Style
>
</
ResourceDictionary
>
</
TabItem.Resources
>
<
telerik:RadListBox
AllowDrop
=
"True"
ItemsSource
=
"{Binding DragItems1}"
>
<
telerik:RadListBox.DragVisualProvider
>
<
telerik:ScreenshotDragVisualProvider
/>
</
telerik:RadListBox.DragVisualProvider
>
<
telerik:RadListBox.DragDropBehavior
>
<
telerik:ListBoxDragDropBehavior
AllowReorder
=
"False"
/>
</
telerik:RadListBox.DragDropBehavior
>
</
telerik:RadListBox
>
</
TabItem
>
Hi ,
I have a requirement of Infinite paging,
Where I want both previous and next button to get navigate to last and first page respectively.
Navigating to first page on click of Next page button When user is on last page can be achieved by setting IsTotalItemCountFixed = false
But how to have previous page button navigate to the last page When User is on the First page of the Grid ?
Any assistance would be a great help :)
Hi,
I am having a problem with usage of cancel operation of DragInitializeEventArgs e in DragInitializeHandler.
After canceling particular items drag functionality it switches to parent item and marks it as chosen for dragging.
private void HandleDragInitialize(object sender, DragInitializeEventArgs e)
{
if(some condition)
{e.cancel=true;}
}
the item that belongs to mentioned condition will not get dragged but his parent instead.
Any solution?