Telerik Forums
UI for WPF Forum
2 answers
215 views

When performing a ShowDialog (and even .Show) of WPF Window within the MouseDoubleClick event of the RadTreeView, mouse events (MouseEnter, Click, etc..) no longer fire in the Dialogue Window.  It gives the appearance of hanging, but keyboard nav functions just fine.

Interestingly, by moving focus to a different window and alt-tabbing back to the dialogue, the mouse events are once again detected.
I have only noticed this in the MouseDoubleClick event. 

The workaround that I am using to avoid this problem is to set a flag in the MouseDoubleClick event and then check the flag in the MouseLeftButtonUp event.    If I fire the .Show or .ShowDialog from the MouseLeftButtonUp event, all is OK and the problem does not appear. 


Details
VS 2010 Ultimate
Telerik - WPF 2011 Q2 - SP1
Win 7 - 64

Reproduce
Create WPF Application with two windows (MainWindow and TestDLG)
Build/Run
Double Click on Item 1
Hit Cancel Button
If it doesn't appear to lock on first try, repeat.  Always get it to lock before doing this three or four times.

When it locks, just Alt-Tab out and then back to the test application and the mouse lives again.

This sample is as simple as I could make.

<Window x:Class="MainWindow"
    Title="MainWindow" Height="280" Width="400"
        xmlns:telerik="http://schemas.telerik.com/2008/xaml/presentation">
    <Grid>
        <telerik:RadTreeView Height="128"
                             HorizontalAlignment="Left"
                             Margin="160,72,0,0"
                             Name="RadTreeView1"
                             VerticalAlignment="Top"
                             BorderThickness="1"
                             BorderBrush="Black"
                             Width="125">
            <telerik:RadTreeViewItem DropPosition="Inside"
                                     Header="Item 1" />
        </telerik:RadTreeView>
    </Grid>
</Window>

MainWindow - Code Behind

Class MainWindow
 
    Private Sub RadTreeView1_MouseDoubleClick(sender As Object, e As System.Windows.Input.MouseButtonEventArgs) Handles RadTreeView1.MouseDoubleClick
        Dim tw As New TestDLG
        tw.ShowDialog()
        tw.Close()
    End Sub
 
End Class

MainWindow CodeBehind (Workaround)
This is the workaround that allows the ShowDialog to occur on doubleclick event but not lose mouse events.

Class MainWindow
 
    Private _DidDoubleClick As Boolean
    Private Sub RadTreeView1_MouseDoubleClick(sender As Object, e As System.Windows.Input.MouseButtonEventArgs) Handles RadTreeView1.MouseDoubleClick
        _DidDoubleClick = True
    End Sub
 
    Private Sub RadTreeView1_MouseLeftButtonUp(sender As Object, e As System.Windows.Input.MouseButtonEventArgs) Handles RadTreeView1.MouseLeftButtonUp
        If _DidDoubleClick Then
            _DidDoubleClick = False
            Dim tw As New TestDLG
            tw.ShowDialog()
            tw.Close()
        End If
    End Sub
End Class

Dialog Window

<Window x:Class="TestDLG"
    Title="TestDLG" Height="300" Width="300">
    <Grid>
        <Button Content="Button"
                Height="29"
                HorizontalAlignment="Left"
                Margin="82,204,0,0"
                Name="Button1"
                VerticalAlignment="Top"
                Width="97" />
    </Grid>
</Window>


Dialog Window CodeBehind

Public Class TestDLG
 
    Private Sub Button1_Click(sender As System.Object, e As System.Windows.RoutedEventArgs) Handles Button1.Click
        Me.Hide()
    End Sub
End Class
Rex Walker
Top achievements
Rank 1
 answered on 06 Oct 2011
6 answers
293 views
Today I downloaded the WPF demo application (via ClickOnce), and noticed that the sample code does not allow text highlighting or copying to clipboard.  When will this feature be added to the WPF demo application?
Steve
Top achievements
Rank 1
 answered on 06 Oct 2011
1 answer
205 views
I'm having trouble adding a binding to the visibility property of the series definition object programmatically. the binding works fine in xaml, but the object doesn't seem to have a SetBinding() function available to it, only a SetValue() - which doesn't set binding, only the value..

is there another way to do this?

i define a series mapping in XAML but allow users to change the chart type which clears the binding. below is the XAML definition:

<rad:SeriesMapping.SeriesDefinition>
                            <rad:BarSeriesDefinition ShowItemLabels="True" ShowItemToolTips="True" ItemLabelFormat="#ProposedSalesQty{#,###,###,##0}"
                                                     ItemToolTipFormat="#AttributeName, #ProposedSalesQty{#,###,###,##0}" Visibility="{Binding ProposedSalesQtySeriesVisibility}">
                                <rad:BarSeriesDefinition.Appearance>
                                    <rad:SeriesAppearanceSettings Fill="SkyBlue" />
                                </rad:BarSeriesDefinition.Appearance>
                            </rad:BarSeriesDefinition>
                        </rad:SeriesMapping.SeriesDefinition>


And in the C# code-behind i attempt to change the value this way:

((LineSeriesDefinition)MixChart.SeriesMappings[0].SeriesDefinition).SetBinding(
                        LineSeriesDefinition.VisibilityProperty, new Binding("ProposedSalesQtySeriesVisibility"));

there is no SetBinding() function so i'm not sure how i can add the binding alternatively? it can be done perfectly in XAML but not sure about code behind...

Thanks,
Nemanja
Nemanja
Top achievements
Rank 1
 answered on 06 Oct 2011
1 answer
112 views
Hello.

I have a Rad Tree View with around 2000 root nodes inside a RadTabControl. They are are bound to observable Collection items as I need to Drag and Drop to maintain order.

When I select the tab item containing this Tree View. It takes around 40 seconds to load which as you can understand not acceptable to the end user.

Is there any way to speed it up or what I am missing.

Regards

Ahmad



Petar Mladenov
Telerik team
 answered on 06 Oct 2011
1 answer
109 views
Hi,

I am facing problem while rebinding the grid.

In the XAML,

<

 

 

telerik:RadGridView x:Name="RadGridView1" ItemsSource="{Binding Path=Table, Mode=TwoWay,
UpdateSourceTrigger
=PropertyChanged}" GridLinesVisibility="Both" IsReadOnly="True"

 

 

 

CanUserFreezeColumns="False" RowIndicatorVisibility="Collapsed" CanUserReorderColumns="False"

 

 

 

ShowGroupPanel="False" HorizontalAlignment="Left" SelectionMode="Extended" SelectionUnit="Cell"
BorderThickness
="0">

 

<

 

 

telerik:RadGridView.FilterDescriptors>
<telerik:FilterDescriptor Member="ParentID" Operator="IsEqualTo" Value="0"/>
</telerik:RadGridView.FilterDescriptors>

 

 

 

 

 

 

<

 

 

telerik:RadGridView.ChildTableDefinitions>
<telerik:GridViewTableDefinition>
<telerik:GridViewTableDefinition.Relation>
<telerik:TableRelation IsSelfReference="True">
<telerik:TableRelation.FieldNames>
<telerik:FieldDescriptorNamePair ParentFieldDescriptorName="ServiceID" ChildFieldDescriptorName="ParentID"/>
</telerik:TableRelation.FieldNames>
</telerik:TableRelation>
</telerik:GridViewTableDefinition.Relation>
</telerik:GridViewTableDefinition>
</telerik:RadGridView.ChildTableDefinitions>
</telerik:RadGridView>

In the ViewModel,

 

private

 

 

DataTable _table;
public DataTable Table
{
get { return _table; }
set
{
_table =
value;
RaisePropertyChanged(() =>
this.Table);
}
}

 

 

[

 

ImportingConstructor]
public MatrixViewModel(IEventAggregator eventAggregator)
{
this.TabModel = new TabModel { Title = "Matrix" };

if (eventAggregator != null)
eventAggregator.GetEvent<
MatrixReloadEvent>().Subscribe(OnContractCreatedOrLoaded);
}

 

 

 


private
void OnContractCreatedOrLoaded(ContractCreatedOrLoadedEventArgs args)

 

{

 

DataTable dtOutput = new DataTable();
..buliding the datatable and assigning to the Table property
}

 

 

From the other screen I am calling the event "OnContractCreatedOrLoaded" while adding new items. For the first time (add 1 or n number of items) and view the grid screen. It works perfectly (Grid will have only one row - ParentID = 0).

Now add 1 new item ("OnContractCreatedOrLoaded" event will be fired) and see the grid, it binds all the rows in the datatable without filtering or hierarchy (grid is having all the rows instead of showing ParentID = 0)

Any help appreciated.

Thanks,
Ramasamy

Ramasamy
Top achievements
Rank 1
 answered on 06 Oct 2011
1 answer
144 views
Hi,

how to get the Telerik.Windows.Input namespace? I have already added Telerik.Windows.Controls.dll but i cannot include the Input namesapce.

Thanks,
Ramasamy
Ramasamy
Top achievements
Rank 1
 answered on 06 Oct 2011
3 answers
204 views
Greetings-
I seem to be having a problem with the RadRichTextBox with regard to the MaxWidth and MinWidth properties. We have created a re-usable control callled HTMLEditor.xaml that has the RadRichTextBox contained in a grid. See the code below

    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition/>
        </Grid.RowDefinitions>
        <Grid.ColumnDefinitions>
            <ColumnDefinition MinWidth="500" />
        </Grid.ColumnDefinitions>
        <Grid Grid.Row="0" Grid.Column="0" MinWidth="500" HorizontalAlignment="Stretch">
            <telerik:RadRichTextBox LayoutMode="Flow" x:Name="editor" AllowDrop="True" Drop="editor_Drop" ShowComments="False" MinHeight="50" MaxHeight="100" BorderBrush="#FFADADAD"
                                   MinWidth="500" BorderThickness="1" IsSelectionMiniToolBarEnabled="False" IsContextMenuEnabled="True" IsInHeaderFooterEditMode="False">
            </telerik:RadRichTextBox>
        </Grid>
    </Grid>

This control gets re-used in a few instances and has varying MaxWidth and MinWidth properties in 3 different cases. I seem to having a problem with each instance of the RadRichTextBox control...they do not re-size to the resolution.

<GroupBox Margin="5" Padding="5" MinWidth="614" Header="Stem and/or Stimulus" Foreground="#FF000000">
           <common:HtmlEditor Name="htmlStem" GotFocus="htmlEditor_GotFocus" MinHeight="100" Margin="0" Padding="0" />
           </GroupBox>

Can you provide some help with this?
Thanks,
Strasz
Iva Toteva
Telerik team
 answered on 05 Oct 2011
4 answers
198 views
An app I'm working on needs several mutually-exclusive User Controls; each of which has a child RadGridView.   To make the User Control's child controls scroll properly horizontally, I had to wrap all of each User Control's child controls in a ScrollViewer.   (I tried various horizontal scroll settings on each grid itself, but never found one that worked well and also consistently stretched the grid to match the parent UserControl's width dimension).

Before adding the ScrollViewer containers, I had already implemented "Find/FindNext" logic which positioned the resulting row within the appropriate RadGridView's viewport by calculating the desired new top row for the RadGridView, using the Grid's ScrollIntoViewAsync() method to get the right row visible on top, and setting the Grid's CurrentItem and Selecteditem properties to that row item.

But with the enclosing ScrollViewer, the GridView thinks more rows are visible than really are.  So the selected rows remain outside of the ScrollViewer's viewport.

 I realize this is a virtualization issue, but am not sure of the best way to address it.   (The GridView may contain thousands of rows.   I'd rather not have them all load at once as I'd expect if I tried to disable virtualization for the grid as a whole).

Since the ScrollViewer is needed only to accommodate horizontal width, there may be a way to limit the outer ScrollViewer's behavior to the horizontal dimension.

Does anyone have ideas about the best way to address this?
Thanks!
-Bob
BRiddle
Top achievements
Rank 1
 answered on 05 Oct 2011
3 answers
111 views
Hi I am trying to apply custom Bubble Series Style through BubbleSeriesDefinition, using ItemStyle property. However, when I apply default (Blend generated) bubble template, bubble data points are not visible at all. The visual tree contains the series and the Bubble with my custom style however the bubble points are not visible on the chart area. I tried to apply the template declarative (XAML) as well as in code behind - no success.
My team and I are using WPF Telerik Controls Versioin 2011.1.419.35

XAML
<UserControl
   <UserControl.Resources>
     <Style x:Key="CustomBubbleStyle" TargetType="{x:Type telerik:Bubble}">
          <Setter Property="Diameter" Value="80"/>
          <Setter Property="Template">
      <Setter.Value>
        <ControlTemplate TargetType="{x:Type telerik:Bubble}">
            <Canvas x:Name="PART_MainContainer" RenderTransformOrigin="{TemplateBinding RelativeCenterPoint}">
                              <Canvas.RenderTransform>
                   <ScaleTransform ScaleY="0" ScaleX="0"/>
                </Canvas.RenderTransform>
                <Path x:Name="PART_BubbleElement" Fill="Green" Data="{TemplateBinding ItemGeometry}" />
                 
                                <Path Data="M108.5,54.25C108.5,84.211448 84.211448,108.5 54.25,108.5 24.288552,108.5 0,84.211448 0,54.25 0,24.288552 24.288552,0 54.25,0 84.211448,0 108.5,24.288552 108.5,54.25z" Height="{TemplateBinding Diameter}" Canvas.Left="{TemplateBinding Left}" Stretch="Fill" SnapsToDevicePixels="True" Stroke="Transparent" StrokeThickness="0" Canvas.Top="{TemplateBinding Top}" Width="{TemplateBinding Diameter}">
                                             <Path.Fill>
                                                   <RadialGradientBrush GradientOrigin="0.5,0.5">
                                                         <GradientStop Color="#66FFFFFF" Offset="0.86"/>
                             <GradientStop Color="Transparent" Offset="0.85"/>
                             <GradientStop Color="#26FFFFFF"/>
                            </RadialGradientBrush>
                                </Path.Fill>
                 </Path>
            </Canvas>
        </ControlTemplate>
    </Setter.Value>
    </Setter>
</Style>
</UserControl.Resources>
 
<telerik:RadChart SnapsToDevicePixels="True" FontSize="9" Height="200" Width="400"
     ItemsSource="{Binding Source={StaticResource SampleDataSource}, Path=Collection}">
<telerik:RadChart.DefaultView>
       <telerik:ChartDefaultView>
           <telerik:ChartDefaultView.ChartArea>
                        <telerik:ChartArea NoDataString="Isufficient Information" Style="{StaticResource ChartAreaStyle}">
                   <telerik:ChartArea.AxisY>
                       <telerik:AxisY TextBlock.Foreground="LightGray"  MinorTickPointMultiplier="5" ExtendDirection="Up" MajorGridLinesVisibility="Visible"
                           MinorTicksVisibility="Hidden" DefaultLabelFormat="0">
                       </telerik:AxisY>
                   </telerik:ChartArea.AxisY>
                       <telerik:ChartArea.AxisX>
                                <telerik:AxisX MinValue="0" TextBlock.Foreground="LightGray" IsZeroBased="True" LayoutMode="Auto" TextBlock.FontSize="5" MajorGridLinesVisibility="Visible"
                           MinorTicksVisibility="Hidden">
                       </telerik:AxisX>
                   </telerik:ChartArea.AxisX>
               </telerik:ChartArea>
           </telerik:ChartDefaultView.ChartArea>
       </telerik:ChartDefaultView>
   </telerik:RadChart.DefaultView>
             <telerik:RadChart.SeriesMappings>
                <telerik:SeriesMapping>
                    <telerik:SeriesMapping.SeriesDefinition>
                        <telerik:BubbleSeriesDefinition BubbleSizeRelative="False" ItemStyle="{StaticResource CustomBubbleStyle}"/>
                    </telerik:SeriesMapping.SeriesDefinition>
                    <telerik:SeriesMapping.ItemMappings>
                        <telerik:ItemMapping DataPointMember="XValue" FieldName="XValue"/>
                        <telerik:ItemMapping DataPointMember="YValue" FieldName="YValue"/>
                        <telerik:ItemMapping DataPointMember="Label" FieldName="ID"/>
                    </telerik:SeriesMapping.ItemMappings>
                </telerik:SeriesMapping>
                 
                <!-- Regression Line -->
                <telerik:SeriesMapping ItemsSource="{Binding Source={StaticResource RegressionLine}, Path=Collection}">
                    <telerik:SeriesMapping.SeriesDefinition>
                        <telerik:LineSeriesDefinition />
                    </telerik:SeriesMapping.SeriesDefinition>
                    <telerik:ItemMapping DataPointMember="XValue" FieldName="Property1"/>
                    <telerik:ItemMapping DataPointMember="YValue" FieldName="Property2"/>
                </telerik:SeriesMapping>
                </telerik:RadChart.SeriesMappings>
                </telerik:RadChart>
 
</UserControl>
Evgenia
Telerik team
 answered on 05 Oct 2011
1 answer
107 views
For some reason I can't seem to get a hierarchical layout using my datatables. My dataset already contains the correct relation between  my two tables. Do you have an example of how to do this. I have tried both the DataLoading method and HierachicalDataTemplate method and neither one seems to work. I can get the RowLoaded event to show the expander because DataRow.GetChildRows returns records.
Thanks,
Rod
Vlad
Telerik team
 answered on 05 Oct 2011
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
PersistenceFramework
DataPager
Styling
TimeBar
OutlookBar
TransitionControl
FileDialogs
Book
ToolBar
ColorPicker
TimePicker
MultiColumnComboBox
SyntaxEditor
VirtualGrid
Wizard
ExpressionEditor
NavigationView (Hamburger Menu)
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
PasswordBox
SplashScreen
Callout
Rating
Accessibility
CollectionNavigator
Localization
AutoSuggestBox
Security
VirtualKeyboard
HighlightTextBlock
TouchManager
StepProgressBar
Badge
OfficeNavigationBar
ExpressionParser
CircularProgressBar
SvgImage
PipsPager
SlideView
AI Coding Assistant
+? more
Top users last month
Bohdan
Top achievements
Rank 3
Iron
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Elliot
Top achievements
Rank 1
Iron
Iron
Iron
Sunil
Top achievements
Rank 1
Cynthia
Top achievements
Rank 1
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Bohdan
Top achievements
Rank 3
Iron
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Elliot
Top achievements
Rank 1
Iron
Iron
Iron
Sunil
Top achievements
Rank 1
Cynthia
Top achievements
Rank 1
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?