Telerik Forums
UI for WPF Forum
0 answers
239 views
I need a tree view and I'm trying to figure out which on I should use: TreeView or TreeListView.  My needs are simple so I can't tell which one would be better. Do you have any recommendations?
David
Top achievements
Rank 1
 asked on 08 Dec 2012
2 answers
137 views
I have a grid where one of the columns is bound to a foreign key object. 

<telerik:RadGridView Margin="2,38,2,2" Name="notesListGridView" CanUserInsertRows="False" CanUserDeleteRows="False" IsReadOnly="True" AutoGenerateColumns="False" TabIndex="5" SelectionMode="Extended" >
     <telerik:RadGridView.Columns>
          <telerik:GridViewDataColumn UniqueName="Employee_Note_Date" Header="Date" Width="120"       DataMemberBinding="{Binding Employee_Note_Date, StringFormat=d}" CellStyle="{StaticResource CustomCellStyle}" />
          <telerik:GridViewDataColumn UniqueName="Employee_Note_Types" Header="Type" Width="200" DataMemberBinding="{Binding Employee_Note_Types, Path=Employee_Note_Types.Description}" CellStyle="{StaticResource CustomCellStyle}" />
          <telerik:GridViewDataColumn UniqueName="Notes" Header="Notes" Width="*" DataMemberBinding="{Binding Notes}" TextWrapping="Wrap" CellStyle="{StaticResource CustomCellStyle}"></telerik:GridViewDataColumn>
     </telerik:RadGridView.Columns>
</telerik:RadGridView>

When I use the built in grid filtering I am able to filter that column. However when I try to filter with code: 

string searchTxt = searchTextBox.Text;
notesListGridView.FilterDescriptors.Clear();
CompositeFilterDescriptor compositeDescriptor = new CompositeFilterDescriptor();
compositeDescriptor.LogicalOperator = FilterCompositionLogicalOperator.Or;
 
foreach (Telerik.Windows.Controls.GridViewColumn column in notesListGridView.Columns)
{
     if (column.IsVisible)
     {
          GridViewDataColumn col = (GridViewDataColumn)column;
          if (col.DataType.ToString() == "System.String")
          {
               compositeDescriptor.FilterDescriptors.Add(new FilterDescriptor(column.UniqueName, FilterOperator.Contains, searchTxt, false));
          }
     }
}
notesListGridView.FilterDescriptors.Add(compositeDescriptor);

When I add the CompositeFilter the notesListGridView.FilterDescriptors I get an InvalidCastException:
Invalid cast from 'System.String' to 'CoreDataServiceReference.Employee_Note_Type'.

How can I apply a filter to the foreign key object in the code?
Dev
Top achievements
Rank 1
 answered on 07 Dec 2012
3 answers
100 views
I have a grid with a DataColumn that has it's CellTemplate set to a DataTemplate that contains a ComboBox.  The ComboBox has it's ItemsSource bound to a Collection in a view model. The collection contains simple integers.

The ComboBox's ItemTemplate contains an Image, with its Source bound to the item, using a Converter that returns a pack URI appropriate to the integer. The result is that cell contains a dropdown of images.

And all of that is working fine.

My problem is that if I group on the column, or apply a filter on the column, the grouping control and the filtering control provide a list of the values of the cells in the column, and the values it displays are the integers, not the images.

Seems to me that if I could get the grouping and filtering controls to apply the converter I am already using in the cell, I'd have what I'd like. But I don't know if that is possible.

Is it?
Dimitrina
Telerik team
 answered on 07 Dec 2012
9 answers
751 views
I have recently implemented themes in my application.  The application has two themes, Day & Night.  The application changes themes by loading a ResourceDictionary that defines different colors for the same named SolidColorBrush DynamicResources.

Here is the xaml for the style I'm using for the rows in the all of the RadGridView controls in my application.  This is in the app,xaml file:
<Style TargetType="telerik:GridViewRow">
    <Setter Property="Background"
            Value="{DynamicResource TextBackground}" />
    <Setter Property="Foreground"
            Value="{DynamicResource TextForeground}" />
</Style>

I think the first row is probably the row used to insert new rows into the Grid.  Here's the XAML for one of my RadGridControls:

<telerik:RadGridView AutoExpandGroups="True"
                     AutoGenerateColumns="False"
                     Background="{DynamicResource DataBackground}"
                     CanUserDeleteRows="False"
                     CanUserFreezeColumns="False"
                     CanUserInsertRows="False"
                     CanUserResizeColumns="False"
                     CanUserSortColumns="True"
                     EnableColumnVirtualization="True"
                     EnableRowVirtualization="True"
                     FontSize="16"
                     FontWeight="Bold"
                     Foreground="{DynamicResource DataForeground}"
                     Grid.Column="1"
                     Grid.ColumnSpan="2"
                     Grid.Row="1"
                     IsReadOnly="True"
                     ItemsSource="{Binding Path=DataRetentionPolicies, Mode=TwoWay, RelativeSource={RelativeSource AncestorType={x:Type cs:AdvancedSettingEditor}}}"
                     Margin="5"
                     Name="DataPolicies"
                     SelectionUnit="FullRow"
                     ScrollMode="Deferred"
                     ScrollViewer.CanContentScroll="True"
                     ScrollViewer.HorizontalScrollBarVisibility="Auto"
                     ScrollViewer.VerticalScrollBarVisibility="Auto"
                     ShowGroupFooters="True"
                     TabIndex="8"
                     ToolTip="Data Maintenance Properties"
                     Visibility="{Binding Converter={StaticResource BoolToVisibility}, Mode=TwoWay, Path=EnableRetention, RelativeSource={RelativeSource AncestorType={x:Type cs:AdvancedSettingEditor}}}">
    <telerik:RadGridView.Columns>
        . . .
    </telerik:RadGridView.Columns>
</telerik:RadGridView>

As you can see, the control is read-only and it doesn't allow inserting, editing or deleting of rows.

In the Day theme, the rows in my RadGridView have black text on white backgrounds. In the Day theme, they're supposed to have yellow text on black backgrounds. And every row in the DataGridControl matches this color scheme exept the first, which still has a white background.

How do I get the first row's background to change with the other rows?
Tony
Tony
Top achievements
Rank 1
 answered on 07 Dec 2012
2 answers
200 views
I've got a RadMaskedDateTimeInput control in my application:
<telerik:RadMaskedDateTimeInput BorderBrush="{Binding Path=BorderBrush, Mode=TwoWay, RelativeSource={RelativeSource AncestorType={x:Type cs:TimeSpanSpinner}}}"
                                        FlowDirection="{Binding Path=FlowDirection, Mode=TwoWay, RelativeSource={RelativeSource AncestorType={x:Type cs:TimeSpanSpinner}}}"
                                        Focusable="True"
                                        FontFamily="{Binding Path=FontFamily, Mode=TwoWay, RelativeSource={RelativeSource AncestorType={x:Type cs:TimeSpanSpinner}}}"
                                        FontSize="{Binding Path=FontSize, Mode=TwoWay, RelativeSource={RelativeSource AncestorType={x:Type cs:TimeSpanSpinner}}}"
                                        FontStretch="{Binding Path=FontStretch, Mode=TwoWay, RelativeSource={RelativeSource AncestorType={x:Type cs:TimeSpanSpinner}}}"
                                        FontStyle="{Binding Path=FontStyle, Mode=TwoWay, RelativeSource={RelativeSource AncestorType={x:Type cs:TimeSpanSpinner}}}"
                                        FontWeight="{Binding Path=FontWeight, Mode=TwoWay, RelativeSource={RelativeSource AncestorType={x:Type cs:TimeSpanSpinner}}}"
                                        GotFocus="ValueBox_GotFocus"
                                        Grid.Column="0"
                                        FormatString="{Binding Path=Mask, Mode=OneWay, RelativeSource={RelativeSource AncestorType={x:Type cs:TimeSpanSpinner}}}"
                                        HorizontalAlignment="Stretch"
                                        HorizontalContentAlignment="Right"
                                        InputBehavior="Insert"
                                        IsClearButtonVisible="False"
                                        LostFocus="ValueBox_LostFocus"
                                        Margin="5"
                                        Mask="{Binding Path=Mask, Mode=OneWay, RelativeSource={RelativeSource AncestorType={x:Type cs:TimeSpanSpinner}}}"
                                        Name="ValueBox"
                                        SelectionOnFocus="CaretToEnd"
                                        SpinMode="PositionAndValue"
                                        TabIndex="{Binding Path=TabIndex, Mode=TwoWay, RelativeSource={RelativeSource AncestorType={x:Type cs:TimeSpanSpinner}}}"
                                        TextMode="MaskedText"
                                        UpdateValueEvent="PropertyChanged"
                                        Value="{Binding Converter={StaticResource TimeSpanConverter}, Path=Value, Mode=TwoWay, RelativeSource={RelativeSource AncestorType={x:Type cs:TimeSpanSpinner}}, UpdateSourceTrigger=PropertyChanged}"
                                        VerticalAlignment="Center" />

This is actually inside of a UserControl.  That user control is then used in another UserControl that is used to edit user settings.  The first UserControl is supposed to provide spinner functionality for specifying a time out interval on a touch screen computer.  There are two big buttons next to the RadMaskedDateTimeInput control, one for increasing the value and one for decreasing it.  Since the value is a time out, the data type of the variable being edited is TimeSpan, and I want to see the text formatted as HH:mm:ss.fff.  That's what the Mask property is set to, and the FormatString is set to that, too.

The control displays correctly until I put the cursor in it.  At that point, the HH:mm:ss.fff formatting goes away and I see 01/01/0001.  This is useless.  This did work properly at one time, but now it's broken and I don't know why.  Why is the control ignoring the input mask???

I'm using the 2012 Q1 version of the library.
Tony
Top achievements
Rank 1
 answered on 07 Dec 2012
3 answers
213 views
I've managed to get a RadTileViewItem to fade in when it's added to the TileView. That was easy of course, as the item exists, and I can just set it's opacity to 0 and move it up.

However, I also want to get an item to fade out. But, when the item is removed from the underlying collection, the RadTileViewItem is of course immediately removed, and so it's gone.

How can I accomplish this? 
Pavel R. Pavlov
Telerik team
 answered on 07 Dec 2012
2 answers
188 views
hi all, hope u can help me, i tried this code but the event is never fired

 <telerik:RadDiagram x:Name="diagram"
                            Grid.Row="1"
                            ActiveTool="PanTool"
                            ShapeStyle="{StaticResource TestNodeStyle}"
                            KeyDown="diagram_KeyDown"/>

 private void diagram_KeyDown(object sender, KeyEventArgs e)
        {
            if (e.Key == Key.Cancel)
                e.Handled = true;
        }

thanks,
Fabrizio
Top achievements
Rank 1
 answered on 07 Dec 2012
2 answers
211 views
Hi,
my problem is that the slider clips my ticks, because he think they are to long.
Set ClipToBounds to false does not help to solve this issue.

Here is my code:
<telerik:RadSlider Grid.Row="3"
                                Grid.Column="0"
                                Grid.ColumnSpan="2"
                                Margin="25,0,25,10"
                                Value="{Binding SlectedTimeSpan}"
                                VerticalAlignment="Bottom"
                                Minimum="0"
                                Maximum="24"
                                TickFrequency="8"
                                TickPlacement="BottomRight"
                                ClipToBounds="False"
                                IsSnapToTickEnabled="True">
                        <telerik:RadSlider.TickTemplate>
                            <DataTemplate>
                                <StackPanel ClipToBounds="False">
                                    <Ellipse Width="5"
                                             Height="5"
                                             Fill="Black"
                                             HorizontalAlignment="Center" />
                                    <TextBlock Text="{Binding StringFormat=+{0} Std.}"
                                               HorizontalAlignment="Center" />
                                </StackPanel>
                            </DataTemplate>
                        </telerik:RadSlider.TickTemplate>
                    </telerik:RadSlider>

You can find a picture of the result as attached file.

Can anybody help me with this issue???
Mark
Top achievements
Rank 1
 answered on 07 Dec 2012
2 answers
123 views
Hello. If I set the Width property of the RadRibbonGroup, the scrolling does not go all the way over. See attached screenshots. If I remove the Width property, the scrolling works fine. I set the width because I place different controls in the group and the sizing isn't correct unless I set the size. Is there any way to get this to work?

<

 

 

telerik:RadRibbonGroup Header="Test2" Width="300">

Thanks
Scott

 

Scott Michetti
Top achievements
Rank 1
Iron
 answered on 07 Dec 2012
6 answers
117 views
Hi,

Is there a way to say to the TreeListView not to unload rows when the parent node is collapsed?

I have already set EnableColumnVirtualization="False" and EnableRowVirtualization="False"

The same question when pager is used.

Thanks,
Prolifis
Top achievements
Rank 1
 answered on 07 Dec 2012
Narrow your results
Selected tags
Tags
GridView
General Discussions
Chart
RichTextBox
Docking
ScheduleView
ChartView
TreeView
Diagram
Map
ComboBox
TreeListView
Window
RibbonView and RibbonWindow
PropertyGrid
DragAndDrop
TabControl
TileView
Carousel
DataForm
PDFViewer
MaskedInput (Numeric, DateTime, Text, Currency)
AutoCompleteBox
DatePicker
Buttons
ListBox
GanttView
PivotGrid
Spreadsheet
Gauges
NumericUpDown
PanelBar
DateTimePicker
DataFilter
Menu
ContextMenu
TimeLine
Calendar
Installer and Visual Studio Extensions
ImageEditor
BusyIndicator
Expander
Slider
TileList
PersistenceFramework
DataPager
Styling
TimeBar
OutlookBar
TransitionControl
FileDialogs
Book
ToolBar
ColorPicker
TimePicker
MultiColumnComboBox
SyntaxEditor
VirtualGrid
Wizard
ExpressionEditor
NavigationView (Hamburger Menu)
WatermarkTextBox
DesktopAlert
BarCode
SpellChecker
DataServiceDataSource
EntityFrameworkDataSource
RadialMenu
ChartView3D
Data Virtualization
BreadCrumb
LayoutControl
ProgressBar
Sparkline
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
SplashScreen
Callout
Rating
Accessibility
CollectionNavigator
Localization
AutoSuggestBox
Security
VirtualKeyboard
HighlightTextBlock
TouchManager
StepProgressBar
Badge
OfficeNavigationBar
ExpressionParser
CircularProgressBar
SvgImage
PipsPager
SlideView
AI Coding Assistant
+? more
Top users last month
Cynthia
Top achievements
Rank 1
Iron
Toby
Top achievements
Rank 3
Iron
Iron
Iron
Danielle
Top achievements
Rank 1
Iron
Iron
Joel
Top achievements
Rank 3
Bronze
Bronze
Iron
yw
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Cynthia
Top achievements
Rank 1
Iron
Toby
Top achievements
Rank 3
Iron
Iron
Iron
Danielle
Top achievements
Rank 1
Iron
Iron
Joel
Top achievements
Rank 3
Bronze
Bronze
Iron
yw
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?