Telerik Forums
UI for WPF Forum
1 answer
207 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
40 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
278 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
145 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
409 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
97 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
166 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
567 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
4 answers
157 views
Hello,

I'm using RadGridView with ComboBoxColumns and RowDetailsTemplate like this :
<telerik:RadGridView.Columns>
                <telerik:GridViewToggleRowDetailsColumn></telerik:GridViewToggleRowDetailsColumn>
                <telerik:GridViewComboBoxColumn Name="PositionCombo" Header="Position"         
                    DataMemberBinding="{Binding Path=PositionID , Mode=TwoWay}" DisplayMemberPath="Name" SelectedValueMemberPath="ID" />
                <telerik:GridViewComboBoxColumn Name="StatesCombo" Header="State"  
                    DataMemberBinding="{Binding Path=StateID , Mode=TwoWay}" DisplayMemberPath="Name" SelectedValueMemberPath="ID" />
</telerik:RadGridView.Columns>
<telerik:RadGridView.RowDetailsTemplate>
                <DataTemplate>
                </DataTemplate>
</telerik:RadGridView.RowDetailsTemplate>

Everything works great including editing rows with ComboBoxColumns, but there is a little problem - after I expand specific row, I'm not able to edit that row with ComboBoxColumn anymore (even If I've collapsed it) - there's a red rectangle around - seems like a validation that stops me.

I'm using 2010 Q2 SP2 and LINQ datasources as listed below:

DataClassesDataContext db = new DataClassesDataContext();
this.CandidatesGrid.ItemsSource = new QueryableCollectionView(db.Candidates);
((GridViewComboBoxColumn)this.CandidatesGrid.Columns[1]).ItemsSource = db.Positions;
((GridViewComboBoxColumn)this.CandidatesGrid.Columns[2]).ItemsSource = db.States;

Thanks for any help
Martin
Top achievements
Rank 1
 answered on 12 May 2011
2 answers
119 views
I want to show data from a RadGridView to a TextBlock. I wrote C# and XAML code fine but i can`t understand why it dos`t show any data
Here is Code:
C# Code :

   private void button1_Click(object sender, RoutedEventArgs e)
        {
            DataTable myDataTable = new DataTable();
            DataColumn myDataColumn = new DataColumn();
            myDataColumn.ColumnName = "Name";
            myDataTable.Columns.Add(myDataColumn);
            myDataTable.Rows.Add("1");
            myDataTable.Rows.Add("2");
            myDataTable.Rows.Add("3");
            radGridView1.ItemsSource = myDataTable;
          
        }

And XMAL CODE:

        <telerik:RadGridView HorizontalAlignment="Left" Margin="38,12,0,0" Name="radGridView1" VerticalAlignment="Top" AutoGenerateColumns="False" >
            <telerik:RadGridView.Columns>
                <telerik:GridViewDataColumn DataMemberBinding="{Binding Name}" Header="Name"/>
            </telerik:RadGridView.Columns>
        </telerik:RadGridView>
        <Button Content="Button" Height="23" HorizontalAlignment="Left" Margin="394,12,0,0" Name="button1" VerticalAlignment="Top" Width="75" Click="button1_Click" />
        <TextBlock Text="{Binding SelectedItem.Name, ElementName=radGridView1}" Margin="12,239,233,8" />


Here i was wrong. Please Help Me. 
Md.Hasanuzzaman
Top achievements
Rank 1
 answered on 12 May 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
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
InlineAIAssistant
+? more
Top users last month
Simon
Top achievements
Rank 2
Iron
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Marco
Top achievements
Rank 4
Iron
Iron
Iron
Grant
Top achievements
Rank 3
Iron
Iron
Iron
Kao Hung
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Simon
Top achievements
Rank 2
Iron
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Marco
Top achievements
Rank 4
Iron
Iron
Iron
Grant
Top achievements
Rank 3
Iron
Iron
Iron
Kao Hung
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?