Telerik Forums
UI for WPF Forum
1 answer
251 views
Hi Team,
I want to get the selected text and change the font of it in rich text box. How can i achieve this.

Please advise
Thanks,
Petya
Telerik team
 answered on 04 Aug 2014
1 answer
90 views
i'm currently using telerik for wpf and i want to know how to sort row data which is in 'radgridview' of filtering popup to left right and center
Dimitrina
Telerik team
 answered on 04 Aug 2014
1 answer
119 views
I am using the CartesianCustomLineAnnotation to set the VerticalTo property. I would like the vertical line to extend the entire height of the chart from 0 all the way to the top. Since I am generating the chart using data from a database query I can not know the scale of the y-axis. Sometimes it is 0-100, other times it can be in the millions. The chart does a good job of adjusting the Y-axis labels to display data to scale, but since I am hard-coding the LineAnnotation, sometimes the VerticalTo is lower than the actual height of the Y-axis.

Is there a simple way to set the height of the line annotation so it always goes to the top without hard-coding a really large number? The properties off of VerticalAxis do not seem to help.

Thanks in advance.
Petar Marchev
Telerik team
 answered on 04 Aug 2014
6 answers
586 views
Hi

We would like to implement OpenDropDownOnFocus for AutoCompleteBox ( RadComboBox has this property and this behavior).
We override the default AutoCompeteBox Style .
How can we do that?
Thanks
Vladi
Telerik team
 answered on 04 Aug 2014
2 answers
151 views
Hi,

I have used the following blog to get some varying sized tiles which is great but I would like my users to be able to adjust tile sizes themselves.

http://blogs.telerik.com/xamlteam/posts/11-06-25/new-tileview-features.aspx

Is there any way that you can resize a tile by dragging on its bottom right corner?

I can do it by putting a button on the tile and in the button press adjust the RestoredWidth and RestoredHeight of the tile but this is not a great UI experience.

Thanks
Anthony
Anthony
Top achievements
Rank 1
Iron
Veteran
 answered on 04 Aug 2014
6 answers
201 views
Hi

I’m using RadGridView in my application. I have set style of Template Property of GridView with Blend.

The problem is that GroupPanel and GroupFooter are shown even after I have set:

radGridView1.ShowGroupFooters = false;

radGridView1.ShowGroupPanel= false;

 
Is there anything wrong with my
style?

The following is my style:

    <Style x:Key="CustomGridViewStyle" TargetType="{x:Type telerik:RadGridView}" BasedOn="{StaticResource ResourceKey=RadGridViewStyle}">

        <Setter Property="Template">

            <Setter.Value>

                <ControlTemplate TargetType="telerik:RadGridView">

                    <Grid>

                        <Grid.RowDefinitions>

                            <RowDefinition/>

                            <RowDefinition Height="auto"/>

                        </Grid.RowDefinitions>

                        <Grid Grid.Row="0">

                            <VisualStateManager.VisualStateGroups>

                                <VisualStateGroup x:Name="GridViewActivity">

                                    <VisualState x:Name="Idle">

                                        <Storyboard>

                                            <ObjectAnimationUsingKeyFrames Storyboard.TargetName="PART_GridViewLoadingIndicator" Storyboard.TargetProperty="Visibility">

                                               
<DiscreteObjectKeyFrame KeyTime="0">

                                                   
<DiscreteObjectKeyFrame.Value>

                                                       
<Visibility>Collapsed</Visibility>

                                                   
</DiscreteObjectKeyFrame.Value>

                                               
</DiscreteObjectKeyFrame>

                                            </ObjectAnimationUsingKeyFrames>

                                        </Storyboard>

                                    </VisualState>

                                    <VisualState x:Name="Busy">

                                        <Storyboard>

                                            <ObjectAnimationUsingKeyFrames Storyboard.TargetName="PART_GridViewLoadingIndicator" Storyboard.TargetProperty="Visibility">

                                               
<DiscreteObjectKeyFrame KeyTime="0">

                                                    <DiscreteObjectKeyFrame.Value>

                                                       
<Visibility>Visible</Visibility>

                                                   
</DiscreteObjectKeyFrame.Value>

                                                </DiscreteObjectKeyFrame>

                                            </ObjectAnimationUsingKeyFrames>

                                        </Storyboard>

                                    </VisualState>

                                </VisualStateGroup>

                                <VisualStateGroup x:Name="ColumnHeadersVisibility">

                                    <VisualState x:Name="ColumnHeadersVisible">

                                        <Storyboard>

                                            <ObjectAnimationUsingKeyFrames Storyboard.TargetName="PART_HeaderRow" Storyboard.TargetProperty="Visibility">

                                               
<DiscreteObjectKeyFrame KeyTime="0">

                                                    <DiscreteObjectKeyFrame.Value>

                                                       
<Visibility>Visible</Visibility>

                                                   
</DiscreteObjectKeyFrame.Value>

                                                </DiscreteObjectKeyFrame>

                                            </ObjectAnimationUsingKeyFrames>

                                        </Storyboard>

                                    </VisualState>

                                    <VisualState x:Name="ColumnHeadersCollapsed">

                                        <Storyboard>

                                            <ObjectAnimationUsingKeyFrames Storyboard.TargetName="PART_HeaderRow" Storyboard.TargetProperty="Visibility">

                                               
<DiscreteObjectKeyFrame KeyTime="0">

                                                   
<DiscreteObjectKeyFrame.Value>

                                               
        <Visibility>Collapsed</Visibility>

                                                   
</DiscreteObjectKeyFrame.Value>

                                               
</DiscreteObjectKeyFrame>

                                            </ObjectAnimationUsingKeyFrames>

                                        </Storyboard>

                                    </VisualState>

                                </VisualStateGroup>

                                <VisualStateGroup x:Name="ColumnFootersVisibility">

                                    <VisualState x:Name="ColumnFootersVisible">

                                        <Storyboard>

                                            <ObjectAnimationUsingKeyFrames Storyboard.TargetName="PART_FooterRow" Storyboard.TargetProperty="Visibility">

                                               
<DiscreteObjectKeyFrame KeyTime="0">

                                                   
<DiscreteObjectKeyFrame.Value>

                                               
        <Visibility>Visible</Visibility>

                                                   
</DiscreteObjectKeyFrame.Value>

                                               
</DiscreteObjectKeyFrame>

                                            </ObjectAnimationUsingKeyFrames>

                                        </Storyboard>

                                    </VisualState>

                                    <VisualState x:Name="ColumnFootersCollapsed">

                                        <Storyboard>

                                            <ObjectAnimationUsingKeyFrames Storyboard.TargetName="PART_FooterRow" Storyboard.TargetProperty="Visibility">

                                               
<DiscreteObjectKeyFrame KeyTime="0">

                                                    <DiscreteObjectKeyFrame.Value>

                                                       
<Visibility>Collapsed</Visibility>

                                                   
</DiscreteObjectKeyFrame.Value>

                                               
</DiscreteObjectKeyFrame>

                                            </ObjectAnimationUsingKeyFrames>

                                        </Storyboard>

                                    </VisualState>

                                </VisualStateGroup>

                                <VisualStateGroup x:Name="GroupPanelVisibility">

                                    <VisualState x:Name="GroupPanelVisible">

                                        <Storyboard>

                                            <ObjectAnimationUsingKeyFrames Storyboard.TargetName="PART_GroupPanel" Storyboard.TargetProperty="Visibility">

                                               
<DiscreteObjectKeyFrame KeyTime="0">

                                                    <DiscreteObjectKeyFrame.Value>

                                                       
<Visibility>Visible</Visibility>

                                                   
</DiscreteObjectKeyFrame.Value>

                                               
</DiscreteObjectKeyFrame>

                                            </ObjectAnimationUsingKeyFrames>

                                        </Storyboard>

                                    </VisualState>

                                    <VisualState x:Name="GroupPanelCollapsed">

                                        <Storyboard>

                                            <ObjectAnimationUsingKeyFrames Storyboard.TargetName="PART_GroupPanel" Storyboard.TargetProperty="Visibility">

                                               
<DiscreteObjectKeyFrame KeyTime="0">

                                                   
<DiscreteObjectKeyFrame.Value>

                                                       
<Visibility>Collapsed</Visibility>

                                                   
</DiscreteObjectKeyFrame.Value>

                                               
</DiscreteObjectKeyFrame>

                                            </ObjectAnimationUsingKeyFrames>

                                        </Storyboard>

                                    </VisualState>

                                </VisualStateGroup>

                                <VisualStateGroup x:Name="InsertRowVisibility">

                                    <VisualState x:Name="InsertRowVisible">

                                        <Storyboard>

                                            <ObjectAnimationUsingKeyFrames Storyboard.TargetName="PART_AddNewRow" Storyboard.TargetProperty="Visibility">

                                               
<DiscreteObjectKeyFrame KeyTime="0">

                                                   
<DiscreteObjectKeyFrame.Value>

                                                
       <Visibility>Visible</Visibility>

                                                   
</DiscreteObjectKeyFrame.Value>

                                               
</DiscreteObjectKeyFrame>

                                            </ObjectAnimationUsingKeyFrames>

                                        </Storyboard>

                                    </VisualState>

                                    <VisualState x:Name="InsertRowCollapsed">

                                        <Storyboard>

                                            <ObjectAnimationUsingKeyFrames Storyboard.TargetName="PART_AddNewRow" Storyboard.TargetProperty="Visibility">

                                               
<DiscreteObjectKeyFrame KeyTime="0">

                                                    <DiscreteObjectKeyFrame.Value>

                                                       
<Visibility>Collapsed</Visibility>

                                                   
</DiscreteObjectKeyFrame.Value>

                                                </DiscreteObjectKeyFrame>

                                            </ObjectAnimationUsingKeyFrames>

                                        </Storyboard>

                                    </VisualState>

                                </VisualStateGroup>

                                <VisualStateGroup x:Name="DisabledStates">

                                    <VisualState x:Name="Enabled"/>

                                    <VisualState x:Name="Disabled">

                                        <Storyboard>

                                            <ObjectAnimationUsingKeyFrames Storyboard.TargetName="Background_Disabled" Storyboard.TargetProperty="Visibility">

                                                <DiscreteObjectKeyFrame KeyTime="0">

                                                   
<DiscreteObjectKeyFrame.Value>

                                                       
<Visibility>Visible</Visibility>

                                                    </DiscreteObjectKeyFrame.Value>

                                               
</DiscreteObjectKeyFrame>

                                            </ObjectAnimationUsingKeyFrames>

                                        </Storyboard>

                                    </VisualState>

                                </VisualStateGroup>

                            </VisualStateManager.VisualStateGroups>

                            <Grid.RowDefinitions>

                                <RowDefinition Height="Auto"/>

                                <RowDefinition x:Name="PART_AttachedBehaviorRow" Height="Auto"/>

                                <RowDefinition/>

                                <RowDefinition x:Name="ScrollBarRow" MinHeight="0" Height="0"/>

                                <RowDefinition Height="Auto"/>

                            </Grid.RowDefinitions>

                            <Grid.ColumnDefinitions>

                                <ColumnDefinition/>

                                <ColumnDefinition x:Name="ScrollBarColumn"
MinWidth="0" Width="0"/>

                                <ColumnDefinition Width="Auto"/>

                            </Grid.ColumnDefinitions>

                            <telerik:GridViewGroupPanel x:Name="PART_GroupPanel"

                    Grid.ColumnSpan="3"

                    Visibility="{TemplateBinding Visibility}"

                    Background="{TemplateBinding GroupPanelBackground}"

                    Foreground="{TemplateBinding GroupPanelForeground}"

                    BorderBrush="{StaticResource GridView_GroupPanelOuterBorder}"/>

                            <ItemsControl x:Name="PART_ControlPanelItemsControl" Grid.Column="2" IsTabStop="False" HorizontalAlignment="Right">

                                <ItemsControl.ItemsPanel>

                                    <ItemsPanelTemplate>

                                        <StackPanel Orientation="Horizontal"/>

                                    </ItemsPanelTemplate>

                                </ItemsControl.ItemsPanel>

                                <ItemsControl.ItemTemplate>

                                    <DataTemplate>

                                        <telerik:ControlPanelItemControl />

                                    </DataTemplate>

                                </ItemsControl.ItemTemplate>

                            </ItemsControl>

                            <Border

                    Name="PART_MasterGridContainer"

                    Grid.Row="2"

                    Grid.RowSpan="2"

                    Grid.ColumnSpan="3"

                    Background="{TemplateBinding Background}"

                    Margin="0,-1,0,0"

                    BorderBrush="{TemplateBinding BorderBrush}"

                    BorderThickness="{TemplateBinding BorderThickness}"

                    Padding="{TemplateBinding Padding}"/>

                            <telerik:GridViewScrollViewer x:Name="PART_ItemsScrollViewer"

                    Background="Transparent"

                    CanContentScroll="True"

                    Grid.Row="2"

                    Grid.RowSpan="2"

                    Grid.ColumnSpan="3"

                    Margin="1,0,1,1">

                                <telerik:GridViewScrollViewer.HeaderRow>

                                    <telerik:GridViewHeaderRow x:Name="PART_HeaderRow" IndentLevel="{TemplateBinding
GroupCount}"
Visibility="{TemplateBinding Visibility}"/>

                                </telerik:GridViewScrollViewer.HeaderRow>

                                <telerik:GridViewScrollViewer.NewRow>

                                    <telerik:GridViewNewRow Name="PART_AddNewRow" IndentLevel="{TemplateBinding
GroupCount}"
Visibility="{TemplateBinding Visibility}"/>

                                </telerik:GridViewScrollViewer.NewRow>

                                <telerik:GridViewScrollViewer.FooterRow>

                                    <telerik:GridViewFooterRow x:Name="PART_FooterRow" IndentLevel="{TemplateBinding
GroupCount}"
Visibility="{TemplateBinding Visibility}"/>

                                </telerik:GridViewScrollViewer.FooterRow>

                                <telerik:GridViewVirtualizingPanel x:Name="PART_GridViewVirtualizingPanel"/>

                            </telerik:GridViewScrollViewer>

                            <telerik:ScrollPositionIndicator x:Name="PART_ScrollPositionIndicator"

                    Margin="0,0,28,0"

                    IsHitTestVisible="False"

                    HorizontalAlignment="Right"

                    Grid.Row="2"

                    Grid.ColumnSpan="3"

                    Visibility="{Binding IsScrolling, Mode=TwoWay, RelativeSource={RelativeSource
TemplatedParent}, Converter={StaticResource
BooleanToVisibilityConverter}}"

                    ContentTemplate="{TemplateBinding ScrollPositionIndicatorTemplate}"/>

                            <Border x:Name="PART_FrozenColumnsPreview"

                    Grid.Row="1"

                    Visibility="Collapsed"

                    HorizontalAlignment="Left"

                    VerticalAlignment="Stretch"

                    Grid.RowSpan="4"

                    Background="#33000000"

                    Width="6"/>

                            <telerik:GridViewLoadingIndicator x:Name="PART_GridViewLoadingIndicator"

                    Visibility="Collapsed"

                    IsBusy="{Binding IsBusy, Mode=TwoWay, RelativeSource={RelativeSource
TemplatedParent}}"

                    Grid.RowSpan="4"

                    Grid.ColumnSpan="3"/>

                            <Rectangle x:Name="Background_Disabled" Fill="{StaticResource
Background_Disabled}" IsHitTestVisible="False" Grid.RowSpan="5" Grid.ColumnSpan="3" Visibility="Collapsed"/>

                        </Grid>

                        <Grid Grid.Row="1"

                           
<telerik:RadButton Width="50" content="Click"/>

                        </Grid>

                    </Grid>

                </ControlTemplate>

            </Setter.Value>

        </Setter>

    </Style>

 
Ghasem
Top achievements
Rank 1
 answered on 03 Aug 2014
3 answers
839 views
Hi,

I'm trying to close a RadWindow from my view model. I've bound DialogResult to my view model but setting it doesn't seem to close the window.

Is there something I'm missing or does the RadWindow only support being closed by calling it's Close event?

Any help would be appreciated.
pavan
Top achievements
Rank 1
 answered on 01 Aug 2014
2 answers
1.5K+ views
I am coding in C#, using the MVVM pattern. I have a Main Window that uses several User Controls. I am trying to pass string data fro the Main Window to the View Model of the User Control. So far I have been able to pass the Main Window data to the User Control View and View code behind. However, I can't seem to expose that data to the User Control View Model. Here is what does work:

Main Window XAML,

UCV:SetupUC UC1="{Binding DataContext.ContainerData, ElementName=winCon, Mode=TwoWay}">
</UCV:SetupUC>

User Control XAML,

<TextBox x:Name="tbx1" HorizontalAlignment="Left" Height="23" Margin="159,22,0,0" TextWrapping="Wrap" Text="{Binding UC1, ElementName=root, UpdateSourceTrigger=PropertyChanged}" VerticalAlignment="Top" Width="120" RenderTransformOrigin="0.017,0.304"/>

User Control XAML code behind,

public partial class SetupUC : UserControl, INotifyPropertyChanged
    {

        public static readonly DependencyProperty UC1Property =
    DependencyProperty.Register(
      "UC1", typeof(string), typeof(SetupUC),
        new FrameworkPropertyMetadata()
        {
            PropertyChangedCallback = OnUC1Changed,
            BindsTwoWayByDefault = true
        });
        public string UC1
        {
            get { return (string)GetValue(UC1Property); }
            set
            {
                SetValue(UC1Property, value);
            }
        }
        private static void OnUC1Changed(DependencyObject d, DependencyPropertyChangedEventArgs e)
        {
            if (e.OldValue != e.NewValue)
            {
                // code to be executed on value update
            }
        }
        public SetupUC()
        {
            InitializeComponent();
            SetupViewModel svm = new SetupViewModel();
            this.DataContext = svm;
            Binding binding = new Binding("ViewModelStringProperty") { Source = svm, Mode = BindingMode.TwoWay };
            BindingOperations.SetBinding(this, SetupUC.UC1Property, binding);
        }

The last 2 lines above are an attempt to bind the DP to a property in the User Control View Model - which other posts have suggested as a possible solution. I have not been able to get the binding to work. Again, the TextBox x:Name="tbx1" is displaying the DP, UC1, just fine; it changes "realtime" when the bound data in the Main Window changes.
Stephen
Top achievements
Rank 1
Iron
 answered on 01 Aug 2014
4 answers
92 views
Hello All.
I've a scenario when I use RadGridView linked with QueryableDataProvider.
QueryableDataProvider accepts IQueryable linked with DBContext.
In RadGridView in UI I did groping by one column and sorting by another column

class A : TEntity
{
    public string P1;
    public string P2;
}

Group by P1 and sort by P2 over UI.

In case, IQueriable points to in memory collection, everything works fine.
But when IQueriable points to IDbSet<TEntity> - sorting is not applied.
One difference between my tests is in "ToList()" called on IQueriable passed to QueryableDataProvider constructor.
Unfortunately, I cannot use InMemory collection.
Telerik version is 2014.1.331.45
Dimitrina
Telerik team
 answered on 01 Aug 2014
3 answers
413 views
I use the RadTimePicker on the GridViewDataColumn.

I want to be seen as 24 hours.

Can not use this.radTimePickerStartOn.Culture.DateTimeFormat.ShortTimePattern = "HH:mm:ss";

What should I do?

<telerikGridView:RadGridView x:Name="radGridView"
                                            Grid.Row="2"
                                            ItemsSource="{Binding UserCards}"
                                            SelectedItem="{Binding SelectedUserCard, Mode=TwoWay}"
                                            Margin="5" 
                                            SelectionMode="Single"
                                            ShowGroupPanel="False"
                                            AutoExpandGroups="True"
                                            AutoGenerateColumns="False"
                                            RowDetailsVisibilityMode="Collapsed"
                                            RowIndicatorVisibility="Collapsed"
                                            CanUserFreezeColumns="True"
                                            FrozenColumnCount="2">
    <telerikGridView:RadGridView.Columns>
         <telerikGridView:GridViewDataColumn Width="190" Header="{Binding ResourceWrapper.StringTable.StartedOn, Source={StaticResource StringTable}}" CellStyleSelector="{StaticResource UserCardCellStyleSelector}" DataMemberBinding="{Binding Card.StartedOn, Mode=TwoWay}" DataFormatString="{}{0:yyyy-MM-dd HH:mm:ss}">
                                                <telerikGridView:GridViewDataColumn.CellEditTemplate>
                                                    <DataTemplate>
                                                        <StackPanel Orientation="Horizontal">
                                                            <telerikInput:RadDatePicker DateTimeWatermarkContent="{x:Null}" SelectedDate="{Binding StartDate, Mode=TwoWay}" Width="100" IsTooltipEnabled="False" />
                                                            <StackPanel HorizontalAlignment="Left" Width="90">
                                                                <telerikInput:RadTimePicker x:Name="radTimePickerStartOn" SelectedValue="{Binding StartTime, Mode=TwoWay}" MinWidth="80" Width="90" Margin="0,0,0,0" Culture="ko" />
                                                            </StackPanel>
                                                        </StackPanel>
                                                    </DataTemplate>
                                                </telerikGridView:GridViewDataColumn.CellEditTemplate>
         </telerikGridView:GridViewDataColumn>
    </telerikGridView:RadGridView.Columns>
</telerikGridView:RadGridView>
Boris
Telerik team
 answered on 01 Aug 2014
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?