Telerik Forums
UI for WPF Forum
1 answer
72 views
HOw can I go about checking if the clicked slot was for a new appointment or for an edit?

I want to be able to only edit slots. Not create any new ones.
Vladi
Telerik team
 answered on 10 Dec 2012
0 answers
118 views
Hi,

I'm try this code for drag selecting item if set AllowDrop true not drag and drop file in listbox.

<Window.Resources>
    <Style TargetType="telerik:RadListBoxItem">
        <Setter Property="telerik:DragDropManager.AllowCapturedDrag" Value="True" />
    </Style>
</Window.Resources>
<Window.DataContext>
    <local:ExampleViewModel />
</Window.DataContext>
 
<Grid Background="White" x:Name="LayoutRoot">
    <telerik:RadListBox ItemsSource="{Binding CountryList}" AllowDrop="True" x:Name="listBox" Height="200"
                        HorizontalAlignment="Stretch" VerticalAlignment="Stretch">
        <telerik:RadListBox.ItemTemplate>
            <DataTemplate>
                <Grid Height="50" Width="100" Background="LightBlue" telerik:DragDropManager.AllowDrag="False">
                    <TextBox Text="{Binding CountryName}"
                             VerticalAlignment="Center"
                             PreviewMouseLeftButtonDown="TextBox_PreviewMouseLeftButtonDown"
                             MouseLeave="TextBox_MouseLeave"
                             HorizontalAlignment="Center"/>
                </Grid>
            </DataTemplate>
        </telerik:RadListBox.ItemTemplate>
        <telerik:RadListBox.DragDropBehavior>
            <telerik:ListBoxDragDropBehavior AllowReorder="True"/>
        </telerik:RadListBox.DragDropBehavior>
        <telerik:RadListBox.DragVisualProvider>
            <telerik:ScreenshotDragVisualProvider />
        </telerik:RadListBox.DragVisualProvider>
        <telerik:RadListBox.DropVisualProvider>
            <telerik:LinearDropVisualProvider />
        </telerik:RadListBox.DropVisualProvider>
    </telerik:RadListBox>
John
Top achievements
Rank 1
 asked on 09 Dec 2012
1 answer
346 views
When my tree view expands to no longer fit the window, vertical scroll bars do not appear. When I set:
ScrollViewer.VerticalScrollBarVisibility="Visible"

I initially get a disabled scroll bar. When I expand my tree, the height of the scroll bar is taller than the window so I still can't scroll.
My tree is inside a RadDocumentPane. I have a RadGridView in another RadDocumentPane and scrolling works for it.
Is there something special for a RadTreeView?
David
Top achievements
Rank 1
 answered on 08 Dec 2012
0 answers
221 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
123 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
85 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
707 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
182 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
170 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
167 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
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?