Telerik Forums
UI for WPF Forum
1 answer
99 views
Hi,

to anyone having the same Issue:

When you use the Windows8 theme (or Windows8Touch theme) and you place a TextBlock inside a RadTabItem, the TextBlock's Foreground is set to white, which makes the TextBlock effectively invisible.
To work around this issue you have to set the ContentTemplate of the RadTabControl like this:

<telerik:RadTabControl>
  <telerik:RadTabControl.ContentTemplate>
    <DataTemplate>
      <ContentControl Content="{Binding}" TextBlock.Foreground="Black" />
    </DataTemplate>
  </telerik:RadTabControl.ContentTemplate>
</telerik:RadTabControl>

This will set the Foreground of all TextBlocks placed inside the TabControl to Black, so that they are visible again.

Please note that this will not work if the IsContentPreserved Property of the RadtabControl is set to true.

I hope this helps someone.

Sincerely yours,
David Liebeherr
Pavel R. Pavlov
Telerik team
 answered on 30 Oct 2013
1 answer
122 views
Hi,
It seems there is an error in the demo application for GridView.
As you can see in the attached picture, the currency in the data table is dollar, while the currency of the aggregation result is krone.

I'm using Windows 7, and the Region and Language is set to Danish - Denmark.

Regards,
Gong
Dimitrina
Telerik team
 answered on 30 Oct 2013
2 answers
113 views
How can we prevent that the editdialog is showing?

This does not work:

        private void ScheduleView_OnAppointmentEditing(object sender, AppointmentEditingEventArgs e)
        {
            //....
            
           e.Cancel = true;
           e.Handled = true;
        }
Kalin
Telerik team
 answered on 30 Oct 2013
0 answers
177 views
I have a RadGridView in which the ItemsSource is bound to an ObservableCollection of "Incident" objects. The XAML also defines a RadGridView.HierarchyChildTemplate so the RadGridView will show a "+" next to each row allowing the user to expand each row to edit additional information about the Incident. Since the code I'm working on is proprietary, I've created a watered down sample of that code, which is shown below:

Here is the xaml:

   <TelerikGridView:RadGridView ItemsSource="{Binding Incidients}" x:Name="radGridViewMain">
 
            <TelerikGridView:RadGridView.ChildTableDefinitions>
                <TelerikGridView:GridViewTableDefinition>
                    <TelerikGridView:GridViewTableDefinition.Relation>
                        <TelerikWindowsData:PropertyRelation ParentPropertyName="IncidientID"/>
                    </TelerikGridView:GridViewTableDefinition.Relation>
                </TelerikGridView:GridViewTableDefinition>
            </TelerikGridView:RadGridView.ChildTableDefinitions>
 
 
            <TelerikGridView:RadGridView.HierarchyChildTemplate>
                <DataTemplate>
                    <Grid DataContextChanged="Grid_DataContextChanged">
                        <TextBox Text="{Binding CommentsText, Mode=TwoWay}" ></TextBox>                       
                    </Grid>
 
                </DataTemplate>
            </TelerikGridView:RadGridView.HierarchyChildTemplate>
 
                                                <TelerikGridView:RadGridView.Columns>
                                                    <TelerikGridView:GridViewDataColumn x:Uid="gridViewDataColumnUnitCode" Header="Unit Code" DataMemberBinding="{Binding UnitCode}" IsFilterable="False"/>
                                                    <TelerikGridView:GridViewDataColumn x:Uid="gridViewDataColumnStatus" Header="Status" DataMemberBinding="{Binding AssignmentStatusNameDisplay}" IsFilterable="False"/>
                                                    <TelerikGridView:GridViewDataColumn x:Uid="gridViewDataColumnLocation" Header="Location" DataMemberBinding="{Binding Location}"  IsFilterable="False"/>
                                                    <TelerikGridView:GridViewDataColumn x:Uid="gridViewDataColumnETA" Header="ETA" DataMemberBinding="{Binding RelativeETAFromNowDisplay}" IsFilterable="False"/>
                                                    <TelerikGridView:GridViewDataColumn x:Uid="gridViewDataColumnElapsed" Header="Elapsed" DataMemberBinding="{Binding ElapsedTimeDisplay}" IsFilterable="False"/>
                                                </TelerikGridView:RadGridView.Columns>
 
 
            <TelerikGridView:RadGridView.SortDescriptors>
                <TelerikControlsGridView:ColumnSortDescriptor  x:Uid="columnSortDescriptorPriorityNumber" Column="{Binding Columns[\IncidientID
\], ElementName=radGridViewMain}"
                                            SortDirection="Ascending" />
 
            </TelerikGridView:RadGridView.SortDescriptors>
</TelerikGridView:RadGridView>


Below is a copy of what the event handler looks like in the code-behind:

private void Grid_DataContextChanged(object sender, DependencyPropertyChangedEventArgs e)
{
  System.Diagnostics.Debugger.Break();
}


The following is the issue I'm having:

The first time the row is expanded, the DataContextChanged handler is hit, as expected (i.e. e.OldValue is null, and e.NewValue is set to an instance of Incident), which, is correct. The problem is that every time a new item is added to the Incidents (ObservableCollection<Incident>) object, to which the grid is bound, the DataContextChanged event gets fired twice for the row that is currently expanded.

Here is what the values are the first time it's hit:
e.OldValue = <Incident>
e.NewValue = NULL

The second time:
e.OldValue = NULL
e.NewValue = <Incident>


The only time the DataContextChanged handler should fire is when the user initially expands the row. Moreover, even if it did fire a second time when a new row is added to the collection, why does it nullify it, just to put it back to what it was before?

What would cause this to happen?



Ryan
Top achievements
Rank 1
 asked on 29 Oct 2013
1 answer
278 views
Hello,

Using Telerik version 2013.2.611.40, i'm trying to export a (grouped) grid which contains only 1 column, that has a nested items control in a GridViewDataColumn.CellTemplate. The result (ExcelML) file doesn't contain the values from the nested list.

The result (in GUI) is just what i want (and need) the problem is with the export.

* I need to be able to export to ExcelML and to display (in GUI) the data grouped like this:
^Name
some key some value
some key2 some value2
^Name2
some key3 some value3
some key4 some value4
* the 'Items' (and SourceAttributes) is an ObservableCollection of my custom view model

(part) of the xaml:
<UserControl...
<xmlns:telerik="clr-namespace:Telerik.Windows.Controls;assembly=Telerik.Windows.Controls.GridView"
...>
<DataTemplate x:Key="sourceAttributesDataTemplate">
<ItemsControl ItemsSource="{Binding Path=SourceAttributes}">
<ItemsControl.ItemsPanel>
<ItemsPanelTemplate>
<StackPanel Orientation="Vertical"/>
</ItemsPanelTemplate>
</ItemsControl.ItemsPanel>
<ItemsControl.ItemTemplate>
<DataTemplate>
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width=".3*"/>
<ColumnDefinition Width=".7*"/>
</Grid.ColumnDefinitions>
<Label Grid.Column="0" Content="{Binding Path=Key}"/>
<Label Grid.Column="1" Content="{Binding Path=Value}"/>
</Grid>
</DataTemplate>
</ItemsControl.ItemTemplate>
</ItemsControl>
</DataTemplate>
<telerik:RadGridView ItemsSource="{Binding Path=Items}" AutoGenerateColumns="False" GroupRenderMode="Flat" AutoExpandGroups="False" ShowColumnHeaders="False">
<telerik:RadGridView.GroupDescriptors>
<data:GroupDescriptor Member="Name" SortDirection="Ascending" />
</telerik:RadGridView.GroupDescriptors>
<telerik:RadGridView.Columns>
<telerik:GridViewDataColumn Width="*" Header="" CellTemplate="{StaticResource sourceAttributesDataTemplate}">
</telerik:GridViewDataColumn>
</telerik:RadGridView.Columns>
</telerik:RadGridView>

Is there any way to achieve this functionality? (where is the problem?)
I know that 'DataMemberBinding' is crucial - but in this case they are nested inside the ItemsControl....

Thanks in advance,
Aviv
Yoan
Telerik team
 answered on 29 Oct 2013
2 answers
233 views
I have a GridView and use MVVM pattern, I bind SelectedItem to an object in my viewmodel, and on row edit ended pass this as a parameter to my insert method, as described in Telerik documentation here:

http://www.telerik.com/help/wpf/patterns-and-practices-eventtocommand-mvvmlight.html

Namely:

<telerik:RadGridView x:Name="xRadGridView" ItemsSource="{Binding GridItems, Mode=TwoWay}">
        <i:Interaction.Triggers>
            <i:EventTrigger EventName="RowEditEnded">
               <i:InvokeCommandAction Command="{Binding TestCommand, Mode=OneWay}"
                              CommandParameter="{Binding ElementName=xRadGridView, Path=SelectedItem}"/>
            </i:EventTrigger>
        </i:Interaction.Triggers>
</telerik:RadGridView>

Here's the problem - when I first sort the grid by some field and then add a new item, the SelectedItem property on RowEditEnded event is set to an item that was the last item in the list prior to insert. 

For example, I have a field SequenceNumber and sort the grid in descending order. When I insert an item, the field is blank; I then enter a very high value that would place the item to the top of the list; however, the SelectedItem parameter has the value of the last item in the list (which would be the case if no sort was initially performed). Is this a known issue? Please help.
Dimitrina
Telerik team
 answered on 29 Oct 2013
1 answer
179 views
I tried to download the sample and is running the TabControl WPF sample.
It throws the error Cannot find resource named 'RadTabItemStyle' and if the style usage is commented out in the sample,
it shows nothing in the UI.
Any ideas on the usage?

Thanks,
Sujith
Milena
Telerik team
 answered on 29 Oct 2013
1 answer
124 views
Hi

I am looking for an example iterating an AggregateFunctionsGroup object that has n subgroups.  I want to create (in my custom format) the metadata to reproduce the GridView and also include the item data.  I do not want to use serializing.

Thanks
Rich
Dimitrina
Telerik team
 answered on 29 Oct 2013
1 answer
90 views
Is there a way to stretch the monthview so all of the days allways are visible?

When I resize the monthview in Outlook, the month and the day stretches.
How can I achieve this in the RadScheduleView?
Kalin
Telerik team
 answered on 29 Oct 2013
1 answer
99 views
The company I work for recently updated our telerik controls library to the latest release. We were using the 2012.3.1129.40 release previously.

We have been using the tileview control with a datatemplate assigned to the itemtemplate property and another datatemplate assigned to the contenttemplate. We also modified the the style of the tileview.

Before the upgrade the header of the tileviewitem was displaying properly now it is not displaying anything. The datatemplate is not being applied and the styling is not being applied. 

What changes have been done between the two release that could of caused this to work in the previous release but not work in the current release? 
 
This is the style we are applying: The templates are applied in code behind to the tileview itself.
    <Style x:Key="TileViewItemHeaderStyle" TargetType="{x:Type telerikNavigation:TileViewItemHeader}">
        <Setter Property="Background" Value="Transparent"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type telerikNavigation:TileViewItemHeader}">
                    <Grid Margin="0 0 0 -2">
                        <Border x:Name="GripBarElement" Background="Transparent">
                            <ContentPresenter x:Name="HeaderElement" HorizontalAlignment="Stretch" VerticalAlignment="Center" Content="{TemplateBinding Content}" ContentTemplate="{TemplateBinding HeaderTemplate}" />
                        </Border>
                        <telerik:RadToggleButton x:Name="MaximizeToggleButton" Command="telerikNavigation:TileViewCommands.ToggleTileState" InnerCornerRadius="0">
                            <telerik:RadToggleButton.Style>
                                <Style TargetType="{x:Type telerik:RadToggleButton}">
                                    <Setter Property="VerticalAlignment" Value="Center" />
                                    <Setter Property="HorizontalAlignment" Value="Right" />
                                    <Setter Property="Height" Value="16" />
                                    <Setter Property="Template">
                                        <Setter.Value>
                                            <ControlTemplate TargetType="{x:Type telerik:RadToggleButton}">
                                                <Grid>
                                                    <Image x:Name="RestoreIcon" Source="pack://application:,,,/PulseInc.Resource;component/Icon_16/MaximizeWindow_02.png" Width="16" Height="16" ToolTip="Maximize" telerik:LocalizationManager.ResourceKey="TileViewItemMaximizeText" HorizontalAlignment="Right" VerticalAlignment="Top" Opacity="0.6"/>
                                                    <Image x:Name="BackIcon" Source="pack://application:,,,/PulseInc.Resource;component/Icon_16/MinimizeWindow_02.png" Width="16" Height="16" ToolTip="Restore" telerik:LocalizationManager.ResourceKey="TileViewItemMinimizeText" HorizontalAlignment="Right" VerticalAlignment="Top" Opacity="0.6" Visibility="Collapsed"/>
                                                </Grid>
                                                <ControlTemplate.Triggers>
                                                    <Trigger Property="IsMouseOver" Value="True">
                                                        <Setter TargetName="RestoreIcon" Property="Opacity" Value="1" />
                                                        <Setter TargetName="BackIcon" Property="Opacity" Value="1" />
                                                    </Trigger>
                                                    <Trigger Property="IsPressed" Value="True" />
                                                    <Trigger Property="IsChecked" Value="True">
                                                        <Setter TargetName="RestoreIcon" Property="Visibility" Value="Collapsed" />
                                                        <Setter TargetName="BackIcon" Property="Visibility" Value="Visible" />                                                        
                                                    </Trigger>
                                                    <DataTrigger Binding="{Binding Path=MaximizeMode, RelativeSource={RelativeSource Mode=FindAncestor, AncestorType={x:Type telerik:RadTileView}}}" Value="Zero">
                                                        <Setter TargetName="RestoreIcon" Property="Visibility" Value="Hidden"/>
                                                        <Setter TargetName="BackIcon" Property="Visibility" Value="Hidden"/>
                                                    </DataTrigger>
                                                </ControlTemplate.Triggers>
                                            </ControlTemplate>
                                        </Setter.Value>
                                    </Setter>
                                </Style>
                            </telerik:RadToggleButton.Style>
                        </telerik:RadToggleButton>
                    </Grid>
                    <ControlTemplate.Triggers>
                        <Trigger Property="TileState" Value="Maximized">
                            <Trigger.EnterActions>
                                <BeginStoryboard>
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames Duration="0" Storyboard.TargetName="MaximizeToggleButton" Storyboard.TargetProperty="IsChecked">
                                            <DiscreteObjectKeyFrame KeyTime="0">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <System:Boolean>True</System:Boolean>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </BeginStoryboard>
                            </Trigger.EnterActions>
                            <Trigger.ExitActions>
                                <BeginStoryboard>
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames Duration="0" Storyboard.TargetName="MaximizeToggleButton" Storyboard.TargetProperty="IsChecked">
                                            <DiscreteObjectKeyFrame KeyTime="0">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <System:Boolean>False</System:Boolean>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </BeginStoryboard>
                            </Trigger.ExitActions>
                        </Trigger>
                    </ControlTemplate.Triggers>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
 
    <!--RadTileViewItem style defined as implicit style to avoid warning at runtime (output window) -->
    <Style TargetType="{x:Type telerik:RadTileViewItem}">
        <Setter Property="HorizontalContentAlignment" Value="Stretch" />
        <Setter Property="VerticalContentAlignment" Value="Stretch" />
        <Setter Property="FocusVisualStyle" Value="{x:Null}" />
        <Setter Property="BorderBrush" Value="#FFB0B1B0" />
        <Setter Property="BorderThickness" Value="1" />
        <Setter Property="Padding" Value="5" />
        <Setter Property="SnapsToDevicePixels" Value="True" />
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type telerik:RadTileViewItem}">
                    <Grid>
                        <Border x:Name="outerBorder" Margin="{TemplateBinding Padding}" BorderBrush="LightGray" BorderThickness="1" CornerRadius="0">
                            <Border.Style>
                                <Style>
                                    <Style.Triggers>
                                        <Trigger Property="Border.IsMouseOver" Value="true">
                                            <Setter Property="Border.Background" >
                                                <Setter.Value>                                                   
                                                        <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
                                                            <GradientStop Color="#FFFFFFFF" Offset="0"/>
                                                            <GradientStop Color="#FFC4D0EB" Offset="1"/>
                                                        </LinearGradientBrush>                                                   
                                                </Setter.Value>
                                            </Setter>
                                        </Trigger>
                                    </Style.Triggers>
                                </Style>
                            </Border.Style>
                            <Border x:Name="outerContainer" BorderBrush="White" BorderThickness="1"  Background="Transparent" CornerRadius="0">
                                <Grid>
                                    <Grid.RowDefinitions>
                                        <RowDefinition Height="Auto" />
                                        <RowDefinition Height="*" />
                                    </Grid.RowDefinitions>
                                    <telerikNavigation:TileViewItemHeader x:Name="HeaderPart" HeaderTemplate="{TemplateBinding HeaderTemplate}" Style="{DynamicResource TileViewItemHeaderStyle}" />
                                    <Grid Grid.Row="1" Margin="5 0 5 2">
                                        <ContentPresenter x:Name="ContentElement" Grid.Row="1" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}" Content="{TemplateBinding Content}" ContentTemplate="{TemplateBinding ContentTemplate}" />
                                    </Grid>
                                    <Rectangle x:Name="DisabledVisual" Grid.RowSpan="2" Fill="#99FFFFFF" RadiusX="4" RadiusY="4" Visibility="Collapsed" />
                                </Grid>
                            </Border>
                        </Border>
                    </Grid>
                    <ControlTemplate.Triggers>
                        <Trigger Property="IsSelected" Value="True">
                               <Setter TargetName="outerBorder" Property="BorderBrush" Value="#273B8B" />
                                <Setter TargetName="outerBorder" Property="Border.Background" >
                                    <Setter.Value>
                                        <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
                                            <GradientStop Color="#FFFFFFFF" Offset="0"/>
                                            <GradientStop Color="#FFC4D0EB" Offset="1"/>
                                        </LinearGradientBrush>
                                    </Setter.Value>
                                </Setter>                            
                        </Trigger>
                        <Trigger Property="IsMouseOver" Value="True">
                            <Setter TargetName="outerBorder" Property="BorderBrush" Value="#273B8B" />
                        </Trigger>
                    </ControlTemplate.Triggers>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

This is the style we are applying:

Pavel R. Pavlov
Telerik team
 answered on 29 Oct 2013
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
Book
FileDialogs
ToolBar
ColorPicker
TimePicker
SyntaxEditor
MultiColumnComboBox
VirtualGrid
Wizard
ExpressionEditor
NavigationView (Hamburger Menu)
DesktopAlert
WatermarkTextBox
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
VirtualKeyboard
HighlightTextBlock
Security
TouchManager
StepProgressBar
Badge
OfficeNavigationBar
ExpressionParser
CircularProgressBar
SvgImage
PipsPager
SlideView
AI Coding Assistant
+? more
Top users last month
Ambisoft
Top achievements
Rank 2
Iron
Pascal
Top achievements
Rank 2
Iron
Matthew
Top achievements
Rank 1
Sergii
Top achievements
Rank 1
Iron
Iron
Andrey
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Ambisoft
Top achievements
Rank 2
Iron
Pascal
Top achievements
Rank 2
Iron
Matthew
Top achievements
Rank 1
Sergii
Top achievements
Rank 1
Iron
Iron
Andrey
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?