Telerik Forums
UI for WPF Forum
8 answers
154 views
Hi

I have a document with lots of pairs of "readonlyrange-followed-by-permissonrange".
The readonlyranges(->ROR) are Titles, the permissonranges (->PR)
are the place where the users enter their input related to the title.

The XAML source code looks like:

<t:Paragraph>
      <t:BookmarkRangeStart AnnotationID="1" Name="SingleResult_TITLE" />
      <t:ReadOnlyRangeStart AnnotationID="2" />
      <t:Span Text="TITLE" />
      <t:ReadOnlyRangeEnd AnnotationID="2" />
      <t:BookmarkRangeEnd AnnotationID="1" />
      <t:BookmarkRangeStart AnnotationID="3" Name="SingleResult_TEXT" />
      <t:PermissionRangeStart AnnotationID="4">
        <t:PermissionRangeInfo Name="jmiller" Type="Individual" />
      </t:PermissionRangeStart>
      <t:Span Text="¬hello}" />
      <t:PermissionRangeEnd AnnotationID="4" />
      <t:BookmarkRangeEnd AnnotationID="3" />
    </t:Paragraph>

The current user of the richtextbox is "jmiller" so the PR is editable.

Now there is a little issue with deleting all text from the span / PR via the keyboard.
When all text is gone and the cursor is at the end of the ROR -
with text "TITLE" - one cannot enter new text into the PR again, although the
PR is still there (as proved by saving it as XAML).
I think that's because the Cursor position is considered as belonging to the
ROR, so it is not editable.
And since the PR is empty, I can't position the cursor to the start of the PR
with the mouse.

Is there a way / trick how i must arrange ROR and PR so that i can remove all contents
from the PR but have it still accepting new input?
Can I position the cursor programmatically into the empty PR
when it is at the end of the ROR (by some event handler)
or can I control, whether the end-of-ROR position is regarded as
inside or outside the ROR?

Thanks in advance
Greetings, Chris
Robert
Top achievements
Rank 1
 answered on 25 May 2012
1 answer
135 views
Hi,

When tabbing in a document I noticed that the span XAML output is like so:

<t:Span Text="&#x9;&#x9;&#x9;&#x9;&#x9;&#x9;&#x9;&#x9;&#x9;" />

How do you programmatically achieve the same result?

Do I just do:

radRichTextBox.Document.Insert("&#x9;")  ?

If you can do the above, is it possible to change the value of 9 to say 20 to make the span distance larger? i.e.

radRichTextBox.Document.Insert("&#x20;")

Does the &#x9; code represent 9 blank spaces, " " (same as the space bar) ? or does it have a special size associated to it?

Thank you for your time,

Rob

Vasil
Telerik team
 answered on 25 May 2012
1 answer
102 views
Hi,
Please give me sample project for custom hierarchy template parent child grid. i saw the sample It's fit with my requirement but i am struggling to load bind the data to the parent and child record.

Regards
Rajini
Rajini
Top achievements
Rank 1
 answered on 25 May 2012
4 answers
163 views
Hi,
I want to use the built in filters for the grid, but the icon does not appear

This is my XAML code
<telerik:RadTreeListView x:Name="grid" Grid.Row="2" AutoGenerateColumns="False" RowLoaded="grid_RowLoaded" IsFilteringAllowed="True"
                                 RowIsExpandedChanged="grid_RowIsExpandedChanged" RowIsExpandedChanging="grid_RowIsExpandedChanging" SelectionChanged="grid_SelectionChanged" CellEditEnded="grid_CellEditEnded">
            <telerik:RadTreeListView.ChildTableDefinitions>
                <telerik:TreeListViewTableDefinition ItemsSource="{Binding Path=Children}" />
            </telerik:RadTreeListView.ChildTableDefinitions>
        </telerik:RadTreeListView>

And I create the Columns in code behind, I are there any properties I need to enable ?
When I have tried to set the IsFilterable = true in the code behind where I create the columns.

And I am using Telerik Dll's V.2012.1.326.40

Thank you
Kristján


Kristjan Einarsson
Top achievements
Rank 1
 answered on 25 May 2012
6 answers
272 views
Currently my task is to remove the rounding border around the cell. How to do this? I am a very long time WinForms developer that is getting used to xaml now.

I also imagine that in some later scenarios I would want to emphasize the border, maybe with different coloring, etc. So this is the similar question as above.

When I inspect the visual tree, I see that structure goes like this: PART_MasterGridContainer -> HierartchyBackground -> PART_ItemsScrollViewer -> PART_RootPanel -> ScrollContentPresenter -> PART_GridViewVirtualizingPanel -> TreeListViewRow -> Border-> SelectiveScrollingGrid -> PART_DataCellsPresenter -> Grid -> ItemsPresenter -> TreeListCellsPanel -> GridViewCell

I have searched through TreeListViewRow template that is located in Themes.Implicit project, and I found PART_DataCellsPresenter in it, but thats far as I could get. I see that there is also a GridViewCell implicit style, but that would mean I would change this for each GridViewCell (even for the GridView control). So, how do I connect these template into one style that I will use explicitly?
Goran
Top achievements
Rank 1
 answered on 25 May 2012
4 answers
194 views
Hi,

is there a way to change the time display format to 24h, or generally adjust the date time format in the time bars?

Regards,
Mathias
Mathias
Top achievements
Rank 1
 answered on 25 May 2012
1 answer
203 views
I am using the RadGridView in conjunction with the filter control for a project.  The data in the GridView is readonly.  I have the IsReadOnly property set to true. I am using one of the builtin styles (Office_Silver theme) but I am overriding some of the styles because we don't like the way rows and column headers are still being highlighted (turns yellow) when the user's mouse hovers over a row or column.  It gives the user a false sense that they are supposed to be able to do something when they can't. Anyhow, when I set the Style property with the overridden style resource the performance of the GridView degrades big time. I have a  2800 row data set that I am loading into the RadGridView control and it takes 3 to 4 minutes to load.  If I remove the Style property setting, it is almost instantaneous. The problem is obviously with my styling.  Unfortunately, much of WPF's styling still eludes me.

Here is my style:
<Style x:Key="RadGridViewReadOnlyStyle" TargetType="{x:Type telerik:RadGridView}">
            <Setter Property="Template">
                <Setter.Value>
                    <ControlTemplate TargetType="{x:Type telerik:RadGridView}">
                        <AdornerDecorator>
                            <Border x:Name="PART_MasterGridContainer" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Padding="{TemplateBinding Padding}">
                                <Grid x:Name="HierrarchyBackground" Background="{TemplateBinding Background}">
                                    <Grid.ColumnDefinitions>
                                        <ColumnDefinition/>
                                        <ColumnDefinition x:Name="ScrollBarColumn" MinWidth="0" Width="0"/>
                                    </Grid.ColumnDefinitions>
                                    <Grid.RowDefinitions>
                                        <RowDefinition Height="Auto"/>
                                        <RowDefinition x:Name="PART_AttachedBehaviorRow" Height="Auto"/>
                                        <RowDefinition/>
                                        <RowDefinition x:Name="ScrollBarRow" Height="0" MinHeight="0"/>
                                        <RowDefinition Height="Auto"/>
                                    </Grid.RowDefinitions>
                                    <telerik:GridViewGroupPanel x:Name="PART_GroupPanel" BorderBrush="#FF848484" Background="{TemplateBinding GroupPanelBackground}" Grid.ColumnSpan="2" Foreground="{TemplateBinding GroupPanelForeground}" IsTabStop="False" Grid.Row="0">
                                        <telerik:StyleManager.Theme>
                                            <telerik:Office_BlackTheme/>
                                        </telerik:StyleManager.Theme>
                                    </telerik:GridViewGroupPanel>
                                    <telerik:GridViewScrollViewer x:Name="PART_ItemsScrollViewer" Background="Transparent" CanContentScroll="True" Grid.ColumnSpan="2" Grid.Row="2" Grid.RowSpan="2">
                                        <telerik:GridViewScrollViewer.FooterRow>
                                            <telerik:GridViewFooterRow x:Name="PART_FooterRow" IsTabStop="False" IndentLevel="{TemplateBinding GroupCount}">
                                                <telerik:StyleManager.Theme>
                                                    <telerik:Office_BlackTheme/>
                                                </telerik:StyleManager.Theme>
                                            </telerik:GridViewFooterRow>
                                        </telerik:GridViewScrollViewer.FooterRow>
                                        <telerik:GridViewScrollViewer.HeaderRow>
                                            <telerik:GridViewHeaderRow x:Name="PART_HeaderRow" IsTabStop="False" IndentLevel="{TemplateBinding GroupCount}">
                                                <telerik:StyleManager.Theme>
                                                    <telerik:Office_BlackTheme/>
                                                </telerik:StyleManager.Theme>
                                            </telerik:GridViewHeaderRow>
                                        </telerik:GridViewScrollViewer.HeaderRow>
                                        <telerik:GridViewScrollViewer.NewRow>
                                            <telerik:GridViewNewRow x:Name="PART_AddNewRow" IsTabStop="False" IndentLevel="{TemplateBinding GroupCount}" Visibility="Collapsed">
                                                <telerik:StyleManager.Theme>
                                                    <telerik:Office_BlackTheme/>
                                                </telerik:StyleManager.Theme>
                                            </telerik:GridViewNewRow>
                                        </telerik:GridViewScrollViewer.NewRow>
                                        <telerik:StyleManager.Theme>
                                            <telerik:Office_BlackTheme/>
                                        </telerik:StyleManager.Theme>
                                        <Grid>
                                            <telerik:GridViewVirtualizingPanel x:Name="PART_GridViewVirtualizingPanel"/>
                                            <Label></Label>
                                        </Grid>
                                    </telerik:GridViewScrollViewer>
                                    <telerik:ScrollPositionIndicator x:Name="PART_ScrollPositionIndicator" Grid.ColumnSpan="2" ContentTemplate="{TemplateBinding ScrollPositionIndicatorTemplate}" HorizontalAlignment="Right" IsHitTestVisible="False" IsTabStop="False" Margin="0,0,28,0" Grid.Row="2">
                                        <telerik:StyleManager.Theme>
                                            <telerik:Office_BlackTheme/>
                                        </telerik:StyleManager.Theme>
                                        <telerik:ScrollPositionIndicator.Visibility>
                                            <Binding Mode="TwoWay" Path="IsScrolling" RelativeSource="{RelativeSource TemplatedParent}">
                                                <Binding.Converter>
                                                    <telerik:BooleanToVisibilityConverter/>
                                                </Binding.Converter>
                                            </Binding>
                                        </telerik:ScrollPositionIndicator.Visibility>
                                    </telerik:ScrollPositionIndicator>
                                    <Border x:Name="PART_FrozenColumnsPreview" Background="#33000000" HorizontalAlignment="Left" Grid.Row="1" Grid.RowSpan="4" Visibility="Collapsed" VerticalAlignment="Stretch" Width="6"/>
                                    <telerik:GridViewLoadingIndicator x:Name="PART_GridViewLoadingIndicator" Grid.ColumnSpan="2" IsTabStop="False" Grid.RowSpan="4" Visibility="Collapsed">
                                        <telerik:StyleManager.Theme>
                                            <telerik:Office_BlackTheme/>
                                        </telerik:StyleManager.Theme>
                                    </telerik:GridViewLoadingIndicator>
                                    <Rectangle x:Name="Background_Disabled" Grid.ColumnSpan="2" IsHitTestVisible="False" Grid.RowSpan="5" Visibility="Collapsed">
                                        <Rectangle.Fill>
                                            <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
                                                <GradientStop Color="#E5000000"/>
                                                <GradientStop Color="#E5000000" Offset="1"/>
                                                <GradientStop Color="#4C000000" Offset="0.5"/>
                                            </LinearGradientBrush>
                                        </Rectangle.Fill>
                                    </Rectangle>
                                </Grid>
                            </Border>
                        </AdornerDecorator>
                        <ControlTemplate.Triggers>
                            <Trigger Property="IsBusy" Value="True">
                                <Setter Property="Visibility" TargetName="PART_GridViewLoadingIndicator" Value="Visible"/>
                            </Trigger>
                            <Trigger Property="IsBusy" Value="False">
                                <Setter Property="Visibility" TargetName="PART_GridViewLoadingIndicator" Value="Collapsed"/>
                            </Trigger>
                            <Trigger Property="IsEnabled" Value="False">
                                <Setter Property="Visibility" TargetName="Background_Disabled" Value="Visible"/>
                            </Trigger>
                            <Trigger Property="ShowColumnFooters" Value="False">
                                <Setter Property="Visibility" TargetName="PART_FooterRow" Value="Collapsed"/>
                            </Trigger>
                            <Trigger Property="ShowColumnHeaders" Value="False">
                                <Setter Property="Visibility" TargetName="PART_HeaderRow" Value="Collapsed"/>
                            </Trigger>
                            <Trigger Property="ShowGroupPanel" Value="False">
                                <Setter Property="Visibility" TargetName="PART_GroupPanel" Value="Collapsed"/>
                            </Trigger>
                            <Trigger Property="ComputedVerticalScrollBarVisibility" SourceName="PART_ItemsScrollViewer" Value="Collapsed">
                                <Setter Property="Width" TargetName="ScrollBarColumn" Value="0"/>
                            </Trigger>
                            <Trigger Property="ComputedHorizontalScrollBarVisibility" SourceName="PART_ItemsScrollViewer" Value="Collapsed">
                                <Setter Property="Height" TargetName="ScrollBarRow" Value="0"/>
                                <Setter Property="Grid.RowSpan" TargetName="PART_ItemsScrollViewer" Value="1"/>
                            </Trigger>
                            <Trigger Property="ShowInsertRow" Value="True">
                                <Setter Property="Visibility" TargetName="PART_AddNewRow" Value="Visible"/>
                            </Trigger>
                        </ControlTemplate.Triggers>
                    </ControlTemplate>
                </Setter.Value>
            </Setter>
            <Setter Property="Background" Value="White"/>
            <Setter Property="BorderBrush" Value="#FF848484"/>
            <Setter Property="Foreground" Value="Black"/>
            <Setter Property="BorderThickness" Value="1"/>
            <Setter Property="AlternateRowBackground" Value="#FFF4F4F4"/>
            <Setter Property="VerticalGridLinesBrush" Value="#FFCBCBCB"/>
            <Setter Property="HorizontalGridLinesBrush" Value="#FFCBCBCB"/>
            <Setter Property="GroupPanelBackground">
                <Setter.Value>
                    <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
                        <GradientStop Color="#FFDFDFDF" Offset="1"/>
                        <GradientStop Color="#FFBABABA"/>
                    </LinearGradientBrush>
                </Setter.Value>
            </Setter>
            <Setter Property="GroupPanelForeground" Value="Black"/>
            <Setter Property="ScrollViewer.HorizontalScrollBarVisibility" Value="Auto"/>
            <Setter Property="ScrollViewer.VerticalScrollBarVisibility" Value="Auto"/>
            <Setter Property="VerticalAlignment" Value="Stretch"/>
            <Setter Property="HorizontalAlignment" Value="Stretch"/>
            <Setter Property="SnapsToDevicePixels" Value="True"/>
        </Style>

Here is the XAML for my RadGridView control:
<telerikGV:RadGridView Name="DocLogFilterGridView"
   CanUserFreezeColumns="False" CanUserReorderColumns="True" CanUserResizeColumns="True"
   CanUserSortColumns="False" IsFilteringAllowed="True" IsReadOnly="True"  ShowGroupPanel="False"
   CanUserDeleteRows="False" CanUserInsertRows="False" CanUserSelect="False"
   RowIndicatorVisibility="Collapsed"
   ColumnReordered="DocLogFilterGridView_ColumnReordered"
   ColumnWidthChanged="DocLogFilterGridView_ColumnWidthChanged"
   AutoGeneratingColumn="DocLogFilterGridView_AutoGeneratingColumn"
   DataLoaded="DocLogFilterGridView_DataLoaded"
   ColumnReordering="DocLogFilterGridView_ColumnReordering"
   ColumnWidthChanging="DocLogFilterGridView_ColumnWidthChanging"
   Filtered="DocLogFilterGridView_Filtered"
   SizeChanged="DocLogFilterGridView_SizeChanged"
   SelectionChanging="DocLogFilterGridView_SelectionChanging"       
   telerik:StyleManager.Theme="Office_Silver" Style="{DynamicResource RadGridViewReadOnlyStyle}"
   Loaded="DocLogFilterGridView_Loaded" EnableColumnVirtualization="True" EnableRowVirtualization="True">
</telerikGV:RadGridView>

Is there something I am doing wrong?  Is there a better way to style the RadGridView so that it is more performant?  Is there perhaps a different way to accomplish this?

Thanks for any help that can be provided.

Dustin
Vanya Pavlova
Telerik team
 answered on 25 May 2012
7 answers
104 views
Hi,

I am currently using the metro theme in a .net 3.5 application. 

When i upgrade to the latest version of the telerik controls, the themes break on some of the windows controls they are applied to.

For example, the checkbox control no longer shows when it is checked, and the password box has a border inside the textbox, I have not gone through all the other controls but some still show up just fine,  like the textbox.

I am using styles in the app.xaml to set the theme styles on windows controls.

<Style TargetType="TextBox" BasedOn="{StaticResource {telerik:ThemeResourceKey ThemeType=telerik:MetroTheme, ElementType=TextBox}}" /><br>   
<
Style TargetType="ListBox" BasedOn="{StaticResource {telerik:ThemeResourceKey ThemeType=telerik:MetroTheme, ElementType=ListBox}}" /><br>   
<
Style TargetType="CheckBox" BasedOn="{StaticResource {telerik:ThemeResourceKey ThemeType=telerik:MetroTheme, ElementType=CheckBox}}" /><br>   
<
Style TargetType="PasswordBox" BasedOn="{StaticResource {telerik:ThemeResourceKey ThemeType=telerik:MetroTheme, ElementType=PasswordBox}}" /><br>   
<
Style TargetType="ScrollViewer" BasedOn="{StaticResource {telerik:ThemeResourceKey ThemeType=telerik:MetroTheme, ElementType=ScrollViewer}}" />

Reverting to the previous version of the telerik controls fixed the issue for now.(2011.3.1220.35)

Thank you,
Vanya Pavlova
Telerik team
 answered on 25 May 2012
4 answers
609 views
I'm trying to style the contents of the filter drop down for each of the gird view columns. I'm happy with the actual contents and layout of the controls, I'm just wanting to change the colour scheme for all the check boxes, combo boxes, text boxes and buttons on the filter drop down. Can anyone point me in the right direction to achieve this?
gans
Top achievements
Rank 1
 answered on 24 May 2012
4 answers
184 views
I have the following requirement: I have modified styles taken from Implicit styles project, in order to achieve some custom appearance for TreeListView. When I run the application with this style, everything works fine. Next requirement is that I need to paint the background differently for each row based on some property value of item in collection.

<RadTreeListView RowStyleSelector="{StaticResource TaskRowStyleSelector}" />
 
<Style x:Key="PendingTreeListViewRowStyle" TargetType="telerik:TreeListViewRow">
    <Setter Property="Background" Value="#FFFFE1C4" />
</Style>
 
<local:PersonRowStyleSelector x:Key="TaskRowStyleSelector"
                    PendingStyle="{StaticResource PendingTreeListViewRowStyle}"
                           .../>

And I have a TaskSelector which inherits from using System.Windows.Controls;StyleSelector. When I run the application, background is applied correctly, however I am loosing custom style that I made for RadTreeListView and RadTreeListViewItem. Next thing I tried is to add BasedOn attribute in above style, but then it doesn't paint the background (Setter Background doesn't do anything)..

So, how can I use style selector, set a background property, while preserving the custom made style for RadTreeListView and its sub elements.
Goran
Top achievements
Rank 1
 answered on 24 May 2012
Narrow your results
Selected tags
Tags
+? more
Top users last month
Will
Top achievements
Rank 2
Iron
Motti
Top achievements
Rank 1
Iron
Hester
Top achievements
Rank 1
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Thomas
Top achievements
Rank 2
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Will
Top achievements
Rank 2
Iron
Motti
Top achievements
Rank 1
Iron
Hester
Top achievements
Rank 1
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Thomas
Top achievements
Rank 2
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?