<Grid HorizontalAlignment="Stretch" VerticalAlignment="Stretch"> <Telerik:RadDocking Name="Docking" UI:PaRadDockingExtensions.IsEnabled="True" ItemContainerStyle="{DynamicResource PaNewRadDockPaneStyle}" AllowUnsafeMode="True" > <Telerik:RadDocking.DocumentHost > <Telerik:RadSplitContainer Orientation="Vertical"> <Telerik:RadPaneGroup Name="MapGroup"> <Telerik:RadPane Header="Pane1" Telerik:RadDocking.SerializationTag="C1"> <AlapModul:CikkInputView DataContext="{Binding}" /> </Telerik:RadPane> <Telerik:RadPane Header="Pane2" Telerik:RadDocking.SerializationTag="C2" > <AlapModul:CikkKiegeszitoInputView DataContext="{Binding}" /> </Telerik:RadPane> <Telerik:RadPane Header="Pane3" Telerik:RadDocking.SerializationTag="C3" > <ContentControl cal:RegionManager.RegionName="{Binding MERegionName}" DataContext="{Binding}"/> </Telerik:RadPane> </Telerik:RadPaneGroup> </Telerik:RadSplitContainer> </Telerik:RadDocking.DocumentHost> </Telerik:RadDocking>At runtime, when I begin drag the pane with the PRISM region, I got the following error:
An exception occurred while creating a region with name 'cc4ebccf-36cf-410c-b390-318f6e905d1b'. The exception was: System.InvalidOperationException: ContentControl's Content property is not empty.
This control is being associated with a region, but the control is already bound to something else.
If you did not explicitly set the control's Content property,
this exception may be caused by a change in the value of the inherited RegionManager attached property.
at Microsoft.Practices.Composite.Presentation.Regions.ContentControlRegionAdapter.Adapt(IRegion region, ContentControl regionTarget) in E:\Projects\PrismLib\Source\Main\CAB\Composite.Presentation\Regions\ContentControlRegionAdapter.cs:line 58
at Microsoft.Practices.Composite.Presentation.Regions.RegionAdapterBase`1.Initialize(T regionTarget, String regionName) in E:\Projects\PrismLib\Source\Main\CAB\Composite.Presentation\Regions\RegionAdapterBase.cs:line 65
at Microsoft.Practices.Composite.Presentation.Regions.RegionAdapterBase`1.Microsoft.Practices.Composite.Regions.IRegionAdapter.Initialize(Object regionTarget, String regionName) in E:\Projects\PrismLib\Source\Main\CAB\Composite.Presentation\Regions\RegionAdapterBase.cs:line 82
at Microsoft.Practices.Composite.Presentation.Regions.Behaviors.DelayedRegionCreationBehavior.CreateRegion(DependencyObject targetElement, String regionName) in E:\Projects\PrismLib\Source\Main\CAB\Composite.Presentation\Regions\Behaviors\DelayedRegionCreationBehavior.cs:line 137.
Hello,
I have some problems using Radcombobox.
The list with the data is Alignment to right.
if I choose an item from the list is longer than the width of Radcombobox
the text in Radcombobox has been cut to the right and no to the left.
i have attaced sample code here.
Thanks
<
Border Grid.Row="2" Style="{StaticResource BorderCombo_Details}" Width="140" HorizontalAlignment="Right" Grid.Column="3" VerticalAlignment="Top">
<telerikInput:RadComboBox IsReadOnly="True" KeyUp="OnKeyUpClear" FlowDirection="RightToLeft" HorizontalAlignment="Right" x:Name="cmbVolStatus" TabIndex="4"
SelectionChanged="cmbVolStatus_SelectionChanged"
Style="{StaticResource RadComboBox_Details}"
SelectedValue="{Binding Source={StaticResource VolunteersVS},
Path=VD_VolStatusID, Mode=TwoWay,
ValidatesOnDataErrors=True,
NotifyOnValidationError=True}"
Validation.Error="Validation_Error"
SelectedValuePath="VS_ID"
DisplayMemberPath="VS_Desc"/>
</Border>
private void OnDragInfo(object sender, DragDropEventArgs e) { if (e.Options.Status == DragStatus.DragComplete) { var listBox = e.Options.Source.FindItemsConrolParent() as ItemsControl; var itemsSource = listBox.ItemsSource as IList; var operation = e.Options.Payload as DragDropOperation; itemsSource.Remove(operation.Payload); } } private void OnDropInfo(object sender, DragDropEventArgs e) { var destination = e.Options.Destination; if (e.Options.Status == DragStatus.DropPossible && destination is ListBoxItem) { var listBox = destination.FindItemsConrolParent() as ListBox; FrameworkElement rootChild = VisualTreeHelper.GetChild(listBox, 0) as FrameworkElement; Storyboard dropStoryboard = rootChild.FindResource("DropStoryboard") as Storyboard; dropStoryboard.Begin(); //Get the DropCueElemet: var dropCueElement = (VisualTreeHelper.GetChild(listBox, 0) as FrameworkElement).FindName("DropCueElement") as FrameworkElement; var operation = e.Options.Payload as DragDropOperation; //Get the parent of the destination: var visParent = VisualTreeHelper.GetParent(destination) as UIElement; //Get the spacial relation between the destination and its parent: var destinationStackTopLeft = destination.TransformToVisual(visParent).Transform(new Point()); var yTranslateValue = operation.DropPosition == DropPosition.Before ? destinationStackTopLeft.Y : destinationStackTopLeft.Y + destination.ActualHeight; dropCueElement.RenderTransform = new TranslateTransform() { Y = yTranslateValue }; e.Handled = true; } if (e.Options.Status == DragStatus.DropPossible && destination is ListBox) { var listBox = destination as ListBox; FrameworkElement rootChild = VisualTreeHelper.GetChild(listBox, 0) as FrameworkElement; Storyboard dropStoryboard = rootChild.FindResource("DropStoryboard") as Storyboard; dropStoryboard.Begin(); //Get the DropCueElemet: var dropCueElement = (VisualTreeHelper.GetChild(listBox, 0) as FrameworkElement).FindName("DropCueElement") as FrameworkElement; var operation = e.Options.Payload as DragDropOperation; // Get the size of the items: var itemsPresenter = listBox.GetTemplateChild<FrameworkElement>("ItemsPresenterElement"); var panel = VisualTreeHelper.GetChild(itemsPresenter, 0) as Panel; if (panel != null) { var yTranslateValue = panel.ActualHeight; dropCueElement.RenderTransform = new TranslateTransform() { Y = yTranslateValue }; } } //Hide the DropCue: if (e.Options.Status == DragStatus.DropImpossible || e.Options.Status == DragStatus.DropCancel || e.Options.Status == DragStatus.DropComplete) { var listBox = destination as ListBox; if (listBox == null) { listBox = e.Options.Destination.FindItemsConrolParent() as ListBox; } FrameworkElement rootChild = VisualTreeHelper.GetChild(listBox, 0) as FrameworkElement; Storyboard dropStoryboard = rootChild.FindResource("DropStoryboard") as Storyboard; dropStoryboard.Stop(); } //Place the item: if (e.Options.Status == DragStatus.DropComplete && destination is ListBoxItem) { var listBox = e.Options.Destination.FindItemsConrolParent() as ListBox; var itemsSource = listBox.ItemsSource as IList; var destinationIndex = itemsSource.IndexOf(e.Options.Destination.DataContext); var operation = e.Options.Payload as DragDropOperation; var insertIndex = operation.DropPosition == DropPosition.Before ? destinationIndex : destinationIndex + 1; itemsSource.Insert(insertIndex, operation.Payload); listBox.Dispatcher.BeginInvoke(new Action(() => { listBox.SelectedIndex = insertIndex; })); } //Place the item: if (e.Options.Status == DragStatus.DropComplete && destination is ListBox) { var listBox = e.Options.Destination as ListBox; var itemsSource = listBox.ItemsSource as IList; var operation = e.Options.Payload as DragDropOperation; itemsSource.Add(operation.Payload); } } private void OnDropQuery(object sender, DragDropQueryEventArgs e) { var destination = e.Options.Destination; if (e.Options.Status == DragStatus.DropDestinationQuery && destination is ListBoxItem) { var listBox = destination.FindItemsConrolParent() as ListBox; //Cannot place na item relative to itself: if (e.Options.Source == e.Options.Destination) { return; } //Get the spatial relation between the destination item and the vis. root: var destinationTopLeft = destination.TransformToVisual(Window.GetWindow(destination)).Transform(new Point()); //Should the new Item be moved before or after the destination item?: bool placeBefore = (e.Options.CurrentDragPoint.Y - destinationTopLeft.Y) < destination.ActualHeight / 2; var operation = e.Options.Payload as DragDropOperation; operation.DropPosition = placeBefore ? DropPosition.Before : DropPosition.After; e.QueryResult = true; e.Handled = true; } if (e.Options.Status == DragStatus.DropDestinationQuery && destination is ListBox) { var listBox = destination as ListBox; // Cannot drop the last or only item of the list box within the same list box: var operation = e.Options.Payload as DragDropOperation; //if (listBox.ItemsSource != null && listBox.ItemsSource.Cast<object>().Last() != operation.Payload) //{ e.QueryResult = true; e.Handled = true; //} //else //{ // e.QueryResult = false; // e.Handled = true; //} } } private void OnDragQuery(object sender, DragDropQueryEventArgs e) { if (e.Options.Status == DragStatus.DragQuery) { var sourceControl = e.Options.Source; e.QueryResult = true; e.Handled = true; var dragCue = RadDragAndDropManager.GenerateVisualCue(sourceControl); dragCue.HorizontalAlignment = HorizontalAlignment.Left; dragCue.Content = sourceControl.DataContext; e.Options.DragCue = dragCue; e.Options.Payload = new DragDropOperation() { Payload = sourceControl.DataContext }; } if (e.Options.Status == DragStatus.DropSourceQuery) { e.QueryResult = true; e.Handled = true; } }