Telerik Forums
UI for WPF Forum
1 answer
162 views

Our requirement for the grid is to have checkbox column so that user be able to select multiple items using the checkbox. During that time, the CurrentItem should be the item user clicked on, which might select/unselect the checkbox, and we will load the detail info of the CurrentItem then display it in a panel outside of the grid.

Here's the definition of the grid:

<telerik:RadGridView
                IsSynchronizedWithCurrentItem="True"
                AutoGenerateColumns="False"
                ItemsSource="{Binding ItemCollection}"
                CurrentItem="{Binding CurrentItem}"
                SelectionMode="Multiple">
        <telerik:RadGridView.Columns>
            <telerik:GridViewSelectColumn />
            <telerik:GridViewDataColumn DataMemberBinding="{Binding Path=Name}"
                                        Header="Name" />
        </telerik:RadGridView.Columns>
    </telerik:RadGridView>

The behavior now is the CurrentItem will always be the first selected item, not the item currently has focus on.

Is there any way to fulfill our requirement?

I would appreciate any suggestions.

Dongzhi
Top achievements
Rank 1
 answered on 10 Jan 2014
2 answers
352 views

I'm evaluating telerik gridview for the project I'm working on.  I noticed the CurrentItem does not change when I change selections in the grid.  The setter on CurrentItem in the ViewModel only gets triggered at the very first time.  

Here's the definition of the Grid:
<telerik:RadGridView  Name="GroceryGrid"
                     ItemsSource="{Binding GroceryList}"
                     IsSynchronizedWithCurrentItem="True"
                     AutoGenerateColumns="False"
                     SelectionMode="Multiple"
                     CurrentItem="{Binding CurrentItem, Mode=TwoWay}"
                     SelectedItem="{Binding SelectedItem, Mode=TwoWay}"
                     ShowColumnFooters="True"
                     DockPanel.Dock="Top"
                  >

In the ViewModel:

private GroceryItem currentItem;
public GroceryItem CurrentItem
{
    get { return this.currentItem; }
 
    set
    {
        this.currentItem = value;
        base.RaisePropertyChangedEvent("CurrentItem");
    }
}

Please help.  Thanks!
Dongzhi


Dongzhi
Top achievements
Rank 1
 answered on 10 Jan 2014
1 answer
255 views
Hi, I'm trying to use RadTreeView with Caliburn.Micro but I can't do basics. Could you show sample project how to bind hierachical data source to TreeView using data from view model using Caliburn.Micro

I have something like this:
        <telerik:RadTreeView x:Name="Nodes" IsDragDropEnabled="True" IsDragTooltipEnabled="False" AllowDrop="True" IsDragPreviewEnabled="False">
            <HierarchicalDataTemplate ItemsSource="{Binding Childs}" DataType="{x:Type viewmodels:TreeListViewModel+Node}">
                <TextBlock Text="{Binding Name}" />
            </HierarchicalDataTemplate>
        </telerik:RadTreeView>

But I get exception: Items collection must be empty before using ItemsSource.
Boris
Telerik team
 answered on 10 Jan 2014
3 answers
111 views
Hi,

I created a document with a footnote and saved it as rtf-file.
When I load the document I only see a superscripted hint in the text but not the footnote itself.
Do you have any suggestions?

Kind regards,
Philipp
Missing User
 answered on 10 Jan 2014
1 answer
123 views
Hi,

in my project I have multiple usercontrols using the ScheduleView control. For each usercontrol I use the Office2013 theme and all of my usercontrol refuse to display the date in columns headers,

Here is on of my user control:

<UserControl x:Class="AppointmentControls.CreateSchedule.CreateSchedule"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"             
             xmlns:AppCtrl="clr-namespace:AppointmentControls"
             xmlns:ScheduleCreation="clr-namespace:AppointmentControls.CreateSchedule"
             xmlns:telerik="http://schemas.telerik.com/2008/xaml/presentation"
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
             mc:Ignorable="d"
             d:DesignHeight="300" d:DesignWidth="300" x:Name="Me">

    <UserControl.Resources>
        <ResourceDictionary>
            <ResourceDictionary.MergedDictionaries>
                <ResourceDictionary Source="/Telerik.Windows.Themes.Office2013;component/Themes/System.Windows.xaml"/>
                <ResourceDictionary Source="/Telerik.Windows.Themes.Office2013;component/Themes/Telerik.Windows.Controls.xaml"/>
                <ResourceDictionary Source="/Telerik.Windows.Themes.Office2013;component/Themes/Telerik.Windows.Controls.Input.xaml"/>
                <ResourceDictionary Source="/Telerik.Windows.Themes.Office2013;component/Themes/Telerik.Windows.Controls.Navigation.xaml"/>
                <ResourceDictionary Source="/Telerik.Windows.Themes.Office2013;component/Themes/Telerik.Windows.Controls.ScheduleView.xaml"/>
            </ResourceDictionary.MergedDictionaries>
        </ResourceDictionary>
    </UserControl.Resources>

    <Grid x:Name="Root">
        <telerik:RadScheduleView x:Name="Control" IsInlineEditingEnabled="False" FirstDayOfWeek="Monday" ActiveViewDefinitionIndex="0" NavigationHeaderVisibility="Collapsed" MinTimeRulerExtent="200" MaxTimeRulerExtent="5000"
                                 AppointmentSelectionChanged="Control_AppointmentSelectionChanged" AppointmentDeleted="Control_AppointmentDeleted" AppointmentCreated="Control_AppointmentCreated" AppointmentEdited="Control_AppointmentEdited">
            <telerik:RadScheduleView.ViewDefinitions>
                <telerik:WeekViewDefinition x:Name="View" MajorTickLength="1h" FirstDayOfWeek="Monday" MinorTickLength="1h" TimerulerMajorTickStringFormat="{}{0:H }:{0:mm} " TimerulerMinorTickStringFormat=":{0:mm} " GroupHeaderDateStringFormat="{}{0:dddd}" />
            </telerik:RadScheduleView.ViewDefinitions>
        </telerik:RadScheduleView>
    </Grid>
</UserControl>

I have the following warning message in my VS2013:

System.Windows.ResourceDictionary Warning: 9 : Resource not found; ResourceKey='Telerik.Windows.Controls.InternalResourceKey'; ResourceKey.HashCode='16'; ResourceKey.Type='Telerik.Windows.Controls.InternalResourceKey'

Kalin
Telerik team
 answered on 10 Jan 2014
1 answer
91 views
When using the Radcalendar with DisplayMode=YearView" or

DisplayMode="DecadeView"  and  AreWeekNumbersVisible="False" not all the months are displayed



<telerik:RadCalendar HorizontalAlignment="Left" VerticalAlignment="Top" DisplayMode="YearView" AreWeekNumbersVisible="False"/>

   

Ed

Yana
Telerik team
 answered on 10 Jan 2014
2 answers
196 views
Hi,
i tried to export my RadGridView as PNG (followed this guide: http://www.telerik.com/help/wpf/common-export-support.html) works fine, but i want all the rows on the PNG-file. How do i do that? Adjust the grid.height right before the export?

I need a screenshot/image, word/excel is unfortunately not enough.
Joscha
Top achievements
Rank 2
 answered on 10 Jan 2014
1 answer
178 views
I have a RadGridView populated by a collection of objects. The first column uses a converter for the DataMemberBinding like so:

<telerik:GridViewDataColumn
    Name="NotificationTypeGridViewDataColumn"
    Header="Type"
    MinWidth="100"
    Width="100"
    IsSortable="True"
    SortingState="None"
    DataMemberBinding="{Binding Converter={StaticResource notificationTypeConverter}}"
    >
</telerik:GridViewDataColumn>

The converter returns a string based on the typeof(object) in the collection.  Since there is no property on the object I can name for the SortMemberPath to sort from, how then can I sort this GridViewDataColumn based on the string returned by the converter?  Do I have to use the "Sorting" handler and custom sort all of the columns?  Thanks.
Don
Top achievements
Rank 1
 answered on 10 Jan 2014
1 answer
133 views
Hi,

We have just updated from .Net Framework 3.5 to 4.5.
Since we did this, when the grid is validated, the first column of the lines in error is considered to be in error as well and is showing all the errors contained in the row.

Is there a way to disable this feature, it is really annoying for us.

Also, if there are errors in the row details, they are shown in the first column of the parent row and they may contain the same error more than once...


We are using version 2013.3.1204.45.

Thanks
Yoan
Telerik team
 answered on 09 Jan 2014
1 answer
206 views

Hi

For some reason i only able to work with the .NET 3.5 Version of Telerik-Controls.



I'm having a hard time trying to Change the Color of the SelectedItem in a TreeView.

I tried using your sample from another post here. But since the control template used there uses VisualStates, i cannot use it in .NET 3.5.



I have this control:

<UserControl
    x:Class="My.Controls.Views.TreeView"
    xmlns:windows="clr-namespace:Telerik.Windows;assembly=Telerik.Windows.Controls"
    mc:Ignorable="d"
    d:DesignHeight="300" d:DesignWidth="300"
    Name="TreeControlView">
    <UserControl.Resources>
        <Style TargetType="ToggleButton" x:Key="Expander">
            <Setter Property="IsTabStop" Value="False" />
            <Setter Property="Cursor" Value="Hand" />
            <Setter Property="Template">
                <Setter.Value>
                    <ControlTemplate TargetType="{x:Type ToggleButton}">
                        <ControlTemplate.Triggers>
                            <Trigger Property="IsMouseOver" Value="True">
                                <Trigger.EnterActions>
                                    <BeginStoryboard>
                                        <Storyboard>
                                            <DoubleAnimation
                                                Duration="0:0:0.05"
                                                Storyboard.TargetName="Button"
                                                Storyboard.TargetProperty="Opacity" To="0" />
                                            <DoubleAnimation
                                                Duration="0:0:0.05"
                                                Storyboard.TargetName="ButtonOver"
                                                Storyboard.TargetProperty="Opacity" To="1" />
                                        </Storyboard>
                                    </BeginStoryboard>
                                </Trigger.EnterActions>
                            </Trigger>
                            <Trigger Property="IsChecked" Value="True">
                                <Trigger.EnterActions>
                                    <BeginStoryboard>
                                        <Storyboard>
                                            <DoubleAnimation
                                                Duration="0:0:0.05"
                                                Storyboard.TargetName="CollapsedVisual"
                                                Storyboard.TargetProperty="Opacity" To="0" />
                                            <DoubleAnimation
                                                Duration="0:0:0.05"
                                                Storyboard.TargetName="CollapsedVisualOver"
                                                Storyboard.TargetProperty="Opacity" To="0" />
                                        </Storyboard>
                                    </BeginStoryboard>
                                </Trigger.EnterActions>
                                <Trigger.ExitActions>
                                    <BeginStoryboard>
                                        <Storyboard>
                                            <DoubleAnimation
                                                Duration="0:0:0.05"
                                                Storyboard.TargetName="CollapsedVisual"
                                                Storyboard.TargetProperty="Opacity" To="1" />
                                            <DoubleAnimation
                                                Duration="0:0:0.05"
                                                Storyboard.TargetName="CollapsedVisualOver"
                                                Storyboard.TargetProperty="Opacity" To="1" />
                                        </Storyboard>
                                    </BeginStoryboard>
                                </Trigger.ExitActions>
                            </Trigger>
                        </ControlTemplate.Triggers>
                        <Grid>
                            <Grid x:Name="Button" Margin="0,7,4,0" HorizontalAlignment="Right" VerticalAlignment="Top" Width="11" Height="11">
                                <Grid.Background>
                                    <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
                                        <GradientStop Color="#3F047BA5" Offset="0.996" />
                                        <GradientStop Color="#00000000" Offset="0" />
                                    </LinearGradientBrush>
                                </Grid.Background>
                                <Rectangle Stroke="#FF000000" HorizontalAlignment="Left" VerticalAlignment="Top" Width="11" Height="11" />
                                <Rectangle
                                    x:Name="CollapsedVisual" Fill="#FF000000"
                                    HorizontalAlignment="Left" VerticalAlignment="Top"
                                    Width="1" Height="5" Margin="5,3,0,0" />
                                <Rectangle
                                    Fill="#FF000000" VerticalAlignment="Top"
                                    HorizontalAlignment="Left" Height="1" Width="5"
                                    Margin="3,5,0,0" />
                            </Grid>
                            <Grid
                                x:Name="ButtonOver" Margin="0,7,4,0"
                                HorizontalAlignment="Right" VerticalAlignment="Top"
                                Width="11" Height="11">
                                <Rectangle
                                    Stroke="#FF167497" HorizontalAlignment="Left"
                                    VerticalAlignment="Top" Width="11" Height="11">
                                    <Rectangle.Fill>
                                        <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
                                            <GradientStop Color="#26167497" Offset="1" />
                                            <GradientStop Color="#00167497" Offset="0" />
                                        </LinearGradientBrush>
                                    </Rectangle.Fill>
                                </Rectangle>
                                <Rectangle
                                    x:Name="CollapsedVisualOver" Fill="#FF167497"
                                    HorizontalAlignment="Left" VerticalAlignment="Top"
                                    Width="1" Height="5" Margin="5,3,0,0" />
                                <Rectangle
                                    Fill="#FF167497" VerticalAlignment="Top"
                                    HorizontalAlignment="Left" Height="1" Width="5"
                                    Margin="3,5,0,0" />
                            </Grid>
                        </Grid>
                    </ControlTemplate>
                </Setter.Value>
            </Setter>
        </Style>
    </UserControl.Resources>
    <telerik:RadTreeView
        x:Name="BaseTreeView"
        telerik:TextSearch.TextPath="Header"
        ExpanderStyle="{StaticResource Expander}"
        IsLoadOnDemandEnabled="False"
        IsVirtualizing="True"
        telerik:TreeViewPanel.IsVirtualizing="True"
        telerik:TreeViewPanel.VirtualizationMode="Hierarchical"
        telerik:AnimationManager.IsAnimationEnabled="False" ItemDoubleClick="BaseTreeView_ItemDoubleClick"
        >
        <telerik:RadTreeView.ContextMenu>
            <ContextMenu Name="_treeViewContextMenu">
                <MenuItem Header="Expand All" Click="ContextMenuExpandAll" />
                <MenuItem Header="Collapse All" Click="ContextMenuCollapseAll" />
                <Separator x:Name="_expandCollapseSeparator" x:FieldModifier="private" Visibility="Collapsed" />
                <MenuItem x:Name="_expandMenuItem" x:FieldModifier="private" Header="Expand" Click="ContextMenuExpand" Visibility="Collapsed" />
                <MenuItem x:Name="_collapseMenuItem" x:FieldModifier="private" Header="Collapse" Click="ContextMenuCollapse" Visibility="Collapsed" />
            </ContextMenu>
        </telerik:RadTreeView.ContextMenu>
        <telerik:RadTreeView.ItemTemplate>
            <HierarchicalDataTemplate ItemsSource="{Binding Children}" >
                <StackPanel Orientation="Horizontal">
                    <TextBlock Text="{Binding Header}">
                        <TextBlock.Style>
                            <Style TargetType="TextBlock">
                                <Style.Triggers>
                                    <DataTrigger Binding="{Binding IsTemplateSet, RelativeSource={RelativeSource AncestorType={x:Type views:TreeView}}}" Value="True">
                                        <Setter Property="Visibility" Value="Collapsed" />
                                    </DataTrigger>
                                </Style.Triggers>
                            </Style>
                        </TextBlock.Style>
                        <ToolTipService.ToolTip>
                            <ToolTip>
                                <ToolTip.Content>
                                    <StackPanel Orientation="Horizontal">
                                        <TextBlock Text="{Binding ToolTip}" />
                                    </StackPanel>
                                </ToolTip.Content>
                            </ToolTip>
                        </ToolTipService.ToolTip>                       
                    </TextBlock>
                    <ContentPresenter x:Name="TreeItemContent" Content="{Binding Value}" ContentTemplate="{Binding TreeItemContentTemplate, RelativeSource={RelativeSource AncestorType={x:Type views:TreeView}}}" >
                        <ContentPresenter.Style>
                            <Style TargetType="ContentPresenter">
                                <Style.Triggers>
                                    <DataTrigger Binding="{Binding IsTemplateSet, RelativeSource={RelativeSource AncestorType={x:Type views:TreeView}}}" Value="False">
                                        <Setter Property="Visibility" Value="Collapsed" />
                                    </DataTrigger>
                                </Style.Triggers>
                            </Style>
                        </ContentPresenter.Style>
                    </ContentPresenter>
                </StackPanel>
            </HierarchicalDataTemplate>
        </telerik:RadTreeView.ItemTemplate>
        <telerik:RadTreeView.ItemContainerStyle>
            <Style TargetType="telerik:RadTreeViewItem" >
                <Setter Property="IsSelected" Value="{Binding Selected, Mode=TwoWay}" />
                <Style.Triggers>
                    <DataTrigger Binding="{Binding IsMarked }" Value="True">
                        <Setter Property="Background" Value="#F9D381" />
                    </DataTrigger>
                    <DataTrigger Binding="{Binding ContainsMarkedItems }" Value="True">
                        <Setter Property="Background" Value="#F9EBCC" />
                    </DataTrigger>
                </Style.Triggers>
            </Style>
        </telerik:RadTreeView.ItemContainerStyle>       
    </telerik:RadTreeView>
</UserControl>


I cannot seem to create a Style for RadTreeViewItem and with a different Color for SelectedItem and set it as BasedOn in the ItemContainerStyle.



Any help would really be appreciated!



Regards

Jonathan

Martin Ivanov
Telerik team
 answered on 09 Jan 2014
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
ProgressBar
Sparkline
LayoutControl
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
Rating
SplashScreen
Accessibility
Callout
CollectionNavigator
Localization
AutoSuggestBox
Security
VirtualKeyboard
HighlightTextBlock
TouchManager
StepProgressBar
Badge
OfficeNavigationBar
ExpressionParser
CircularProgressBar
SvgImage
PipsPager
SlideView
AI Coding Assistant
+? more
Top users last month
Top achievements
Rank 1
Iron
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
ivory
Top achievements
Rank 1
Iron
Nurik
Top achievements
Rank 2
Iron
Iron
YF
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Top achievements
Rank 1
Iron
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
ivory
Top achievements
Rank 1
Iron
Nurik
Top achievements
Rank 2
Iron
Iron
YF
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?