Telerik Forums
UI for WPF Forum
8 answers
324 views
I have this GridView that looks like this.

<tg:RadGridView
        tc:RadDockPanel.Dock="Top"
        ItemsSource="{Binding Steps}"
        SelectedItem="{Binding CurrentSelectedStep, Source={x:Static SizingApp:ProjectManager.Instance}, Converter={StaticResource PSSpecConverter}, Mode=TwoWay}"
        Style="{StaticResource RadGridViewStyle}"
        RowLoaded="RadGridView_RowLoaded">
    <tg:RadGridView.ChildTableDefinitions>
        <tg:GridViewTableDefinition>
            <tg:GridViewTableDefinition />
        </tg:GridViewTableDefinition>
    </tg:RadGridView.ChildTableDefinitions>
    <tg:RadGridView.HierarchyChildTemplate>
        <DataTemplate>
            <tg:RadGridView
                    ItemsSource="{Binding Loads}"
                    SelectedItem="{Binding CurrentSelectedLoad, Source={x:Static SizingApp:ProjectManager.Instance}, Converter={StaticResource PSSpecConverter}, Mode=TwoWay}"
                    Style="{StaticResource RadGridViewStyle}">
                <tg:RadGridView.Columns>
                    <tg:GridViewDataColumn DataMemberBinding="{Binding Name}"
                            Header="{Resx ResxName=PSSPECApplication.Controls.ProjectControlResources, Key=StepSummary_LoadColumn_Header}"
                            TextAlignment="Left" />
                    <tg:GridViewDataColumn DataMemberBinding="{Binding Abbreviation}"
                            Header="{Resx ResxName=PSSPECApplication.Controls.ProjectControlResources, Key=StepSummary_TypeColumn_Header}"
                            TextAlignment="Left" />
                    <tg:GridViewDataColumn DataMemberBinding="{Binding Quantity}"
                            Header="{Resx ResxName=PSSPECApplication.Controls.ProjectControlResources, Key=StepSummary_QuantityColumn_Header}"
                            TextAlignment="Center" />
                    <tg:GridViewDataColumn DataMemberBinding="{Binding RunningKVA, StringFormat={}{0:F2}}"
                            Header="{Resx ResxName=PSSPECApplication.Controls.ProjectControlResources, Key=StepSummary_RunningKVAColumn_Header}"
                            TextAlignment="Right" />
                    <tg:GridViewDataColumn DataMemberBinding="{Binding RunningKW, StringFormat={}{0:F2}}"
                            Header="{Resx ResxName=PSSPECApplication.Controls.ProjectControlResources, Key=StepSummary_RunningKWColumn_Header}"
                            TextAlignment="Right" />
                    <tg:GridViewDataColumn DataMemberBinding="{Binding StartingKVA, StringFormat={}{0:F2}}"
                            Header="{Resx ResxName=PSSPECApplication.Controls.ProjectControlResources, Key=StepSummary_StartingKVAColumn_Header}"
                            TextAlignment="Right" />
                    <tg:GridViewDataColumn DataMemberBinding="{Binding StartingKW, StringFormat={}{0:F2}}"
                            Header="{Resx ResxName=PSSPECApplication.Controls.ProjectControlResources, Key=StepSummary_StartingKWColumn_Header}"
                            TextAlignment="Right" />
                    <tg:GridViewCheckBoxColumn DataMemberBinding="{Binding IsNonLinear}"
                            Header="{Resx ResxName=PSSPECApplication.Controls.ProjectControlResources, Key=StepSummary_NonLinearColumn_Header}" />          
                </tg:RadGridView.Columns>
            </tg:RadGridView>
        </DataTemplate>
    </tg:RadGridView.HierarchyChildTemplate>
    <tg:RadGridView.Columns>
        <tg:GridViewDataColumn DataMemberBinding="{Binding Name}"
            Header="{Resx ResxName=PSSPECApplication.Controls.ProjectControlResources, Key=ProjectSummary_StepColumn_Header}"
            TextAlignment="Left" />
        <tg:GridViewDataColumn DataMemberBinding="{Binding VoltageDip, StringFormat={Resx ResxName=PSSPECApplication.Controls.ProjectControlResources, Key=VoltageDipFormat}}"
            Header="{Resx ResxName=PSSPECApplication.Controls.ProjectControlResources, Key=ProjectSummary_VoltageDip_Header}"
            TextAlignment="Center"/>
        <tg:GridViewDataColumn DataMemberBinding="{Binding RunningKVA, StringFormat={}{0:F2}}"
            Header="{Resx ResxName=PSSPECApplication.Controls.ProjectControlResources, Key=ProjectSummary_RunningKVAColumn_Header}"
            TextAlignment="Right"/>
        <tg:GridViewDataColumn DataMemberBinding="{Binding RunningKW, StringFormat={}{0:F2}}"
            Header="{Resx ResxName=PSSPECApplication.Controls.ProjectControlResources, Key=ProjectSummary_RunningKWColumn_Header}"
            TextAlignment="Right"/>
        <tg:GridViewDataColumn DataMemberBinding="{Binding StartingKVA, StringFormat={}{0:F2}}"
            Header="{Resx ResxName=PSSPECApplication.Controls.ProjectControlResources, Key=ProjectSummary_StartingKVAColumn_Header}"
            TextAlignment="Right"/>
        <tg:GridViewDataColumn DataMemberBinding="{Binding StartingKW, StringFormat={}{0:F2}}"
            Header="{Resx ResxName=PSSPECApplication.Controls.ProjectControlResources, Key=ProjectSummary_StartingKWColumn_Header}"
            TextAlignment="Right"/>
        <tg:GridViewDataColumn DataMemberBinding="{Binding RunningKVASum, StringFormat={}{0:F2}}"
            Header="{Resx ResxName=PSSPECApplication.Controls.ProjectControlResources, Key=ProjectSummary_RunningKVASumColumn_Header}"
            TextAlignment="Right"/>
        <tg:GridViewDataColumn DataMemberBinding="{Binding RunningKWSum, StringFormat={}{0:F2}}"
            Header="{Resx ResxName=PSSPECApplication.Controls.ProjectControlResources, Key=ProjectSummary_RunningKWSumColumn_Header}"
            TextAlignment="Right"/>
    </tg:RadGridView.Columns>
</tg:RadGridView>

I've been trying to get this to have the rows be expanded after binding if there are Loads within Steps. However I can't figure out how to make them Expended by Default, and how to hide the IsExpandable click opener when there are no Loads within Steps. In the help file, it shows how to enable and disable IsExpandable on RowLoaded event. However, when binding occurs, nothing is updated as the RowLoaded doesn't fire. Can anyone comment on how to make the rows expanded by default, and which events to use to make the IsExpandable work as binding occurs?
Lynne
Top achievements
Rank 1
 answered on 08 Nov 2011
5 answers
424 views
Looking at the documentation for the RibbonView and RibbonButton, I see:

In order to create a command you have to create a static read-only instance ofTelerik.Windows.Controls.RoutedUICommand and then add execute and you can execute event handlers to theTelerik.Windows.Controls.CommandManager class.

Is this seriously the only binding implementation that the RibbonButton supports?! Can't we simply bind the button to an ICommand? Forcing the ugly, complicated implementation of a static read-only RoutedUICommand can't be the only way.

-Greg
Greg
Top achievements
Rank 1
 answered on 08 Nov 2011
1 answer
126 views
FYI: Observation with a grid with some dummy data: About 30 appointments with grouping (20 Employees). Switching from week to day view by clicking on the day switches immediately.

Now, when I go to month view and click on a date to quickly jump back to day view, the CPU spikes (not fully maxed out) for about 10 seconds, the UI locks up and RAM usage goes up 200 MB. Memory is eventually garbage collected, but a there seems to be a serious flaw in the implementation.
Rosi
Telerik team
 answered on 08 Nov 2011
1 answer
689 views
I want to use change theme function, but I found that the background color of stackpanel will not change with theme setting. The default background color of stackpanel only act when first app start, then we change the theme, it does not change its color.
The code is :
<Window x:Class="MainWin.MainWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:telerik="http://schemas.telerik.com/2008/xaml/presentation"
        Title="MainWindow" Height="350" Width="525">
 
    <telerik:RadDocking x:Name="radDocking" HasDocumentHost="False" AllowUnsafeMode="True">
 
        <telerik:RadSplitContainer InitialPosition="DockedTop" Height="50" Orientation="Vertical">
            <telerik:RadPaneGroup>
                <telerik:RadPane PaneHeaderVisibility="Collapsed">
                    <Grid>
                        <Grid.RowDefinitions>
                            <RowDefinition></RowDefinition>
                            <RowDefinition></RowDefinition>
                        </Grid.RowDefinitions>
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition></ColumnDefinition>
                            <ColumnDefinition></ColumnDefinition>
                        </Grid.ColumnDefinitions>
                        <StackPanel Grid.Row="0" Grid.Column="0" Grid.ColumnSpan="2" x:Name="Part1">
                            <telerik:RadButton Content="Office_Blue" Width="100" Height="30" Click="RadButton_Click"/>
                            <telerik:RadButton Content="Expression_Dark" Width="100" Height="30" Click="RadButton_Click"/>
                        </StackPanel>
                        <StackPanel HorizontalAlignment="Stretch" VerticalAlignment="Stretch"  Grid.Row="1" Grid.Column="0"   x:Name="Part2" >
                            <Label Content="Test1" HorizontalContentAlignment="Center" VerticalContentAlignment="Center"/>
                        </StackPanel>
                        <StackPanel Grid.Row="1" Grid.Column="1">
                            <telerik:Label Content="Label 2"  HorizontalAlignment="Center" x:Name="Part3"/>
                        </StackPanel>
                    </Grid>
                </telerik:RadPane>
            </telerik:RadPaneGroup>
        </telerik:RadSplitContainer>
    </telerik:RadDocking>
</Window>
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
using Telerik.Windows.Controls;
 
namespace MainWin
{
    /// <summary>
    /// Interaction logic for MainWindow.xaml
    /// </summary>
    public partial class MainWindow : Window
    {
        public MainWindow()
        {
            StyleManager.ApplicationTheme = new Expression_DarkTheme();
            //StyleManager.ApplicationTheme = new Office_BlueTheme();
            InitializeComponent();
        }
 
        private void RadButton_Click(object sender, RoutedEventArgs e)
        {
            RadButton btn = sender as RadButton;
            if (btn.Content.ToString() == "Office_Blue")
            {
                SetGlobalTheme(new Office_BlueTheme());
            }
            else
            {
                SetGlobalTheme(new Expression_DarkTheme());
            }
        }
 
 
        public static void SetGlobalTheme(Theme theme)
        {
            StyleManager.ApplicationTheme = theme;
 
            foreach (Window w in Application.Current.Windows)
            {
                SetThemeToVisualObject(w);
            }
        }
   
        public static void SetThemeToVisualObject(DependencyObject myVisual)
        {
 
            foreach (object o in LogicalTreeHelper.GetChildren(myVisual))
            {
                if (o is FrameworkElement)
                {
                    if (o.GetType().AssemblyQualifiedName.StartsWith("Telerik.Windows.Controls"))
                        StyleManager.SetTheme((FrameworkElement)o, StyleManager.ApplicationTheme);
 
                    SetThemeToVisualObject((FrameworkElement)o);
                }
            }
        }
    }
}
In the MainWindow() constructor, if we use 
StyleManager.ApplicationTheme = new Expression_DarkTheme();
then we start the app, we will find the StackPanel is dark,
However, if we use
StyleManager.ApplicationTheme = new Office_BlueTheme();
the StackPanel is white.

Click button in UI will not affect the background of Stackpanel.

How to solve this?

Pana
Telerik team
 answered on 08 Nov 2011
0 answers
116 views
I am using RadGrid in my WPF application. And it is unbounded mode. I want to updatew grid manually, could you please tell me How can I get grid view row from gridviewgrouprow
Nirmal
Top achievements
Rank 1
 asked on 08 Nov 2011
0 answers
99 views
Hi
we need to add a couple of buttons to the HorizontalTimelineGroupTemplate
but the buttons remain disabled.
we tried to change it through the

OrientedTimeRulerItemStyleSelector.HorizontalGroupItemStyle

but it doesn`t seem to work.
Thanks
<scheduleView:TimeRulerItemTemplateSelector x:Key="timeRulerItemTemplateSelector" >
            <scheduleView:TimeRulerItemTemplateSelector.HorizontalTimelineGroupTemplate>
                <DataTemplate>
                    <StackPanel Orientation="Horizontal" IsEnabled="True" Focusable="True">
                        <TextBlock Text="{Binding FormattedValue}" Background="Red"/>
                        <Button Content="+" IsEnabled="True"/>
                        <Button Content="-"/>
                        <TextBox Width="20" Text="123"/>
                    </StackPanel>
                </DataTemplate>
            </scheduleView:TimeRulerItemTemplateSelector.HorizontalTimelineGroupTemplate>
Luigi
Top achievements
Rank 1
 asked on 08 Nov 2011
4 answers
211 views
Hi,there,
I'm using RadDataPager, it works well before I changed the source.There is nothing at all in the firstpage.but,when I changed the page index,it returns to normal(it refreshes).How to solve the refreshing problem?

thank you and best wishes,
Sky Yu
Yu
Top achievements
Rank 1
 answered on 08 Nov 2011
2 answers
202 views
is there any documentation on Styling Docking?
Chiara
Top achievements
Rank 1
 answered on 08 Nov 2011
1 answer
450 views

Hey,

I know its a bit hasty, what i wanted to apply custom style on RadMaskedNumericInput Control and it just not working for me.
I'm not good at styling but the peice of code given below worked for my default .NET textbox. But when i apply it to RadTextbox it froze the input area, although applies the facny rounded corner and color.

Please tell me what am i doing wrong here.




 

 

<Style x:Key="TextBox" TargetType="{x:Type my:BaseNumericBox}">

 

 

<Setter Property="SnapsToDevicePixels"

 

Value="True" />

 

 

<Setter Property="OverridesDefaultStyle"

 

Value="True" />

 

 

<Setter Property="KeyboardNavigation.TabNavigation"

 

Value="none" />

 

 

<Setter Property="FocusVisualStyle"

 

Value="{x:Null}" />

 

 

<Setter Property="MinWidth"

 

Value="120" />

 

 

<Setter Property="MinHeight"

 

Value="20" />

 

 

 

<Setter Property="AllowDrop"

 

Value="true" />

 

 

 

<Setter Property="Template">

 

 

<Setter.Value>

 

 

<ControlTemplate TargetType="{x:Type my:BaseNumericBox}">

 

 

<Grid>

 

 

<Border Name="Border"

 

CornerRadius="2"

 

Padding="2"

 

BorderThickness="1">

 

 

<Border.Background>

 

 

<SolidColorBrush Color="{DynamicResource TextBoxControlLightColor}" />

 

 

</Border.Background>

 

 

<Border.BorderBrush>

 

 

<SolidColorBrush Color="{DynamicResource TextBoxBorderMediumColor}" />

 

 

</Border.BorderBrush>

 

 

<VisualStateManager.VisualStateGroups>

 

 

<VisualStateGroup x:Name="CommonStates">

 

 

<VisualState x:Name="Disabled">

 

 

<Storyboard>

 

 

<ColorAnimationUsingKeyFrames Storyboard.TargetName="Border"

 

Storyboard.TargetProperty="(Panel.Background).

(SolidColorBrush.Color)">

 

 

<EasingColorKeyFrame KeyTime="0"

 

Value="{DynamicResource TextBoxDisabledControlLightColor}" />

 

 

</ColorAnimationUsingKeyFrames>

 

 

</Storyboard>

 

 

</VisualState>

 

 

<VisualState x:Name="Normal">

 

 

<Storyboard>

 

 

<ColorAnimationUsingKeyFrames Storyboard.TargetName="Border"

 

Storyboard.TargetProperty="(Panel.Background).

(SolidColorBrush.Color)">

 

 

<EasingColorKeyFrame KeyTime="0"

 

Value="{DynamicResource TextBoxControlLightColor}" />

 

 

</ColorAnimationUsingKeyFrames>

 

 

</Storyboard>

 

 

</VisualState>

 

 

<VisualState x:Name="ReadOnly">

 

 

<Storyboard>

 

 

<ColorAnimationUsingKeyFrames Storyboard.TargetName="Border"

 

Storyboard.TargetProperty="(Panel.Background).

(SolidColorBrush.Color)">

 

 

<EasingColorKeyFrame KeyTime="0"

 

Value="{DynamicResource TextBoxDisabledControlDarkColor}" />

 

 

</ColorAnimationUsingKeyFrames>

 

 

</Storyboard>

 

 

</VisualState>

 

 

 

<VisualState x:Name="MouseOver" />

 

 

</VisualStateGroup>

 

 

</VisualStateManager.VisualStateGroups>

 

 

<ScrollViewer Margin="0"

 

x:Name="PART_ContentHost" />

 

 

</Border>

 

 

</Grid>

 

 

<ControlTemplate.Triggers>

 

 

<MultiTrigger>

 

 

<MultiTrigger.Conditions>

 

 

<Condition Property="IsFocused" Value="False"></Condition>

 

 

<Condition Property="Text" Value=""></Condition>

 

 

</MultiTrigger.Conditions>

 

 

<MultiTrigger.Setters>

 

 

</MultiTrigger.Setters>

 

 

</MultiTrigger>

 

 

<Trigger Property="IsFocused" Value="True">

 

 

<!--<Setter Property="BorderThickness" TargetName="BorderBase" Value="2.4,2.4,1,1"></Setter>-->

 

 

</Trigger>

 

 

<Trigger Property="IsEnabled" Value="False">

 

 

<Setter Property="Foreground" Value="DimGray" />

 

 

<!--<Setter Property="FontStyle" Value="Italic" />-->

 

 

</Trigger>

 

 

</ControlTemplate.Triggers>

 

 

</ControlTemplate>

 

 

</Setter.Value>

 

 

</Setter>

 

 

 

 

</Style>

Tina Stancheva
Telerik team
 answered on 08 Nov 2011
3 answers
129 views
Hi there,
    I'm using a telerik radwindow and I want add a pdf document to it ,but it dosen't show anything except when in this area the cursor changes,but it works well when I use a WPF window,because of a property of WPF window called 'AllowTransparent',when I give a false value to this property,the pdf appearance normaly,First,radwindow does not have this property,second,is there anything else makes radwindow not showing Pdf?
    Could I use radwindow to show Pdf inside?
Miroslav Nedyalkov
Telerik team
 answered on 08 Nov 2011
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
Bohdan
Top achievements
Rank 3
Iron
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Elliot
Top achievements
Rank 1
Iron
Iron
Iron
Sunil
Top achievements
Rank 1
Cynthia
Top achievements
Rank 1
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Bohdan
Top achievements
Rank 3
Iron
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Elliot
Top achievements
Rank 1
Iron
Iron
Iron
Sunil
Top achievements
Rank 1
Cynthia
Top achievements
Rank 1
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?