Telerik Forums
UI for WPF Forum
3 answers
778 views

What role does RadGridViewAutomationPeer? 

I have a RadGridView in my application, but when I change my DataContext to a new object containing a new List for the ItemsSource, the RadGridView is still holding all the old objects from the old List used by the ItemsSource in memory through this RadGridViewAutomationPeer. Not knowing what the AutomationPeer does, I'm at a bit of a loss as to how to get it to release those old objects. I wasn't able to find any useful information on this class. I've attached the memory retention chart from dotMemory showing my CurveSets being held.

Here's the xaml for the chart:

 

<telerik:RadGridView
    x:Name="CurveList"
    Grid.Row="1"
    AutoGenerateColumns="False" ItemsSource="{Binding Path=Wells}"
    IsFilteringAllowed="False" ShowGroupPanel="False" CanUserSortColumns="False"
    SelectionMode="Single"
    IsSynchronizedWithCurrentItem="True"
    CurrentItem="{Binding Path=DeclineConsolidator.CurrentCurve, Mode=TwoWay}"
    GroupRenderMode="Flat" EnableRowVirtualization="True">
    <telerik:RadGridView.Resources>
        <consolidator:WellNameStyleSelector x:Key="NameStyleSelector">
            <consolidator:WellNameStyleSelector.CleanStyle>
                <Style TargetType="{x:Type telerik:GridViewCell}">
                    <Setter Property="FontStyle" Value="Normal" />
                </Style>
            </consolidator:WellNameStyleSelector.CleanStyle>
            <consolidator:WellNameStyleSelector.DirtyStyle>
                <Style TargetType="{x:Type telerik:GridViewCell}">
                    <Setter Property="FontStyle" Value="Italic" />
                </Style>
            </consolidator:WellNameStyleSelector.DirtyStyle>
        </consolidator:WellNameStyleSelector>
    </telerik:RadGridView.Resources>
    <telerik:RadGridView.Columns>
        <telerik:GridViewDataColumn Header="" Width="25" MaxWidth="25" MinWidth="25" IsReadOnly="True">
            <telerik:GridViewDataColumn.CellTemplate>
                <DataTemplate>
                    <Image
                        Source="{Binding Source={x:Static pcc:ImageSourceConstants.WarningIcon}}"
                        Visibility="{Binding Path=IsValid, Converter={StaticResource InverseBoolToVisibilityConverter}}"
                        Tag="{Binding Path=ErrorMessageAlert}"
                        Width="15" Height="15" Margin="0,0,0,0">
                        <i:Interaction.Behaviors>
                            <infrastructure:ImageGridValidationBehaviour />
                        </i:Interaction.Behaviors>
                    </Image>
                </DataTemplate>
            </telerik:GridViewDataColumn.CellTemplate>
        </telerik:GridViewDataColumn>
        <telerik:GridViewDataColumn Header="{x:Static prop:Resources.WellListColumnHeader}"
                                    IsReadOnly="True"
                                    DataMemberBinding="{Binding Path=DisplayName}" Width="*"
                                    CellStyleSelector="{StaticResource NameStyleSelector}" />
    </telerik:RadGridView.Columns>
</telerik:RadGridView>

 

 

Martin
Telerik team
 answered on 07 Apr 2017
0 answers
97 views
Hi, my maskedtextinput is only allowed to have capitalized characters. May I ask how should I do that? I've enforced it on the model side but it moves the next available entry to the front of the masked instead of always keeping it maintained on the right.

band
Top achievements
Rank 1
 asked on 06 Apr 2017
3 answers
159 views
Is it possible to export grid data in partial trust XBAP application? I know that SaveFileDialog is not permited in partial trust, but Silverlight has his own SaveFileDialog and it works.

Next question. We want to print grid but the orginal form of print view is hopeless. There are not margins, some data is cutted, there are not title. Is it possible to override default print? We want to use the same filters and columns like in grid when print is generating.
band
Top achievements
Rank 1
 answered on 06 Apr 2017
0 answers
90 views

Hi, I'm using the same approach as a demo I came across on a forum post. It works well if the # of rows is small, but once you start to add hundreds of rows, the performance goes down dramatically. Any idea how to solve this?

Demo can be found here. It's almost like yours except with a for loop creating a larger dataset. Takes over 5 mins to get the print.

https://uploadz.co/w6b9ghawf6uu

band
Top achievements
Rank 1
 asked on 06 Apr 2017
1 answer
90 views

I am using you own example in Setting PropertSets 

In this I've set DisplayName of FillColor property, but it don't get it's this specified display name, but rather it shows the property name.

 

MainWindow.xaml

<Grid>
        <Grid.Resources>
            <local:ViewModel x:Key="vm" />
        </Grid.Resources>
        <telerik:RadPropertyGrid DataContext="{StaticResource vm}"
                        Item="{Binding Shapes}"
                        PropertySetMode="Intersection"/>
</Grid>

 

 

ViewModel.cs

public class ViewModel
    {
        public IEnumerable<object> Shapes
        {
            get
            {
                return new List<object>()
            {
                new Ellipse()
                {
                    Center = new Point(1,1),
                    FillColor = Colors.Red,
                    RadiusX1 = 4, RadiusX2 = 2
                    },
                    new RegularPolygon()
                {
                    Center = new Point(3,2),
                    FillColor = Colors.Blue,
                    CornersCount = 3,
                    SideLength = 10
                }
            };
            }
        }
    }
    public class Ellipse
    {
        [DisplayName("Fill Color")]
        public Color FillColor { get; set; }
        public double RadiusX1 { get; set; }
        public double RadiusX2 { get; set; }
        public Point Center {
            get;
            set; }
    }
    public class RegularPolygon
    {
        public int CornersCount { get; set; }
        public Color FillColor { get; set; }
        public Point Center {
            get;
            set; }
        public double SideLength { get; set; }
    }

 

Kindly suggest me it's solution.

Ivan Ivanov
Telerik team
 answered on 06 Apr 2017
3 answers
1.0K+ views
I am binding the GridView to a ViewModel that is responsible for loading the data from my repository. I would like to show a spinner control while the data is being loaded. Let's suppose I have a property on my ViewModel named DataLoading. I know I can accomplish this with a style, but I'm not sure which element of the GridView I should apply the style to.

How can I accomplish this with the GridView? I can easily hide the whole GridView and show a spinner, but instead I'd like to replace the area in which rows are presented with a spinner.

Thanks,
Mike
Ivan Ivanov
Telerik team
 answered on 06 Apr 2017
3 answers
135 views

Hi, 

I would like to ask how can I find RadCartesianChart on Visual Studio 2015 + Coded UI Test. 

http://www.telerik.com/teststudio/visual-studio-testing-plugin-benefits - This is same example for Grid. 

I try his but I can't have that option Find.ById

RadCartesianChart radCartesianChart = Find.

Milena
Telerik team
 answered on 06 Apr 2017
1 answer
95 views

Hi Telerik,

We have a RadDocking control in a child control that resides within a RadDocking control in a parent control.

The parent control contains a RadDocking control which encompasses a Tab control, and the child control resides in one of these Tab controls, where the RadDocking control resides in another TabControl inside the child control. The parent and child controls each have their own Views and VMs.

When binding 'SelectedItem' in myDatagrid, we receive the following binding error:

Cannot find source for binding with reference 'ElementName=myDatagrid, RelativeSource={RelativeSource=Self}'. BindingExpression:Path=SelectedItem; DataItem=null; target element is 'InvokeCommandAction' (HashCode=57688201); target property is 'CommandParameter' (type 'Object')

 

This error disappears and we are able to bind to 'SelecteItem' only when we remove the 2nd (second) RadDocking control within the parent.

Please see attached diagram for visual reference.

 

Could you please advise?

Kind regards

Dilyan Traykov
Telerik team
 answered on 06 Apr 2017
5 answers
360 views
 

Hi,

Like "FrozenColumnCount", Is there any provision for freezing rows?

Regards,
Norbert John

Ivan Ivanov
Telerik team
 answered on 06 Apr 2017
1 answer
371 views

Hi, I would like to change the color of my BusyIndicator. I have been able to change the background and the stroke but I can't modify the "spinner" colors.

This is quite a simple question that have been answered several times but I don't understand how to implement the solutions I saw in my code. Maybe you will be able to explain me the solution for the following code:

<ControlTemplate x:Key="GridViewLoadingIndicatorTemplate" TargetType="{x:Type grid:GridViewLoadingIndicator}">
        <Border x:Name="BusyIndicatorBackground" Background="#F1F1F1" Opacity="0">
            <VisualStateManager.VisualStateGroups>
                <VisualStateGroup x:Name="CommonStates">
                    <VisualState x:Name="Idle"/>
                    <VisualState x:Name="Loading">
                        <Storyboard RepeatBehavior="Forever">
                            <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="BusyIndicatorBackground" Storyboard.TargetProperty="Opacity">
                                <SplineDoubleKeyFrame KeyTime="0" Value="1"/>
                            </DoubleAnimationUsingKeyFrames>
                            <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="BusyIndicator" Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[2].(RotateTransform.Angle)">
                                <SplineDoubleKeyFrame KeyTime="00:00:01" Value="180"/>
                            </DoubleAnimationUsingKeyFrames>
                        </Storyboard>
                    </VisualState>
                </VisualStateGroup>
            </VisualStateManager.VisualStateGroups>
            <Path x:Name="BusyIndicator"
                Stretch="Fill"
                Stroke="{TemplateBinding BorderBrush}"
                StrokeThickness="{TemplateBinding BorderThickness}"
                Fill="{TemplateBinding Background}"
                Margin="{TemplateBinding Padding}"
                HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
                VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
                Width="36"
                Height="36"
                Data="M18,5.0000002 C10.820298,5 5,10.820298 5.0000002,18 5,25.179701 10.820298,31 18,31 25.179701,31 31,25.179701 31,18 31,10.820298 25.179701,5 18,5.0000002 z M18,0 C27.941126,0 36,8.0588746 36,18 36,27.941126 27.941126,36 18,36 8.0588746,36 0,27.941126 0,18 0,8.0588746 8.0588746,0 18,0 z"
                RenderTransformOrigin="0.5,0.5">
                <Path.RenderTransform>
                    <TransformGroup>
                        <ScaleTransform/>
                        <SkewTransform/>
                        <RotateTransform Angle="-180"/>
                        <TranslateTransform/>
                    </TransformGroup>
                </Path.RenderTransform>
            </Path>
        </Border>
    </ControlTemplate>
    <Style x:Key="GridViewLoadingIndicatorStyle" TargetType="{x:Type grid:GridViewLoadingIndicator}">
        <Setter Property="Template" Value="{StaticResource GridViewLoadingIndicatorTemplate}"/>
        <Setter Property="Background" Value="{StaticResource GridView_LoadingIndicatorBackground}"/>
        <Setter Property="BorderBrush" Value="{StaticResource GridView_LoadingIndicatorBorder}"/>
        <Setter Property="BorderThickness" Value="1"/>
        <Setter Property="Padding" Value="0"/>
        <Setter Property="VerticalContentAlignment" Value="Center"/>
        <Setter Property="HorizontalContentAlignment" Value="Center"/>
    </Style>

 

Thank you,

Antonin Charrier

 

PS: I'm quite new to WPF and Telerik, I think you understood it

Martin
Telerik team
 answered on 06 Apr 2017
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
Slider
Expander
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
WebCam
CardView
DataBar
Licensing
FilePathPicker
PasswordBox
Rating
SplashScreen
Accessibility
Callout
CollectionNavigator
Localization
AutoSuggestBox
HighlightTextBlock
Security
TouchManager
StepProgressBar
VirtualKeyboard
Badge
OfficeNavigationBar
ExpressionParser
CircularProgressBar
SvgImage
PipsPager
SlideView
AI Coding Assistant
+? more
Top users last month
Jay
Top achievements
Rank 3
Bronze
Iron
Iron
yw
Top achievements
Rank 2
Iron
Iron
Stefan
Top achievements
Rank 2
Iron
Iron
Iron
Kao Hung
Top achievements
Rank 1
Iron
Bohdan
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Jay
Top achievements
Rank 3
Bronze
Iron
Iron
yw
Top achievements
Rank 2
Iron
Iron
Stefan
Top achievements
Rank 2
Iron
Iron
Iron
Kao Hung
Top achievements
Rank 1
Iron
Bohdan
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?