Telerik Forums
UI for WPF Forum
0 answers
148 views
When the list box lives inside a RadTileView, the OnDrop event will get fired twice with the same parameters.
<telerik:RadTileView>
    <telerik:RadTileViewItem>
 
        <Grid x:Name="LayoutRoot" Background="White">
            <Grid.Resources>
                <Style TargetType="ListViewItem">
                    <Setter Property="telerik:DragDropManager.AllowCapturedDrag" Value="True"></Setter>
                </Style>
                <DataTemplate x:Key="ApplicationTemplate">
                    <StackPanel Orientation="Horizontal">
                        <TextBlock Margin="5" Text="{Binding Name}" VerticalAlignment="Center"></TextBlock>
                    </StackPanel>
                </DataTemplate>
            </Grid.Resources>
            <Grid.ColumnDefinitions>
                <ColumnDefinition></ColumnDefinition>
                <ColumnDefinition></ColumnDefinition>
            </Grid.ColumnDefinitions>
            <ListView x:Name="ApplicationList" ItemTemplate="{StaticResource ApplicationTemplate}" AllowDrop="True"/>
            <ListView x:Name="MyAppList" Background="Gray" Grid.Column="1" 
            ItemTemplate="{StaticResource ApplicationTemplate}" AllowDrop="True"/>
        </Grid>
    </telerik:RadTileViewItem>
</telerik:RadTileView>


public partial class MainWindow : Window
{
    public MainWindow()
    {
        InitializeComponent();
        ObservableCollection<Item> items = new ObservableCollection<Item>();
        for (int i = 1; i <= 10; i++)
            items.Add(new Item() { Name = string.Format("item {0}", i) });
        ApplicationList.ItemsSource = items;
        MyAppList.ItemsSource = new ObservableCollection<Item>();
 
        DragDropManager.AddDragInitializeHandler(ApplicationList, OnDragInitialize);
        DragDropManager.AddDragInitializeHandler(MyAppList, OnDragInitialize);
        DragDropManager.AddGiveFeedbackHandler(ApplicationList, OnGiveFeedback);
        DragDropManager.AddGiveFeedbackHandler(MyAppList, OnGiveFeedback);
        DragDropManager.AddDragDropCompletedHandler(ApplicationList, OnDragCompleted);
        DragDropManager.AddDragDropCompletedHandler(MyAppList, OnDragCompleted);
        DragDropManager.AddDropHandler(ApplicationList, OnDrop);
        DragDropManager.AddDropHandler(MyAppList, OnDrop);
    }
 
    private void OnDragInitialize(object sender, DragInitializeEventArgs args)
    {
        args.AllowedEffects = DragDropEffects.Move;
        //args.AllowedEffects = DragDropEffects.All;
        args.Data = ((FrameworkElement)args.OriginalSource).DataContext;
        args.DragVisual = new ContentControl { Content = args.Data, ContentTemplate = LayoutRoot.Resources["ApplicationTemplate"] as DataTemplate };
    }
 
    private void OnGiveFeedback(object sender, Telerik.Windows.DragDrop.GiveFeedbackEventArgs args)
    {
        System.Diagnostics.Trace.WriteLine(string.Format("{0} - OnGiveFeedback sender={1}", DateTime.Now, sender));
        args.SetCursor(Cursors.Arrow);
        args.Handled = true;
    }
 
    private void OnDrop(object sender, Telerik.Windows.DragDrop.DragEventArgs args)
    {
        System.Diagnostics.Trace.WriteLine(string.Format("{0} - OnDrop sender={1}", DateTime.Now, sender));
        ((IList)(sender as ListBox).ItemsSource).Add(((DataObject)args.Data).GetData(typeof(Item)));
    }
 
    public void OnDragCompleted(object sender, Telerik.Windows.DragDrop.DragDropCompletedEventArgs args)
    {
        System.Diagnostics.Trace.WriteLine(string.Format("{0} - OnDragCompleted sender={1}", DateTime.Now, sender));
        ((IList)(sender as ListBox).ItemsSource).Remove(args.Data);
    }
}
 
public class Item
{
    public string Name { get; set; }
}

Wenrong
Top achievements
Rank 1
 asked on 05 Jun 2012
0 answers
93 views
I have implemented a basic drag-n-drop using Telerik's new DragDropManager, pretty much the same as instructed here http://www.telerik.com/help/wpf/dragdropmanager-getting-started.html except that I am using ListView instead of ListBox.

Although it works, but I need help on the following two things:
  1. How to I limit the drag-n-drop so that it can only happen between the two listviews? i.e. disallow dropping to the same listview as the drag source.
  2. How to change cursor based on the above criteria? I try to monitor OnGiveFeedback(), but the sender is always the drag source...
Wenrong
Top achievements
Rank 1
 asked on 05 Jun 2012
0 answers
113 views
Hi guys,
basically I have a class derived from GridViewGroupFooterCell, and I need to replace GridViewGroupFooterCell with the derived one in the GridView. Do you guys have any idea how I can archive this?

Thanks in advance.

-Henry
heng
Top achievements
Rank 1
 asked on 05 Jun 2012
3 answers
100 views
Is it possible to 'freeze' the groupheader row?
This way the current group would always be visible while (vertically) scrolling the data in the gridview.
Vlad
Telerik team
 answered on 05 Jun 2012
1 answer
203 views

Hi,

 

I have a requirement

 

Requirement 1# : Inside a Hirerchy Template placed 2 Grids where in

1st grid 3 columns where 1 column has Combo Box loaded with Values.

 

For ex: Football, Disco

 

If i select Football, 2 grid placed inside Hirechy Template should be visible or else visbility of that grid should be collapsed.

How can i solve this.

 

Requirement 2#: Can i pass Observable collection as converter parameter

 

<Radcombobox selecteditem={Binding collection, converter={}} -> to show as like A,B,C (Selected Items as comma separated)

 

<controls:RadGridView Name="clubsGrid" 
                      ItemsSource="{Binding Clubs}" Grid.Row="0" 
                  AutoGenerateColumns="False" IsReadOnly="True" SelectionMode="Single" DataContext="{StaticResource MyViewModel}">
            <controls:RadGridView.ChildTableDefinitions>
                <controls:GridViewTableDefinition/>
            </controls:RadGridView.ChildTableDefinitions>
            <controls:RadGridView.Columns>
                <controls:GridViewDataColumn DataMemberBinding="{Binding Name}"
                                            Header="Est."></controls:GridViewDataColumn>
                <controls:GridViewDataColumn DataMemberBinding="{Binding Established}"></controls:GridViewDataColumn>
            </controls:RadGridView.Columns>
            <controls:RadGridView.HierarchyChildTemplate>
                <DataTemplate                      
                                            <controls:RadGridView Name="playersGrid" 
                                     ItemsSource="{Binding Players}" 
                                     AutoGenerateColumns="False" EnableRowVirtualization="False" EnableColumnVirtualization="False"
                                        <controls:RadGridView.ChildTableDefinitions>
                <controls:GridViewTableDefinition/>
            </controls:RadGridView.ChildTableDefinitions>

                            <controls:RadGridView.Columns>
                                <controls:GridViewDataColumn DataMemberBinding="{Binding Name}">                                    
                                </controls:GridViewDataColumn>
                                <controls:GridViewDataColumn DataMemberBinding="{Binding SelectedItem.Name}">
                                    <controls:GridViewDataColumn.CellEditTemplate>
                                        <DataTemplate>
                                            <RadControls:RadComboBox ItemsSource="{Binding Hobbies, Mode=OneTime}" SelectedItem="{Binding SelectedItem,Mode=TwoWay}" SelectedValue="Name" DisplayMemberPath="Name" >                                                
                                            </RadControls:RadComboBox>                                            
                                        </DataTemplate>
                                    </controls:GridViewDataColumn.CellEditTemplate>
                                </controls:GridViewDataColumn>                         
                            </controls:RadGridView.Columns
                                    

<

 

 

telerik:RadGridView.HierarchyChildTemplate>

 

 

 

 

<HierarchicalDataTemplate>

 


                                    <controls:RadGridView Name="Hobbies" 
                                     ItemsSource="{Binding Hobbies}" 
                                     AutoGenerateColumns="True" EnableRowVirtualization="False" EnableColumnVirtualization="False"/>

            
                        </controls:RadGridView>

</

 

 

HierarchicalDataTemplate>

 

 

 

 

</telerik:RadGridView.HierarchyChildTemplate>

 


                                                                </DataTemplate>
            </controls:RadGridView.HierarchyChildTemplate>
        </controls:RadGridView>
Prakash
Top achievements
Rank 1
 answered on 05 Jun 2012
1 answer
114 views
I,

in my project I use Telerik V2010.3.1314.35 and with my RadGridView, when I click on the filter icon in a column header, sometime the filter dialog appear behind the grid ?!?

Thank's
Vlad
Telerik team
 answered on 05 Jun 2012
2 answers
199 views
I have created a custom popup user control. This control covers the entire application with a gray semi-transparent overlay with a message in the middle. 

I add the control like this which makes it the last control in the grid and putting it on top of all other objects.
Grid mainGrid = (Grid)App.Current.MainWindow.Content;
mainGrid.Children.Insert(mainGrid.Children.Count, this);

I have a docking control in this grid and as long as everything is docked the overlay works great. However, as soon as I pull one of the RadPanes into a separate ToolWindow that tool window is always on top of my overlay user control. Is there anyway to do an overlay that would be on top of the ToolWindow as well?

Dev
Top achievements
Rank 1
 answered on 04 Jun 2012
1 answer
568 views
I have a project where I programmatically create and add RadPanes to a RadDocking control. When the user closes the RadPane it doesn't get garbage collected.

I'm using Redgate's ANTS Memory Profiler to confirm this, and I can see RadDocking control maintains an array of EffectiveValueEntrys which stop the GC collecting the RadPane.

I've seen this thread : http://www.telerik.com/community/forums/wpf/docking/why-not-dispose-of-radpanes-memory-leak-issue.aspx  and have implemented the solution (RemoveFromParent and e.Handled = true), but this still doesn't solve the problem (it does solve another issue we were having so I still need that code in there).

The RadPane is created

var pane = new RadPane();
 
var paneGroup = new RadPaneGroup();
paneGroup.Items.Add(pane);
 
var splitContainer = new RadSplitContainer();
splitContainer.Items.Add(paneGroup);
 
this.dockingControl.Items.Add(splitContainer);
pane.MakeFloatingDockable();

I've attached a screenshot of the ANTS profiler Retention Graph for the RadPane. I'm unable to attach a zip file containing a sample project which shows the problem (although you'll need to be running a memory profiler to see the bug), as I can only upload (gif, jpg, jpeg or png) but I have it ready to upload if there is an alternative upload facility.

Could you please advise me on how to fix this problem. Is this a known bug, or am I simply creating/destroying the pane incorrectly?

Kind regards,

Rich Keenan
Adam Marshall
Top achievements
Rank 1
 answered on 04 Jun 2012
1 answer
188 views
Hi,

I programmed a custom annotation insertion and, I have an issue when custom annotation's prefix are exported. Here is the fragment of code to make the custom annotation:
Public Class NovoBookMarkRangeStart
    Inherits FieldRangeStartBase
  
    Private m_Name As String
    Private m_TypeCase As Integer
    Private m_BookFormat As String
  
    <XamlSerializable()> _
    Public Property BookFormat As String
        Get
            Return m_BookFormat
        End Get
        Set(value As String)
            m_BookFormat = value
        End Set
    End Property
  
    <XamlSerializable()> _
    Public Property Name() As String
        Get
            Return m_Name
        End Get
        Set(value As String)
            m_Name = value
        End Set
    End Property
  
    <XamlSerializable()> _
    Public Property TypeCase() As Integer
        Get
            Return m_TypeCase
        End Get
        Set(value As Integer)
            m_TypeCase = value
        End Set
    End Property
  
      
  
    Public Sub New()
    End Sub
  
    Public Sub New(name As String, TypeCase As Integer, Bookformat As String)
        Me.TypeCase = TypeCase
        Me.Name = name
        Me.BookFormat = Bookformat
    End Sub

Here is the code to put the annotation in the document :
Private Sub Wpf_NewBookMark(ID As Integer,  TypeCase As Integer, BookFormat As String) Handles Wpf.NewBookMark
         
       Dim StartRange As New NovoBookMarkRangeStart(ID.ToString, TypeCase, BookFormat)
       Dim EndRange As New NovoBookMarkRangeEnd()
       'Caret Position
       Dim S As New DocumentPosition(Me.editor.Document.CaretPosition)
       Dim E As New DocumentPosition(Me.editor.Document)
       EndRange.PairWithStart(StartRange)
       'Custom Span
       Dim BookMarkSpan As New Span("{" & Id.ToString() & "}")
       S.AnchorToCurrentBoxIndex()
       editor.InsertInline(StartRange)
       editor.InsertInline(BookMarkSpan)
       editor.InsertInline(EndRange)
       S.RestorePositionFromBoxIndex()
       editor.UpdateEditorLayout()
         
   End Sub

So, when I save the document under a .XAML format, the section with the custom annotation does not save the TypeCase value but put the prefix and, the BookFormat prefix is not there at all. On the other hand, the Name prefix is with the good value. Here is a sample fragment :

<t:Section PageMargin="96,96,96,96" PageSize="816,1056">
    <t:Paragraph LineSpacing="1" StyleName="Normal">
      <custom1:NovoBookMarkRangeStart AnnotationID="1" Name="5" TypeCase="0" />
      <t:Span Text="{}{Patient.PostalCode}" />
      <custom1:NovoBookMarkRangeEnd AnnotationID="1" />
    </t:Paragraph>
  </t:Section>

So, can you find why the BookFormat prefix and value are not present and, why the the TypeCase value is the wrong one?

Thank a lot,

Patrick
Iva Toteva
Telerik team
 answered on 04 Jun 2012
1 answer
116 views

I find that when I decorate a RadRibbonTab with a ContextualGroupName, elements in the tab no longer resize. Is there a known issue with Contextual Tabs that prevents them from resizing as normal RadRibbonTabs do?
Tina Stancheva
Telerik team
 answered on 04 Jun 2012
Narrow your results
Selected tags
Tags
GridView
General Discussions
Chart
RichTextBox
Docking
ScheduleView
ChartView
TreeView
Diagram
Map
ComboBox
TreeListView
Window
RibbonView and RibbonWindow
PropertyGrid
DragAndDrop
TabControl
TileView
Carousel
DataForm
PDFViewer
MaskedInput (Numeric, DateTime, Text, Currency)
AutoCompleteBox
DatePicker
Buttons
ListBox
GanttView
PivotGrid
Spreadsheet
Gauges
NumericUpDown
PanelBar
DateTimePicker
DataFilter
Menu
ContextMenu
TimeLine
Calendar
Installer and Visual Studio Extensions
ImageEditor
BusyIndicator
Expander
Slider
TileList
DataPager
PersistenceFramework
Styling
TimeBar
OutlookBar
TransitionControl
FileDialogs
Book
ToolBar
ColorPicker
TimePicker
MultiColumnComboBox
SyntaxEditor
VirtualGrid
NavigationView (Hamburger Menu)
Wizard
ExpressionEditor
WatermarkTextBox
DesktopAlert
BarCode
SpellChecker
DataServiceDataSource
EntityFrameworkDataSource
RadialMenu
ChartView3D
Data Virtualization
BreadCrumb
LayoutControl
ProgressBar
Sparkline
TabbedWindow
ToolTip
CloudUpload
ColorEditor
TreeMap and PivotMap
EntityFrameworkCoreDataSource (.Net Core)
HeatMap
Chat (Conversational UI)
VirtualizingWrapPanel
Calculator
NotifyIcon
TaskBoard
TimeSpanPicker
BulletGraph
Licensing
WebCam
CardView
DataBar
FilePathPicker
Callout
PasswordBox
SplashScreen
Localization
Rating
Accessibility
CollectionNavigator
AutoSuggestBox
Security
VirtualKeyboard
HighlightTextBlock
TouchManager
StepProgressBar
Badge
OfficeNavigationBar
ExpressionParser
CircularProgressBar
SvgImage
PipsPager
SlideView
AI Coding Assistant
+? more
Top users last month
Marco
Top achievements
Rank 4
Iron
Iron
Iron
Hiba
Top achievements
Rank 1
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Max
Top achievements
Rank 1
Veteran
Iron
Alina
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Top users last month
Marco
Top achievements
Rank 4
Iron
Iron
Iron
Hiba
Top achievements
Rank 1
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Max
Top achievements
Rank 1
Veteran
Iron
Alina
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?