Telerik Forums
UI for WPF Forum
1 answer
56 views
Let DoubleValue be a wrapper type around a Double, with an attached TypeConverter that knows how to convert from/to Double. And suppose that we have a GridViewDataColumn bound, via DataMemberBinding, to a property of this type. Pasting numeric strings to this column doesn't work, internally generating an InvalidCast exception.

To me this looks like a bug, the column is ignoring the attached type descriptor. It should be doing
System.TypeDescriptor.GetConverter(...).ConvertFrom(...)
Vlad
Telerik team
 answered on 13 May 2011
3 answers
218 views
Hi,
I am facing an issue while using the telerik treeview in below scenerio.
the images of the expander has to be changed and it has to be dynamically chosen between two images based on the data is binded to it.
when data is binded to the treeview, based on the boolean column, the nodes has to display different images, if this value is true it has to show one image and if it false it has to show another image.
when the node has expanded, then the image of that noted should be rotated version of the image shown earlier (before expanding).
Kiril Stanoev
Telerik team
 answered on 13 May 2011
1 answer
177 views
Hi,

What do I need to configure so that when ever user clicks a child item of the hierarchical grid SelectedItem is fired?

This is what I am observing

Parent 1
Child A
Parent 2
Child B

When selecting Child A SelectedItem is fired. Selecting Child B SelectedItem is fired as well. The problem is that Child A is still selected. How can unselect Child A.
Maya
Telerik team
 answered on 13 May 2011
1 answer
24 views
I have read in this forum that the child and parent SelectionMode are independent.  Is there a way to tie them together?  I only want ONE record shown as selected regardless of whether it is a parent or child.

if * and BOLD means "selected/highlighted", this is what I am seeing:

* Parent 1
   * Child A
   * Child B

Parent 2
   * Child C
   * Child D


What I desire is if I clicked on Child A again is for all other rows to be deselected and ONLY Child A is highlighted, no parent records selected, no other children.   I would like SelectionMode = Single across all data relations.  Is this possible?

Parent 1
   * Child A
    Child B
Parent 2
    Child C
    Child D

I would show an image but I guess you can't do attachments in the forum.

Thanks in advance!

Maya
Telerik team
 answered on 13 May 2011
1 answer
250 views
Is there a way to Cancel in the middle of editing an item in the RadDataForm?  
When I click on the Add Button, both the Commit Button and Cancel Button are enabled, so I can cancel out of creating a new record.
When I click on the Edit Button, the Commit Button is enabled, but the Cancel Button is grayed out.  

I am binding an ObservableCollection of objects to the RadDataForm ItemsSource property which gets loaded in the WindowLoaded event handler, and reloaded after adding, editing or deleting an item in the collection.   

I would like the user to be able to cancel an editing operation where the item being edited reverts to its previous state if the user clicks the Cancel Button.  Is this possible?
Vlad
Telerik team
 answered on 13 May 2011
1 answer
115 views
I have a simple gridview as follows:

<telerikgridview:RadGridView ScrollViewer.HorizontalScrollBarVisibility="Disabled" x:Name="ActivitiesGrid" IsReadOnly="True" AutoGenerateColumns="False" SelectionMode="Extended" ItemsSource="{Binding SelectedPatient.Activities}" ShowGroupPanel="False" RowIndicatorVisibility="Collapsed" ShowColumnHeaders="False" SelectionChanged="ActivitiesGrid_SelectionChanged">
  <telerikgridview:RadGridView.Columns>
      <telerikgridview:GridViewDataColumn DataMemberBinding="{Binding ActivityDate}" Header="{lex:LocText S3.ParametersUE.PatientManagement:UIStrings:PatientDetailsView_GridActivityHeaderDate}" DataFormatString="{}{0:dd/MM/yyyy}" MinWidth="100"/>
      <telerikgridview:GridViewDataColumn DataMemberBinding="{Binding Description}" Header="{lex:LocText S3.ParametersUE.PatientManagement:UIStrings:PatientDetailsView_GridActivityHeaderDescription}" />                                                
  </telerikgridview:RadGridView.Columns> </telerikgridview:RadGridView>

If the text of Description is long, a horizontal scrollbar appears. How can I make sure that no horizontal scrollbar appears, but that the text is wrapped so that it is full visible in the column?
Ludwig
Top achievements
Rank 1
 answered on 12 May 2011
1 answer
349 views
Hi! I am testind yours RadTreeView Control and i have a big problem. I want to use TriState tree and i have my global checkbox style.
Global style for checkbox is:
<RadialGradientBrush x:Key="HoverBrush">
       <RadialGradientBrush.RelativeTransform>
           <TransformGroup>
               <ScaleTransform CenterX="0.5"
                       CenterY="0.3"
                       ScaleX="1.804"
                       ScaleY="0.743" />
               <SkewTransform CenterX="0.5"
                      CenterY="0.5" />
               <RotateTransform CenterX="0.5"
                        CenterY="0.5" />
               <TranslateTransform Y="0.47999998927116394" />
           </TransformGroup>
       </RadialGradientBrush.RelativeTransform>
       <GradientStop Color="#FFFCE312"
                 Offset="0.209" />
       <GradientStop Color="#00FFFF00"
                 Offset="1" />
       <GradientStop Color="#FFFFFFFF"
                 Offset="0" />
   </RadialGradientBrush>
   <LinearGradientBrush x:Key="CheckIconBrush"
                      EndPoint="0.5,1"
                      StartPoint="0.5,0">
       <GradientStop Color="White" />
       <GradientStop Color="White"
                 Offset="1" />
   </LinearGradientBrush>
   <Style TargetType="{x:Type CheckBox}">
       <Setter Property="SnapsToDevicePixels" Value="true"/>
       <Setter Property="FocusVisualStyle" Value="{DynamicResource CheckBoxFocusVisual}"/>
       <Setter Property="Background" Value="{DynamicResource ElementBackground}"/>
       <Setter Property="BorderBrush" Value="{DynamicResource ElementBorder}"/>
       <Setter Property="Template" Value="{DynamicResource CheckBoxTemplate}" />
       <Setter Property="Foreground" Value="{DynamicResource TextBrush}"/>
       <Style.Triggers>
           <Trigger Property="IsEnabled" Value="False">
               <Setter Property="Foreground" Value="{DynamicResource DisabledForegroundBrush}"/>
           </Trigger>
       </Style.Triggers>
   </Style>
   <ControlTemplate x:Key="CheckBoxTemplate" TargetType="{x:Type CheckBox}">
       <ControlTemplate.Resources>
           <Storyboard x:Key="CheckedFalse">
               <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="CheckIcon" Storyboard.TargetProperty="(UIElement.Opacity)">
                   <SplineDoubleKeyFrame KeyTime="00:00:00.1000000" Value="0"/>
               </DoubleAnimationUsingKeyFrames>
           </Storyboard>
           <Storyboard x:Key="CheckedTrue">
               <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="CheckIcon" Storyboard.TargetProperty="(UIElement.Opacity)">
                   <SplineDoubleKeyFrame KeyTime="00:00:00.1000000" Value="1"/>
               </DoubleAnimationUsingKeyFrames>
           </Storyboard>
           <Storyboard x:Key="ThreeStateOn">
               <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="IndeterminateIcon" Storyboard.TargetProperty="(UIElement.Opacity)">
                   <SplineDoubleKeyFrame KeyTime="00:00:00.1000000" Value="1"/>
               </DoubleAnimationUsingKeyFrames>
           </Storyboard>
           <Storyboard x:Key="ThreeStateOff">
               <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="IndeterminateIcon" Storyboard.TargetProperty="(UIElement.Opacity)">
                   <SplineDoubleKeyFrame KeyTime="00:00:00.3000000" Value="0"/>
               </DoubleAnimationUsingKeyFrames>
           </Storyboard>
           <Storyboard x:Key="HoverOn">
               <DoubleAnimationUsingKeyFrames Storyboard.TargetName="BackgroundOverlay" Storyboard.TargetProperty="(UIElement.Opacity)">
                   <SplineDoubleKeyFrame KeyTime="00:00:00.2000000" Value="1"/>
               </DoubleAnimationUsingKeyFrames>
           </Storyboard>
           <Storyboard x:Key="HoverOff">
               <DoubleAnimationUsingKeyFrames Storyboard.TargetName="BackgroundOverlay" Storyboard.TargetProperty="(UIElement.Opacity)">
                   <SplineDoubleKeyFrame KeyTime="00:00:00.3000000" Value="0"/>
               </DoubleAnimationUsingKeyFrames>
           </Storyboard>
           <Storyboard x:Key="PressedOn">
               <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="Background" Storyboard.TargetProperty="(UIElement.Opacity)">
                   <SplineDoubleKeyFrame KeyTime="00:00:00.2000000" Value="0.6"/>
               </DoubleAnimationUsingKeyFrames>
           </Storyboard>
           <Storyboard x:Key="PressedOff">
               <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="Background" Storyboard.TargetProperty="(UIElement.Opacity)">
                   <SplineDoubleKeyFrame KeyTime="00:00:00.2000000" Value="1"/>
               </DoubleAnimationUsingKeyFrames>
           </Storyboard>
       </ControlTemplate.Resources>
       <BulletDecorator Background="Transparent">
           <BulletDecorator.Bullet>
               <Grid Width="16" Height="16">
                   <Rectangle Height="14" Margin="0" x:Name="Background" Width="14" Fill="{TemplateBinding Background}" Stroke="{TemplateBinding BorderBrush}" StrokeThickness="2" RadiusX="1" RadiusY="1"/>
                   <Rectangle Height="12" x:Name="BackgroundOverlay" Width="12" Opacity="0" Fill="{DynamicResource ElementBackgroundWhenMouseOver}" Stroke="{x:Null}" StrokeThickness="1" RadiusX="1" RadiusY="1"/>
                   <Path x:Name="CheckIcon" Opacity="0" Stretch="Fill" Data="M102.03442,598.79645 L105.22962,597.78918 L106.95686,599.19977 C106.95686,599.19977 113.77958,590.53656 113.77958,590.53656 C113.77958,590.53656 107.40649,603.79431 107.40649,603.79431 z" Fill="#FF000000"
                   Height="10"
                   Width="10"
                   Stroke="{StaticResource CheckIconBrush}"
                   StrokeThickness="0"/>
                   <Rectangle Margin="0,0,0,0" Height="4" VerticalAlignment="Center" HorizontalAlignment="Center" x:Name="IndeterminateIcon" Width="8" Opacity="0" Fill="{DynamicResource ElementBorder}"  RadiusX="1" RadiusY="1"/>
                   <Rectangle Height="14" x:Name="DisabledVisualElement" Width="14" Opacity="0" Fill="{StaticResource DisabledBackgroundBrush}" RadiusX="1" RadiusY="1"/>
                   <Rectangle Height="16" x:Name="ContentFocusVisualElement" Width="16" IsHitTestVisible="false" Opacity="0" Stroke="{StaticResource HoverBrush}" StrokeThickness="1" RadiusX="2" RadiusY="2"/>
               </Grid>
           </BulletDecorator.Bullet>
           <ContentPresenter HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" Margin="{TemplateBinding Padding}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}" RecognizesAccessKey="True"/>
       </BulletDecorator>
       <ControlTemplate.Triggers>
           <MultiTrigger>
               <MultiTrigger.Conditions>
                   <Condition Property="IsChecked" Value="True" />
                   <Condition Property="IsThreeState" Value="True" />
               </MultiTrigger.Conditions>
               <MultiTrigger.EnterActions>
                   <BeginStoryboard x:Name="ThreeStateOn_BeginStoryboard" Storyboard="{StaticResource CheckedFalse}" />
               </MultiTrigger.EnterActions>
               <MultiTrigger.ExitActions>
                   <BeginStoryboard x:Name="ThreeStateOff_BeginStoryboard" Storyboard="{StaticResource CheckedTrue}" />
               </MultiTrigger.ExitActions>
           </MultiTrigger>
           <MultiTrigger>
               <MultiTrigger.Conditions>
                   <Condition Property="IsChecked" Value="{x:Null}" />
                   <Condition Property="IsThreeState" Value="True" />
               </MultiTrigger.Conditions>
               <MultiTrigger.EnterActions>
                   <BeginStoryboard x:Name="ThreeStateOn1_BeginStoryboard" Storyboard="{StaticResource ThreeStateOn}" />
               </MultiTrigger.EnterActions>
               <MultiTrigger.ExitActions>
                   <BeginStoryboard x:Name="ThreeStateOff1_BeginStoryboard" Storyboard="{StaticResource ThreeStateOff}" />
               </MultiTrigger.ExitActions>
                
               <Setter Property="Visibility" TargetName="CheckIcon" Value="Hidden"/>
           </MultiTrigger>
           <Trigger Property="IsChecked" Value="True">
               <Trigger.ExitActions>
                   <BeginStoryboard Storyboard="{StaticResource CheckedFalse}" x:Name="CheckedTrue_BeginStoryboard"/>
               </Trigger.ExitActions>
               <Trigger.EnterActions>
                   <BeginStoryboard x:Name="CheckedTrue_BeginStoryboard1" Storyboard="{StaticResource CheckedTrue}"/>
               </Trigger.EnterActions>
           </Trigger>
           <Trigger Property="IsMouseOver" Value="true">
               <Trigger.EnterActions>
                   <BeginStoryboard Storyboard="{StaticResource HoverOn}"/>
               </Trigger.EnterActions>
               <Trigger.ExitActions>
                   <BeginStoryboard Storyboard="{StaticResource HoverOff}"/>
               </Trigger.ExitActions>
           </Trigger>
           <Trigger Property="IsPressed" Value="true">
               <Trigger.EnterActions>
                   <BeginStoryboard Storyboard="{StaticResource PressedOn}"/>
               </Trigger.EnterActions>
               <Trigger.ExitActions>
                   <BeginStoryboard Storyboard="{StaticResource PressedOff}"/>
               </Trigger.ExitActions>
           </Trigger>
           <Trigger Property="IsEnabled" Value="false">
               <Setter Property="Fill" TargetName="Background" Value="{DynamicResource DisabledBackgroundBrush}"/>
               <Setter Property="Stroke" TargetName="Background" Value="{DynamicResource DisabledBorderBrush}"/>
           </Trigger>
       </ControlTemplate.Triggers>
   </ControlTemplate>

The problem is that on default my checkboxes dont have IsThreeState property set to true. When i add simple RadTreeView i can see my style in checkboxes BUT indetermine state doesnt work. I can see onl;y checked or unchecked checkboxes If i hardcode property
<Setter Property="IsThreeState" Value="True">
All works fine but in this case i have problem with RadGridView because in filter i have tri state checkboxes.
Sample Rad tree:
<telerik:RadTreeView Grid.Row="1" SelectionMode="Single" IsLineEnabled="True"
                IsEditable="True" IsDragDropEnabled="True"
                ItemsOptionListType="CheckList" IsOptionElementsEnabled="True"
                IsRootLinesEnabled="True"  VerticalAlignment="Top" Margin="10" 
                x:Name="TicketClassRadTreeView" IsTriStateMode="True" ContextMenu="{StaticResource ContextMenuTicketClass}"
                             >
            <telerik:RadTreeViewItem DropPosition="Inside" Header="Root" >
                <telerik:RadTreeViewItem DropPosition="Inside" Header="Oprogramowanie" >
                    <telerik:RadTreeViewItem DropPosition="Inside" Header="Obszar funkcjonalny"/>
                    <telerik:RadTreeViewItem DropPosition="Inside" Header="Obszar funkcjonalny1">
                        <telerik:RadTreeViewItem DropPosition="Inside" Header="Abc"/>
                    </telerik:RadTreeViewItem>
                </telerik:RadTreeViewItem>
                <telerik:RadTreeViewItem DropPosition="Inside" Header="SprzÄ™t" >
                </telerik:RadTreeViewItem>
            </telerik:RadTreeViewItem>
        </telerik:RadTreeView>

Thanks for help
Petar Mladenov
Telerik team
 answered on 12 May 2011
2 answers
63 views
I just downloaded the latest production version and upgraded my project and have run into manu issues within 2 min of running my application. On the tabcontrol, the selected item is behaving differently.  If you run your databinding example for the tab control and use the "x" to close the tabs you'll notice there is no selected item afterwards.  If you run the 2010 demo it works fine.  I am using Prism and MVVM and have a solution that works with the 2010 Q3 release but now does not work now that I have upraded (similar to how I explained it worked in your demo).
Vladislav
Telerik team
 answered on 12 May 2011
1 answer
125 views
Hi,

I am using GridViewBoundColumnBase.GetValueForItem() to get the content of the cell in my RadGridView.
When I create the columns like the following:
new GridViewDataColumn()
{
        DataMemberBinding = new Binding("xy")
        {
                Converter = new XYConverter()
        }
}

everything works fine.

When I omit  the "xy" in new Binding("xy") to bind to the DataItem itself, GetValueForItem(..) returns the bound dataitem instead of the result of the used converter.

This behavior is quite unexpected. When I don't omit the "xy" I get the result of the converter as expected.

Is this a bug or am I doing something wrong?

Best Regards,
 Matthias
Vlad
Telerik team
 answered on 12 May 2011
2 answers
510 views
Hi there,

I'm busy evaluating the RadRichTextBox for our purposes and I've noticed that the InsertTable() method does not exist in the WPF version of the RadRichTextBox (vs SilverLight, which has the only documentation for this control).

I also noticed, regardless of it's existence in the API, that there is no way to specify a position for the table, regardless of where you might want to actually insert it in the document.

Could you please explain how, for example, I might programmatically insert a table into a RadDocument at a position which is in the middle of a paragraph?

The functionality I'm after is similar to how you would in a FlowDocument call InsertParagraphBreak() on a TextPointer and then insert the table in the Blocks section after the now preceeding Paragraph object.
Paul
Top achievements
Rank 1
 answered on 12 May 2011
Narrow your results
Selected tags
Tags
+? more
Top users last month
Jay
Top achievements
Rank 3
Iron
Iron
Iron
Benjamin
Top achievements
Rank 3
Bronze
Iron
Veteran
Radek
Top achievements
Rank 2
Iron
Iron
Iron
Bohdan
Top achievements
Rank 2
Iron
Iron
Richard
Top achievements
Rank 4
Bronze
Bronze
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Jay
Top achievements
Rank 3
Iron
Iron
Iron
Benjamin
Top achievements
Rank 3
Bronze
Iron
Veteran
Radek
Top achievements
Rank 2
Iron
Iron
Iron
Bohdan
Top achievements
Rank 2
Iron
Iron
Richard
Top achievements
Rank 4
Bronze
Bronze
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?