Telerik Forums
UI for WPF Forum
3 answers
642 views
I have a RadListBox as a messagebox which is bound to a list of messages from the system. When there is a fault in the system a fault message is recorded, I want to highlight this message with red background. Is there any way to change the background of an item based on its value.

I tried this code but it didn't have access to background property.
this.ListBox.Items.CurrentChanged += (sender, args) =>
{
    for (int i = 0; i < this.ListBox.Items.Count; ++i)
    {
        var item = this.ListBox.Items[i];
 
        if (item.ToString().StartsWith("Fault"))
        {
            ListBox.Items[i]............????????? Looking for background property.
        }
    }
};


Thanks.
Kalin
Telerik team
 answered on 11 Jun 2015
1 answer
2.0K+ views

Consider this code, which displays a textbox with rounded corners:

<Window x:Class="WpfApplication1.MainWindow"
        xmlns:System="clr-namespace:System;assembly=mscorlib"
        Title="MainWindow" Height="350" Width="525">
    <Window.Resources>
        <ControlTemplate TargetType="TextBoxBase" x:Key="txt">
            <Border Padding="10" CornerRadius="10" BorderThickness="1" BorderBrush="Black" x:Name="Bd" Background="{TemplateBinding Panel.Background}">
                <ScrollViewer Name="PART_ContentHost" SnapsToDevicePixels="{TemplateBinding UIElement.SnapsToDevicePixels}" />
            </Border>
            <ControlTemplate.Triggers>
                <Trigger Property="UIElement.IsEnabled">
                    <Setter Property="Panel.Background" TargetName="Bd">
                        <Setter.Value>
                            <DynamicResource ResourceKey="{x:Static SystemColors.ControlBrushKey}" />
                        </Setter.Value>
                    </Setter>
                    <Setter Property="TextElement.Foreground">
                        <Setter.Value>
                            <DynamicResource ResourceKey="{x:Static SystemColors.GrayTextBrushKey}" />
                        </Setter.Value>
                    </Setter>
                    <Trigger.Value>
                        <System:Boolean>False</System:Boolean>
                    </Trigger.Value>
                </Trigger>
            </ControlTemplate.Triggers>
        </ControlTemplate>
    </Window.Resources>
    <Grid>
        <TextBox
            Template="{StaticResource txt}"
            Margin="10"
            Padding="10"
            Background="Transparent"
            BorderThickness="0"
            Width="254"
            Height="55"/>
    </Grid>
</Window>

But if I add reference to telerik controls, then the border of the textbox is displayed again, regardles of the 'BorderThickness' property. This is my code in App.xaml (if I comment this out then everything is ok again):

        <ResourceDictionary>
            <ResourceDictionary.MergedDictionaries>
                <ResourceDictionary Source="/Telerik.Windows.Themes.Windows8;component/Themes/System.Windows.xaml"/>
                <ResourceDictionary Source="/Telerik.Windows.Themes.Windows8;component/Themes/Telerik.Windows.Controls.xaml"/>
                <ResourceDictionary Source="/Telerik.Windows.Themes.Windows8;component/Themes/Telerik.Windows.Controls.Navigation.xaml"/>
                <ResourceDictionary Source="/Telerik.Windows.Themes.Windows8;component/Themes/Telerik.Windows.Controls.Docking.xaml"/>
            </ResourceDictionary.MergedDictionaries>
        </ResourceDictionary>

Sia
Telerik team
 answered on 11 Jun 2015
1 answer
137 views

Hi,

I have a large time period from 2010/1/1 to 2015/1/1 and I have a second interval support second for large range time

When I zoom in into the intervals, the project became stopped because of a System.OutOFMemoryException Error.

My questions :

1- Dose I use virtualization in correct way ?

2- Does the RadTimeLine Support the second interval for large period or my code is wrong?

 

My code :

   <telerik:RadTimeline x:Name="RadTimeline1" 
                                 PeriodStart="{Binding StartDate, Mode=TwoWay}"
                                 PeriodEnd="{Binding EndDate, Mode=TwoWay}"
                                 StartPath="Date"
                                 DurationPath="Duration"
                                 IsSelectionEnabled="True"
                                 SelectionMode="Extended"
                                 VirtualizingPanel.IsVirtualizing="True"
                                 ItemsSource="{Binding Data}">
            <telerik:RadTimeline.Intervals>
                <telerik:YearInterval />
                <telerik:MonthInterval />
                <telerik:WeekInterval />
                <telerik:DayInterval />
                <telerik:HourInterval />
                <telerik:MinuteInterval />
                <telerik:SecondInterval VirtualizingPanel.IsVirtualizing="True"/>
            </telerik:RadTimeline.Intervals>
        </telerik:RadTimeline>

Petar Marchev
Telerik team
 answered on 11 Jun 2015
1 answer
141 views

Hi Telerik Team,

 We have a several Widgets in Docking Control. Most Widgets have a PRISM Region in their Titlebar, this works good at the moment.

 But when Widgets get floated into the ToolWindow and then readded to the Docking I get exceptions from Prism etc.

 

So I wanted to ask how do implement A Region inside Widget Title Bar Header that support Floating and readding to the Docking.

 

Thank you

Johannes

Vladi
Telerik team
 answered on 11 Jun 2015
2 answers
304 views
Is there any easy way to get the current page count from a WPF RadDocument that is set to layout Paged?
Phoenix
Top achievements
Rank 1
 answered on 11 Jun 2015
4 answers
228 views

Hi,

As CheckedItems Event  of RadTreeView is not giving results properly, we implemented RadTreeView Checkbox using MVVM using http://docs.telerik.com/devtools/wpf/controls/radtreeview/how-to/howto-tri-state-mvvm. Now, we are able to get the checked items properly.

Now, how should we support keyboard events like by pressing CTRl+Space , Node should get selected. Is there any way to handle this. If we do not use MVVM TriState check box, we can acheive by setting the property "IsOptionElementsEnabled" to true.

Please let me know your inputs.

Thanks,

Subhashini

 

 

Martin Ivanov
Telerik team
 answered on 11 Jun 2015
4 answers
190 views

I am trying to represent a Yes/No decision tree using the Diagram control. When rendered using the TreeDown, OrgChart layout/router, it seems that some nodes are rendered with minimal offset, while others are rendered so that there is no vertical alignment, yet I add the connectors in the same fashion.

See attached for an example. The result is that a significant amount of scrolling is needed to follow the connectors to the nodes.

Is there a way I can indicate that it is ok to draw nodes with vertical overlap (similar to how the "yes" path is drawn in the example), instead of the layout engine leaving room under shapes and causing the diagram to appear abnormally wide?

 

Peshito
Telerik team
 answered on 11 Jun 2015
1 answer
60 views
Hello Telerik,

I updated my WPF project from  2014 Q3 to 2015 Q1 and it seems that the user insert of rows in the RadGridView dose not work any more and it seems that the ShowInsertRow property dose no longer exist?

Greetings Uwe
Dimitrina
Telerik team
 answered on 11 Jun 2015
1 answer
256 views

Hi,

we're using a RadGridView for displaying result sets of dynamic database queries. These queries are user-customizable and may (especially during design phase) yield several billions of rows.

The RadGridView is configured to use row virtualization. However, when using an IEnumerable-derived ResultsSet (which will load the requested items on the fly), all items are enumerated before the first few are being displayed. This operation requires a lot of memory and fails for larger result sets.

Before investing effort in implementing IQueryable for the ResultsSet object, we'd like to ensure this would enable us to dynamically load the currently displayed rows only.

Does anyone have any experience using RadGridView in such a scenario?

Any help is greatly appreciated!

Best regards,

Oliver

Dimitrina
Telerik team
 answered on 10 Jun 2015
3 answers
162 views
I,

I would like to know if it's possible to change the current month position in the display?
I mean, if I have a 3x3 calendar display, I would like to have the current month at the middle position or at the lower left position.

Thank's
Georgi
Telerik team
 answered on 10 Jun 2015
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
SyntaxEditor
MultiColumnComboBox
VirtualGrid
Wizard
ExpressionEditor
NavigationView (Hamburger Menu)
DesktopAlert
WatermarkTextBox
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
Iron
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
Iron
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?