Telerik Forums
UI for WPF Forum
3 answers
135 views
Hi,

after using the ScrollTimeRuler function, is it possible to get the value of the TimeRuler for future reference???

Thank's
Alain
Kalin
Telerik team
 answered on 20 Jun 2014
10 answers
356 views
Hello,

So here's my problem : I have 2 GridViewComboBoxColumn, let's call them cb1 and cb2, filled by default. I want that if I select a value in cb1, values in cb2 change ; if I select another value in cb1, values in cb2 change again.

To do so, I wanted to .Clear() my ObservableCollection<String> which is bound to my cb2, and then to .Add(new String()).

The problem is that an OutOfRangeException occurred on the .Clear() function. I saw somewhere that it was because I can't change anything on a property which is bound to the SelectedValueMemberPath property of the comboBox ; that's why I removed this row in my code. Now it works, I can empty and fill my ObservableCollection, but I can't get the selectedValue in cb2 anymore.

 Here's a sample of my problem, though I couldn't do anything for the dataSet which is filled by an Sql query in my code. Instead, I kept only one column inside, "reference", which represents the reference of the cameras used in my grid, in cb1. Values in cb2 are set in the Resources class.

SampleProject

Thanks for your help !
Christophe
Top achievements
Rank 1
 answered on 20 Jun 2014
1 answer
148 views
Hi.
I've been playing around with the TreeListView, which I like very much.
However, I notice that when enabling the brushes, the lines are broken when the row height becomes bigger than default (for example, a cell has a lot of text so the row height doubles).

This is the code (and I've attached a screenshot) :

<Grid DataContext="{Binding Source={StaticResource SampleDataSource}}">
         <Grid.RowDefinitions>
            <RowDefinition Height="*"/>
        </Grid.RowDefinitions>
        
        <telerik:RadTreeListView AutoGenerateColumns="False"
        TreeLinesVisibility="Visible"
                                 ItemsSource="{Binding People}" Margin="10">
            <telerik:RadTreeListView.ChildTableDefinitions>
                <telerik:TreeListViewTableDefinition ItemsSource="{Binding Children}" />
            </telerik:RadTreeListView.ChildTableDefinitions>
            <telerik:RadTreeListView.Columns>
                <telerik:GridViewDataColumn DataMemberBinding="{Binding Name}" Width=".3*"
                                    Header="Name" />
                <telerik:GridViewDataColumn DataMemberBinding="{Binding SurName}" Width=".3*"
                                    Header="Surname" />
                <telerik:GridViewDataColumn DataMemberBinding="{Binding Address}"
                                    Header="Address" TextWrapping="Wrap" Width=".3*"/>
            </telerik:RadTreeListView.Columns>
        </telerik:RadTreeListView>
</Grid>
Nick
Telerik team
 answered on 20 Jun 2014
1 answer
83 views
Hi,

I have noticed that when you move your mouse over a cell it changes colour. Is there a way to bind to this cell? I have other edit boxes on my form which I want to update depending on which cell the mouse is over. Ie as you move your mouse over the different cells, values in other edit boxes change.  I am not explicitly selecting the cells by clicking on them, just moving my mouse over that cell.
Nick
Telerik team
 answered on 20 Jun 2014
2 answers
199 views
Hi:

I have attached a sample project with a RadWindow as the MainWindow of an app with an issue:

- I have two screens. A primary screen, and the second by the right of the primary screen.
- When I run the app it appears in the primary screen,
- Moving the app to the second screen,
- Click on Maximize button.

What I see is that the windows appears to get a width greather than the second screen width, I guess the width setted in the windows is primaryScreen.Width + secondaryScreen.Width.

One interesting thing it happens, is that if I set the second screen as primary screen, this behavior does not occur.

Am I using the RadWindow in a wrong way or it is a bug?

The attached file is a zip, but I can not attach it as .zip, so I have change the extension to .jpg, please rename it to .zip.

Thanks!

Juan Maria
Top achievements
Rank 1
 answered on 20 Jun 2014
1 answer
167 views
Hi,

Currently Telerik provide the Expression Dark Theme. Would you able to implement the Expression Light theme as well?

I am guessing it would be just be a copy of the Expression Dark Theme with the colours changed.

Thanks
Anthony

Lance | Senior Manager Technical Support
Telerik team
 answered on 19 Jun 2014
3 answers
187 views
I have a RadGridView in which I have several groups. Each group contains editable rows. A tooltip is bound to these rows via style. Since the binding for tooltip is canceled after an editation, I hardcoded the ToolTip on EndRowEdit event. But this approach only works if a row virtualization is turned off. If I turn the virtualization on and edit a row then each n-th line will display the same tooltip.tak takhle?

Style for binding:

<Style x:Key="rowstyle" TargetType="{x:Type telerik:GridViewRow}" >
           <Setter Property="ToolTip" Value="{Binding Hint}"/>
</Style>

Event:

private void radGridView_RowEditEnded(object sender, GridViewRowEditEndedEventArgs e)
{
        e.Row.ToolTip = (e.Row.DataContext as ConfigurationItemViewModel).Hint;
}

RadGridView:

<telerik:RadGridView DataLoadMode="Asynchronous"  x:Name="radGridView" AutoGenerateColumns="False" ItemsSource="{Binding Options}" GridLinesVisibility="Both" IsFilteringAllowed="True" CanUserSortColumns="False" ShowGroupPanel="False"                             
                            RowIndicatorVisibility="Collapsed" EnableColumnVirtualization="True" EnableRowVirtualization="True" RowStyle="{StaticResource rowstyle}"  GroupRenderMode="Flat"
                            VerticalGridLinesBrush="{StaticResource MetroGrey03}"
                            HorizontalGridLinesBrush="{StaticResource MetroGrey03}"
                            telerik:RadContextMenu.ContextMenu="{StaticResource FilterContextMenu}"
                            RowEditEnded="radGridView_RowEditEnded"
                            CanUserDeleteRows="False" CanUserInsertRows="False" CanUserResizeRows="False"
                            con:WatermarkBehavior.EmptyGridWatermarkString="{x:Static loc:Resources.EmptyConfigurationGrid}"
                            con:WatermarkBehavior.IsWatermarkEnabled="True" con:WatermarkBehavior.WatermarkString="{x:Static loc:Resources.GridFilterWatermark}" con:WatermarkBehavior.WatermarkStyle="{StaticResource GridWatermarkStyle}"
                            CanUserFreezeColumns="False" EditTriggers="CellClick" RowLoaded="RadGridView_RowLoaded" CanUserSortGroups="False" Loaded="radGridView_Loaded">
          
           
           <telerik:RadGridView.Resources>
               <cfg:ValueCellTemplateSelector x:Key="CellEditTemplateSelector">              
                   <cfg:ValueCellTemplateSelector.StringValue>       
                       <DataTemplate>
                               <TextBox
                                   con:WatermarkBehavior.IsWatermarkEnabled="True" con:WatermarkBehavior.WatermarkString="{x:Static loc:Resources.EnterHere}" con:WatermarkBehavior.WatermarkStyle="{StaticResource WatermarkStyle}"
                                   Width="Auto" HorizontalAlignment="Stretch" Margin="0" Text="{Binding ValueString, ValidatesOnDataErrors=True, UpdateSourceTrigger=PropertyChanged}" MaxLength="{Binding StringMaxLength, Mode=OneWay}"/>
                       </DataTemplate>
                   </cfg:ValueCellTemplateSelector.StringValue>
                   <cfg:ValueCellTemplateSelector.PasswordValue>
                       <DataTemplate>
                           <styles:PasswordBox2N Width="Auto" HorizontalAlignment="Stretch" Margin="0" Password="{Binding Value, ValidatesOnDataErrors=True, Mode=TwoWay}" MaskLenght="8" MaxLenght="16" />
                       </DataTemplate>
                   </cfg:ValueCellTemplateSelector.PasswordValue>
                   <cfg:ValueCellTemplateSelector.IntValue>
                       <DataTemplate>
                           <cfg:CustomRadNumericUpDown Width="Auto" HorizontalAlignment="Stretch" Margin="0" Style="{DynamicResource RadNumericUpDownStyle}" Value="{Binding ValueNr, Mode=TwoWay}" Maximum="{Binding ValueNrMax}" Minimum="{Binding ValueNrMin}" IsInteger="True"/>
                       </DataTemplate>
                   </cfg:ValueCellTemplateSelector.IntValue>
                   <cfg:ValueCellTemplateSelector.DateTimeValue>
                       <DataTemplate>
                           <telerik:RadDateTimePicker Width="Auto" HorizontalAlignment="Stretch" Margin="0" SelectedValue="{Binding ValueDateTime, Mode=TwoWay}" DisplayFormat="Long" />
                       </DataTemplate>
                   </cfg:ValueCellTemplateSelector.DateTimeValue>
                   <cfg:ValueCellTemplateSelector.DateValue>
                       <DataTemplate>
                           <telerik:RadDateTimePicker Width="Auto" HorizontalAlignment="Stretch" Margin="0" SelectedValue="{Binding ValueDateTime, Mode=TwoWay}" InputMode="DatePicker" DisplayFormat="Long" />
                       </DataTemplate>
                   </cfg:ValueCellTemplateSelector.DateValue>
                   <cfg:ValueCellTemplateSelector.TimeValue>
                       <DataTemplate>
                           <telerik:RadDateTimePicker Width="Auto"  HorizontalAlignment="Stretch" Margin="0" SelectedValue="{Binding ValueDateTime, Mode=TwoWay}" InputMode="TimePicker" DisplayFormat="Long"/>
                       </DataTemplate>
                   </cfg:ValueCellTemplateSelector.TimeValue>
                   <cfg:ValueCellTemplateSelector.TimeIntervalValue>
                       <DataTemplate>                                                                                          
                               <Grid HorizontalAlignment="Stretch">
                               <Grid.ColumnDefinitions>
                                   <ColumnDefinition Width="Auto"/>
                                   <ColumnDefinition Width="*"/>
                               </Grid.ColumnDefinitions>
                               <Grid.RowDefinitions>
                                   <RowDefinition Height="Auto"/>
                                   <RowDefinition Height="Auto"/>
                               </Grid.RowDefinitions>
                               <TextBlock Text="{x:Static loc:Resources.From}"  Style="{StaticResource InsideTextBlockStyle}"/>
                               <cfg:CustomRadDateTimePicker Style="{DynamicResource RadDateTimePickerStyle}" Width="Auto" HorizontalAlignment="Stretch" Margin="0" Grid.Column="1"  x:Name="intervalFromPicker" SelectedValue="{Binding ValueIntervalStart, ValidatesOnDataErrors=True}" InputMode="TimePicker" DisplayFormat="Short" />
                               <TextBlock Grid.Row="1"  Style="{StaticResource InsideTextBlockStyle}"  Text="{x:Static loc:Resources.ToDateTime}" />
                               <cfg:CustomRadDateTimePicker Style="{DynamicResource RadDateTimePickerStyle}"  Width="Auto" HorizontalAlignment="Stretch" Margin="0" Grid.Column="1" Grid.Row="1"  x:Name="intervalToPicker" SelectedValue="{Binding ValueIntervalEnd, ValidatesOnDataErrors=True}" InputMode="TimePicker" DisplayFormat="Short" />
                           </Grid>                           
                       </DataTemplate>
                   </cfg:ValueCellTemplateSelector.TimeIntervalValue>
               </cfg:ValueCellTemplateSelector>
              <cfg:TypeToStringConverter x:Key="typeConverter"/>
           </telerik:RadGridView.Resources>
           <telerik:RadGridView.Columns>              
               <telerik:GridViewDataColumn Name="MainGroupName" UniqueName="GroupColumn" IsVisible="False" DataMemberBinding="{Binding Group}" Header="Group" IsReadOnly="True"/>
               <telerik:GridViewDataColumn DataMemberBinding="{Binding Code}" Header="{x:Static loc:Resources.Code}" TextAlignment="Center" IsReadOnly="True">
                   <telerik:GridViewDataColumn.FilteringControl>
                       <con:ContainsFilterControl/>
                   </telerik:GridViewDataColumn.FilteringControl>
               </telerik:GridViewDataColumn>
               <telerik:GridViewDataColumn MinWidth="345" DataMemberBinding="{Binding ColumnName}" Header="{x:Static loc:Resources.Name}" IsReadOnly="True" >
                   <telerik:GridViewDataColumn.FilteringControl>
                       <con:ContainsFilterControl/>
                   </telerik:GridViewDataColumn.FilteringControl>
               </telerik:GridViewDataColumn>
               <telerik:GridViewDataColumn MinWidth="135" DataMemberBinding="{Binding Value, Mode=TwoWay, ValidatesOnDataErrors=False, UpdateSourceTrigger=PropertyChanged}" Header="{x:Static loc:Resources.Value}" CellEditTemplateSelector="{StaticResource CellEditTemplateSelector}" CellTemplateSelector="{StaticResource CellEditTemplateSelector}" />
               <telerik:GridViewDataColumn DataMemberBinding="{Binding Interpr}" IsFilterable="False" Header="{x:Static loc:Resources.Unit}" IsReadOnly="True"  TextAlignment="Center" />
               <telerik:GridViewDataColumn DataMemberBinding="{Binding ValueNrMin}" IsFilterable="False" Header="{x:Static loc:Resources.Min}" IsReadOnly="True"  TextAlignment="Center" />
               <telerik:GridViewDataColumn DataMemberBinding="{Binding ValueNrMax}" IsFilterable="False" Header="{x:Static loc:Resources.Max}" IsReadOnly="True"  TextAlignment="Center" />
               <telerik:GridViewColumn Header="{x:Static loc:Resources.DefaultValue}" IsReadOnly="True"  >
                   <telerik:GridViewColumn.CellTemplate>
                       <DataTemplate>
                           <TextBlock TextAlignment="Center" Visibility="{Binding IsDefaultValueVisible, Converter={StaticResource visToBoolConv}}">
                               <Hyperlink Foreground="{StaticResource MetroYellow03 }" Command="{Binding DefaultCommand}" ToolTip="{x:Static loc:Resources.ResetToDefault}">
                                   <Run>
                                       <Run.Style>
                                           <Style  TargetType="{x:Type Run}">
                                               <Style.Setters>
                                                   <Setter Property="Text" Value="{Binding DefaultValueString, Mode=OneWay}" />
                                                   
                                               </Style.Setters>
                                               <Style.Triggers>
                                                   <DataTrigger Binding="{Binding DefaultValueString, Mode=OneWay}" Value="">
                                                       <Setter Property="Text" Value="{x:Static loc:Resources.EmptyString}" />
                                                   </DataTrigger>
                                               </Style.Triggers>
                                           </Style>
                                       </Run.Style>
                                   </Run>                                   
                               </Hyperlink>                               
                           </TextBlock>
                       </DataTemplate>
                   </telerik:GridViewColumn.CellTemplate>                   
               </telerik:GridViewColumn>               
               </telerik:RadGridView.Columns>         
           <telerik:RadGridView.GroupDescriptors>
               <telerik:ColumnGroupDescriptor Column="{Binding Columns[\GroupColumn\], ElementName=radGridView}" SortDirection="Ascending" />
           </telerik:RadGridView.GroupDescriptors>
       </telerik:RadGridView>

Yoan
Telerik team
 answered on 19 Jun 2014
8 answers
200 views
How can I set the background color to the Pivot field selection list to a color other than white. For example if I use the OFFICE2013 Theme and set my  window background to black and foreground to white (we need a white on black effect) then the Pivot grid field select list has a white background and white foreground hence the fields disappear. How can I change the color of JUST the field select list (i.e. the control titled 'Choose fields to add to report') to something other than white. The 4 select lists at the base of the screen style correctly i.e. a black background and white foreground)

Thank you
Masha
Telerik team
 answered on 19 Jun 2014
3 answers
1.5K+ views
I am trying to find a way to change the background color of JUST THE TABITEM HEADER - i.e. the background color of the control you click to change tabs. I have managed to change every other background and foreground color of every control using styles with the notable exception of this one.

Can someone please tell me the secret to achieve - any code examples would be appreciated

Evgenia
Telerik team
 answered on 19 Jun 2014
3 answers
253 views
What's the best way of disabling the ability for viewers/users to add relations between tasks?

Is there a way of doing it similar to disabling drag-and-drop/resizing?  (over-wrote CanStartDrag, CanDrop, CanStartResize, CanResize, etc)
Polya
Telerik team
 answered on 19 Jun 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?