Telerik Forums
UI for WPF Forum
6 answers
639 views
I have a WPF application that is designed to be used on laptops with touch screens by police officers while they are driving.  Everything is enlarged to be easy to read at a glance and to hit with sausage fingers.  Since the application is running in a police car, it has day and night modes.  The purpose of night mode is to change the colors of the controls so as not to be too bright or affect night vision.

The RadDateTimePicker controls I'm using have resisted all of my attempts to get their colors to change.  No matter what I do, they always look exactly the same.

Here is what I have done for the TextBox controls in my application.  This lives in the app.xaml, so it applies to all TextBox controls in my application:

<Style TargetType="{x:Type TextBox}">
    <Setter Property="Background"  Value="{DynamicResource UnfocusedBackground}" />
    <Setter Property="BorderBrush" Value="{DynamicResource ControlBorder}" />
    <Setter Property="Foreground"  Value="{DynamicResource UnfocusedForeground}" />
    <Style.Triggers>
        <Trigger Property="IsFocused" Value="True">
            <Setter Property="Background" Value="{DynamicResource FocusedBackground}" />
            <Setter Property="Foreground" Value="{DynamicResource FocusedForeground}" />
        </Trigger>
    </Style.Triggers>
</Style>
The DynamicResources shown are only a few of the ones I've defined.  My app changes the Brushes associated with the various DynamicResources by swapping ResourceDictionaries in the MergedDictionaries property of the Application object.  This is working well.  Except for the RadTimePicker controls.

How do I get my RadDateTimePicker controls to work with my color changing method?  The content templates of your styles are confusing to read and I don't know what part of the control belongs with which part of the template.

Tony
Tony
Top achievements
Rank 1
 answered on 10 Apr 2012
7 answers
446 views
When dynamically changing themes with the rich text box, only certain associated dialogs, etc change after the initial render.

For example, I've included a picture of the Font editor (right-click rich text box and select Font..).  What happens is the button faces (buttons, combo boxes, etc) will remain at whatever theme was selected the first time you bring up the dialog.  In this case, I had originally brought up the dialog with the expression dark theme.  I then switched to office blue and brought it back up.  As you can see most of the elements switched over to office blue as expected, but not all.

The same situation holds true with the paragraph properties dialog, and the right-click menu itself.  

http://i.minus.com/iEWdJu7KP521a.png





As an aside, one thing I'm curious about is the text box itself.  While the border and corner radius change based on the theme, the default text color and background do not change.  I assume that was intentional, but have you considered having an option for it to change as well?
Vasil
Telerik team
 answered on 10 Apr 2012
1 answer
107 views
I have a grid view which is bound to a collection in view model. I have another collection in view model and i want grid to be filtered for the records. i can have itemssource changed to this new collection but that wont allow me to clear filters in grid UI to see all the records. I didn't find anything on your blogs to programatically set the filter in MVVM model.
Filterdescriptors looked somewhat suitable but there is no operator like 'IN' and 'value' cannot be bound to a list.

Please suggest how this can be achived.
Vlad
Telerik team
 answered on 10 Apr 2012
1 answer
155 views
I have a hierarchical RadTreeView, which I am trying to get sorted properly. The first level items need to be sorted by a binding expression, and the second level items need to be sorted by a different binding expression.

Can you refer me to some samples on how to do this?
Hristo
Telerik team
 answered on 10 Apr 2012
0 answers
128 views

I had to create a custom column generator with additional logic. It uses reflection to retrieve information about required fields and generates columns.

var gridColumn = new Telerik.Windows.Controls.GridViewDataColumn { 
    Header = attributes[0].Header, IsVisible = attributes[0].IsVisible,
    UniqueName = property.Name,
    DataMemberBinding = new Binding(string.Format("Item.{0}", property.Name)),
}
It works perfectly except grouping and sorting. However I turned on, that user can sort, and the
grid is groupable and sortable.
this.InternalGrid.GroupDescriptors.Add(new Telerik.Windows.Controls.GridView.ColumnGroupDescriptor()  
{ Column = this.InternalGrid.Columns[1] });


Grouping seems to be working, it adds the correct column to the group panel, however there is only one group
which contains all of the rows. Sorting is working alike, indicator shows the correct sorting option but nothing
happens. What am I missing here?
Andras
Top achievements
Rank 1
 asked on 10 Apr 2012
8 answers
384 views
Hi I am using RadDataPager with RadDataView to show only 5 records at the time in the grid
But when I am using Grouping on the datagrid the Pager returns 5 Group headers per page and the actual records are much more...

Is there a way to fix it?

<telerik:RadDataPager
    Grid.Row="3"
    x:Name="radDataPager"
        Source="{Binding SearchResults}"
        PageSize="5" 
        DisplayMode="All"
        IsTotalItemCountFixed="True"
    />
 
 
<telerik:RadGridView
        x:Name="grdSearchResults"
        Grid.Row="4"
        ItemsSource="{Binding PagedSource, ElementName=radDataPager}"
        IsBusy="{Binding IsSearchActive}"
        IsReadOnly="True"
        CanUserDeleteRows="False"
        CanUserInsertRows="False"
        ShowGroupPanel="False"
        Width="auto"
        AutoGenerateColumns="False"
        ReorderColumnsMode="Interactive"
        RowIndicatorVisibility="Collapsed"
        AutoExpandGroups="True"
        SelectionMode="Extended">
    <telerik:RadGridView.GroupDescriptors>
        <telerik:GroupDescriptor Member="AccountNumber" SortDirection="Ascending" />
        <telerik:GroupDescriptor Member="DocumentType" SortDirection="Ascending" />
    </telerik:RadGridView.GroupDescriptors>
    <i:Interaction.Behaviors>
        <Behaviors:MultiSelectBehavior SelectedItems="{Binding SelectedDocuments}"/>
    </i:Interaction.Behaviors>
 
    <telerik:RadGridView.Columns>
        <telerik:GridViewDataColumn
                Header="ID"
                DataMemberBinding="{Binding EntryId}"
                 />
        <telerik:GridViewDataColumn
                Header="Status"
                DataMemberBinding="{Binding Status}"
                />
        <telerik:GridViewDataColumn
                Header="Created"
                DataMemberBinding="{Binding CreateDate}"
                />
 
        <telerik:GridViewSelectColumn />
 
    </telerik:RadGridView.Columns>
 
    <i:Interaction.Triggers>
        <i:EventTrigger EventName="RowActivated" >
            <i:InvokeCommandAction Command="{Binding DisplayViewCommand}" />
        </i:EventTrigger>
    </i:Interaction.Triggers>
 
</telerik:RadGridView>
Rossen Hristov
Telerik team
 answered on 10 Apr 2012
1 answer
107 views
Hi,
I want to display the value of pie sector in the legend item along with the description.
For reference i have also attached a screen shot.

Thanks
Dhruv
Petar Marchev
Telerik team
 answered on 10 Apr 2012
14 answers
1.1K+ views
Hi,

I have an application with multiple RadWindow and RadWindow.Alert. Some of them are in my project and the orther are in other project (DLL) associated to my application. I like to know how I can disable RadWindow/RadWindow.Alert animation for all my application and related DLL's?

PS: Are the persistence can take care of it if I disable the animation???

Thank's
Ivo
Telerik team
 answered on 10 Apr 2012
5 answers
462 views
I want to put text in the GridView Row header, similar to MS Excel, where it puts numbers 1, 2, 3...... I want to put some custom text. Can you tell me how can this be done?

Thanks,

Ujjwal
Mohammad
Top achievements
Rank 1
 answered on 10 Apr 2012
4 answers
2.1K+ views
Hi,

I have a RadGridView that gets bound to a DataTable (aside: this may not be the proper way to bind, but the UserControl is passed _wg) with this line:
rgvGrid.ItemsSource = _wg.GridData.Tables[0];
One of the columns has a string that I'd like to show an image dependant on what the string is. A job for a converter I thought...
My Converter class is (I've taken out the case statements to ensure an image is returned):
public class RequestColumnConverter : IValueConverter
{
    public object Convert(object value, Type targetType,
        object parameter, CultureInfo culture)
    {
        if (value != null)
        {
            string name = (string)value;
 
            var requestImage = new Image()
            {
                Height = 16,
                Width = 16,
                HorizontalAlignment = System.Windows.HorizontalAlignment.Center,
            };
 
            requestImage.Source = new BitmapImage(new Uri("pack://application:,,,/Images/service.png"));
            return requestImage;
        }
        else return null;
    }
 
    public object ConvertBack(object value, Type targetType,
        object parameter, CultureInfo culture)
    {
        return null;
    }
}

My xaml file contains:
<telerik:GridViewDataColumn Header="Type" IsReadOnly="True" UniqueName="SCSRequestTypeName" DataMemberBinding="{Binding Path=SCSRequestTypeName, Converter={StaticResource requestColumnConverter}}">
     <telerik:GridViewDataColumn.CellTemplate>
             <DataTemplate>
                <Image Source="{Binding SCSRequestTypeName, Converter={StaticResource requestColumnConverter}}"/>
            </DataTemplate>
     </telerik:GridViewDataColumn.CellTemplate>
</telerik:GridViewDataColumn>
This doesn't work. When I add the converter to DataMemberBinding (as shown above), the program enters the converter, but it doesn't enter the converter if I simply have it listed in the Image Source line (also shown).

Have you any suggestions how to get this to work?

Thanks
Vlad
Telerik team
 answered on 10 Apr 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
Book
FileDialogs
ToolBar
ColorPicker
TimePicker
MultiColumnComboBox
SyntaxEditor
VirtualGrid
Wizard
ExpressionEditor
NavigationView (Hamburger Menu)
WatermarkTextBox
DesktopAlert
BarCode
SpellChecker
DataServiceDataSource
EntityFrameworkDataSource
RadialMenu
ChartView3D
Data Virtualization
BreadCrumb
ProgressBar
Sparkline
LayoutControl
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
Rating
SplashScreen
Accessibility
Callout
CollectionNavigator
Localization
AutoSuggestBox
Security
VirtualKeyboard
HighlightTextBlock
TouchManager
StepProgressBar
Badge
OfficeNavigationBar
ExpressionParser
CircularProgressBar
SvgImage
PipsPager
SlideView
AI Coding Assistant
+? more
Top users last month
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Sergii
Top achievements
Rank 1
Iron
Iron
Dedalus
Top achievements
Rank 1
Iron
Iron
Lan
Top achievements
Rank 1
Iron
Doug
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Top users last month
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Sergii
Top achievements
Rank 1
Iron
Iron
Dedalus
Top achievements
Rank 1
Iron
Iron
Lan
Top achievements
Rank 1
Iron
Doug
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?