Telerik Forums
UI for WPF Forum
1 answer
109 views

Hi,

I've got a DataForm with a QueryableEntityCollectionView as ItemSource.
The QueryableEntityCollectionView is filtered, the DataForm as a custom CommandProvider.

An exception occurs when DataForm.AddNewItem() is beeing hit. "An unhandled exception of type 'System.NullReferenceException' occurred in Telerik.Windows.Data.dll" this is not happening when there is no filter active. Any idea why this is happening and how to have a filter active and add a new item?

Cheers! Eric

Ivan Ivanov
Telerik team
 answered on 30 Dec 2016
2 answers
81 views
It happened that we use Telerik.Windows.Documents.Model namespace for report generation. And I need "say" section (or paragraph) that it shouldn't contain page breaks. But as I understand Telerik.Windows.Documents.Model classes don't support keepTogeher property. Does workaround exist? Or am I wrong?
Vlad
Top achievements
Rank 1
 answered on 30 Dec 2016
3 answers
795 views

I have this style defined in the page resource

                <Style x:Key="MsgStatusStyle" TargetType="telerik:GridViewCell">
                    <Setter Property="Foreground" Value="Red" />
                    <Setter Property="HorizontalContentAlignment" Value="Left" />
                </Style>

I assign the style for a GridViewDataColumn as follows

                    <telerik:GridViewDataColumn DataMemberBinding="{Binding MsgStatus}" Header="Msg Status" UniqueName="MsgStatus" 
                                                IsReadOnly="True" IsVisible="{Binding  Data.GridColumns.MsgStatusIsVisible, Source={StaticResource proxy} , Mode=TwoWay}"
                                                DisplayIndex="{Binding  Data.GridColumns.MsgStatusOrder, Source={StaticResource proxy} , Mode=TwoWay}"
                                                SortMemberPath="MsgStatus" CellStyle="{StaticResource MsgStatusStyle}" >
                    </telerik:GridViewDataColumn>

But the foreground doesnt change to Red. If I change the property in the style definition to background that changes to red upon rendering.

Any idea why froeground color doesnt change ?

 

Ivan Ivanov
Telerik team
 answered on 30 Dec 2016
1 answer
89 views

I have a RadListBox with an ItemTemplate that contains a read-only RadNumericUpDown. When I click on the RadNumericUpDown, the list item is not selected. How can I make that happen?

 

Ivan Ivanov
Telerik team
 answered on 30 Dec 2016
4 answers
285 views

I'm attempting to change the SelectedUnfocused VisualState.  I've extracted the style using Blend, made the correction for the Item Template Selector, and have set the Selected Unfocused Visual State to StoryBoard.TargetName="SelectionVisual".  So focused/unfocused look the same.

I'm also setting the StyleManager.ApplicationTheme to Windows7Theme in the window constructor prior to the InitializeComponent() call.

Simple xaml.  I would expect the highlights to be a blue-ish color.  However, they are the orange-ish color.

<Grid>
<telerik:RadTreeView ItemsSource="{Binding Nodes}"
ItemTemplateSelector="{StaticResource TreeViewTemplateSelector}"
ItemContainerStyle="{DynamicResource RadTreeViewItemStyle1 }"/>
</Grid>

 

However, if I do this, setting a simple property on the Item Container Style, the theme works.

<Grid>
<telerik:RadTreeView ItemsSource="{Binding Nodes}"
ItemTemplateSelector="{StaticResource TreeViewTemplateSelector}">
<telerik:RadTreeView.ItemContainerStyle>
<Style TargetType="{x:Type telerik:RadTreeViewItem}">
<Setter Property="IsExpanded" Value="True"></Setter>
</Style>
</telerik:RadTreeView.ItemContainerStyle>
</telerik:RadTreeView>
<!--ItemContainerStyle="{DynamicResource RadTreeViewItemStyle1 }"/>-->
</Grid>

 

I know the second case doesn't change the unfocused selection visual state, so how might I get theming to work when basing the Item Container Style on a complete style?

 

Thanks,
Kenny

 

Petar Mladenov
Telerik team
 answered on 30 Dec 2016
1 answer
366 views

I've found very strange behavior.

A simple project contains the window with RadGridView. ItemsSource is binded to ViewModel.Rows where Rows is ObservableCollection.

I fill rows inside Window Loaded event.

RadGridView doen't updated if I don't use Rows.Clear() before Rows.Add().

Can you explain this?

 

Here is xaml:

01.<Window x:Class="TelerikWpfApp1.MainWindow"
04.        xmlns:telerik="http://schemas.telerik.com/2008/xaml/presentation"
05.        xmlns:local="clr-namespace:TelerikWpfApp1"
06.        Loaded="Window_Loaded">
07.    <Window.Resources>
08.        <local:ViewModel x:Key="vm"/>
09.    </Window.Resources>
10.    <Grid DataContext="{Binding Mode=OneWay, Source={StaticResource vm}}">
11.        <telerik:RadGridView ItemsSource="{Binding Rows}" />
12.    </Grid>
13.</Window>

 

And code behind:

01.using System.Collections.ObjectModel;
02.using System.Windows;
03. 
04.namespace TelerikWpfApp1
05.{
06.    public partial class MainWindow : Window
07.    {
08.        public MainWindow()
09.        {
10.            InitializeComponent();
11.        }
12. 
13.        private void Window_Loaded(object sender, RoutedEventArgs e)
14.        {
15.            var rows = ((ViewModel)FindResource("vm")).Rows;
16.            // to make it work uncomment the next row
17.            //rows.Clear();
18.            rows.Add(new Row { Name = "Name1", Column1 = "value1_1" });
19.            rows.Add(new Row { Name = "Name2", Column1 = "value2_1" });
20.        }
21.    }
22. 
23.    class Row
24.    {
25.        public string Name { get; set; }
26.        public string Column1 { get; set; }
27.    }
28. 
29.    class ViewModel
30.    {
31.        public ObservableCollection<Row> Rows { get; } = new ObservableCollection<Row>();
32.    }
33.}
Ivan Ivanov
Telerik team
 answered on 29 Dec 2016
1 answer
85 views

Hi,

I have a radform that is opened in the rowdetails of a radgrid that is in a radpane. If I change the value of a textbox, for example, and click on another control in the radform and then try to close pane, the previewclose event fires and I (after checking for changes) ask the user if they want to save changes and all is well. However, if instead of clicking on another control in the radform,  I close the pane either by clicking on the X in the upper right hand corner of the pane or via code by setting the visibility property to hidden, I never get the previewclose event. Is this a bug? Is there a work around?

Thanks ... Ed

 

Polya
Telerik team
 answered on 29 Dec 2016
4 answers
245 views
Hi,

I have requirement to display multiple columns under ComboBox with title and it should be also allow to sort RadGridView items. To achieve these requirement I decide to place a RadGridView inside RadComboBox.

I have almost achieved these requirement however there is only one issue. When I click on an item of RadGridView the RadComboBox is not closing down which is RadComboBox default behavior.

I tried to set IsDropDownOpen property of RadComboBox when user selects an item but it still not working.

To modify ControlTemplate of RadComboBox I referred to following blog.
http://www.nullskull.com/a/1359/wpf-datagrid-as-combobox-dropdown.aspx

In my case I have place RadGridView inside NonEditableTemplate. I don't know it's correct or not but yes it is working except the aforementioned issue. PFA image which displays the result so far I able to achieve.

Please help to resolve this issue.


Ivan Ivanov
Telerik team
 answered on 29 Dec 2016
1 answer
294 views

I've recently upgraded my visual studio from 2010 to 2015, and since them, I'm getting a lot of warnings in my output window like:

System.Windows.Freezable Warning: 1 : CanFreeze is returning false because a DependencyProperty on the Freezable has a value that is an expression; Freezable='System.Windows.Media.TranslateTransform'; Freezable.HashCode='10705061'; Freezable.Type='System.Windows.Media.TranslateTransform'; DP='X'; DpOwnerType='System.Windows.Media.TranslateTransform'
System.Windows.Freezable Warning: 1 : CanFreeze is returning false because a DependencyProperty on the Freezable has a value that is an expression; Freezable='System.Windows.Media.TranslateTransform'; Freezable.HashCode='1587067'; Freezable.Type='System.Windows.Media.TranslateTransform'; DP='X'; DpOwnerType='System.Windows.Media.TranslateTransform'
System.Windows.Freezable Warning: 1 : CanFreeze is returning false because a DependencyProperty on the Freezable has a value that is an expression; Freezable='System.Windows.Media.TranslateTransform'; Freezable.HashCode='4309168'; Freezable.Type='System.Windows.Media.TranslateTransform'; DP='X'; DpOwnerType='System.Windows.Media.TranslateTransform'
System.Windows.Freezable Warning: 1 : CanFreeze is returning false because a DependencyProperty on the Freezable has a value that is an expression; Freezable='System.Windows.Media.TranslateTransform'; Freezable.HashCode='59694858'; Freezable.Type='System.Windows.Media.TranslateTransform'; DP='X'; DpOwnerType='System.Windows.Media.TranslateTransform'
System.Windows.Freezable Warning: 1 : CanFreeze is returning false because a DependencyProperty on the Freezable has a value that is an expression; Freezable='System.Windows.Media.TranslateTransform'; Freezable.HashCode='1914083'; Freezable.Type='System.Windows.Media.TranslateTransform'; DP='X'; DpOwnerType='System.Windows.Media.TranslateTransform'
System.Windows.Freezable Warning: 1 : CanFreeze is returning false because a DependencyProperty on the Freezable has a value that is an expression; Freezable='System.Windows.Media.TranslateTransform'; Freezable.HashCode='19024873'; Freezable.Type='System.Windows.Media.TranslateTransform'; DP='X'; DpOwnerType='System.Windows.Media.TranslateTransform'
System.Windows.Freezable Warning: 1 : CanFreeze is returning false because a DependencyProperty on the Freezable has a value that is an expression; Freezable='System.Windows.Media.TranslateTransform'; Freezable.HashCode='50812954'; Freezable.Type='System.Windows.Media.TranslateTransform'; DP='X'; DpOwnerType='System.Windows.Media.TranslateTransform'
System.Windows.Freezable Warning: 1 : CanFreeze is returning false because a DependencyProperty on the Freezable has a value that is an expression; Freezable='System.Windows.Media.TranslateTransform'; Freezable.HashCode='4881566'; Freezable.Type='System.Windows.Media.TranslateTransform'; DP='X'; DpOwnerType='System.Windows.Media.TranslateTransform'
System.Windows.Freezable Warning: 1 : CanFreeze is returning false because a DependencyProperty on the Freezable has a value that is an expression; Freezable='System.Windows.Media.TranslateTransform'; Freezable.HashCode='18343908'; Freezable.Type='System.Windows.Media.TranslateTransform'; DP='X'; DpOwnerType='System.Windows.Media.TranslateTransform'
System.Windows.Freezable Warning: 1 : CanFreeze is returning false because a DependencyProperty on the Freezable has a value that is an expression; Freezable='System.Windows.Media.TranslateTransform'; Freezable.HashCode='20169503'; Freezable.Type='System.Windows.Media.TranslateTransform'; DP='X'; DpOwnerType='System.Windows.Media.TranslateTransform'
System.Windows.Freezable Warning: 1 : CanFreeze is returning false because a DependencyProperty on the Freezable has a value that is an expression; Freezable='System.Windows.Media.TranslateTransform'; Freezable.HashCode='35212414'; Freezable.Type='System.Windows.Media.TranslateTransform'; DP='X'; DpOwnerType='System.Windows.Media.TranslateTransform'
System.Windows.Freezable Warning: 1 : CanFreeze is returning false because a DependencyProperty on the Freezable has a value that is an expression; Freezable='System.Windows.Media.TranslateTransform'; Freezable.HashCode='41054801'; Freezable.Type='System.Windows.Media.TranslateTransform'; DP='X'; DpOwnerType='System.Windows.Media.TranslateTransform'
System.Windows.Freezable Warning: 1 : CanFreeze is returning false because a DependencyProperty on the Freezable has a value that is an expression; Freezable='System.Windows.Media.TranslateTransform'; Freezable.HashCode='35526744'; Freezable.Type='System.Windows.Media.TranslateTransform'; DP='X'; DpOwnerType='System.Windows.Media.TranslateTransform'
System.Windows.Freezable Warning: 1 : CanFreeze is returning false because a DependencyProperty on the Freezable has a value that is an expression; Freezable='System.Windows.Media.TranslateTransform'; Freezable.HashCode='55199627'; Freezable.Type='System.Windows.Media.TranslateTransform'; DP='X'; DpOwnerType='System.Windows.Media.TranslateTransform'
System.Windows.Freezable Warning: 1 : CanFreeze is returning false because a DependencyProperty on the Freezable has a value that is an expression; Freezable='System.Windows.Media.TranslateTransform'; Freezable.HashCode='955278'; Freezable.Type='System.Windows.Media.TranslateTransform'; DP='X'; DpOwnerType='System.Windows.Media.TranslateTransform'
System.Windows.Freezable Warning: 1 : CanFreeze is returning false because a DependencyProperty on the Freezable has a value that is an expression; Freezable='System.Windows.Media.TranslateTransform'; Freezable.HashCode='42987539'; Freezable.Type='System.Windows.Media.TranslateTransform'; DP='X'; DpOwnerType='System.Windows.Media.TranslateTransform'
System.Windows.Freezable Warning: 1 : CanFreeze is returning false because a DependencyProperty on the Freezable has a value that is an expression; Freezable='System.Windows.Media.TranslateTransform'; Freezable.HashCode='55391087'; Freezable.Type='System.Windows.Media.TranslateTransform'; DP='X'; DpOwnerType='System.Windows.Media.TranslateTransform'
System.Windows.Freezable Warning: 1 : CanFreeze is returning false because a DependencyProperty on the Freezable has a value that is an expression; Freezable='System.Windows.Media.TranslateTransform'; Freezable.HashCode='9570975'; Freezable.Type='System.Windows.Media.TranslateTransform'; DP='X'; DpOwnerType='System.Windows.Media.TranslateTransform'

 

 

It happens every time a value in the gridview is changed.

It affects the performance of visual studio, since the output window is very busy. 

Why it happens? It is something you are doing wrong and can be fixed?

Can I disable these warnings somehow?

 

Thanks.

Ivan Ivanov
Telerik team
 answered on 29 Dec 2016
4 answers
207 views
Hi,

I have an issue exporting a gridview to pdf when the gridview has a horizontal scrollbar and is wider than the container.

If I export without scrolling, the columns on the right hand side do not have their actual widths set properly, and are much less wide than the other columns. However, if I first scroll the scroll bar, and then scroll it back, when I export, the columns are the correct width.

Is there a way to programmatically do this? Is there a call on the gridview to auto size or best fit the columns or something like that? Do the columns actually have to be displayed on screen for the export to have the actual widths set?
Jacob
Top achievements
Rank 1
 answered on 29 Dec 2016
Narrow your results
Selected tags
Tags
+? more
Top users last month
Rob
Top achievements
Rank 3
Iron
Iron
Iron
Atul
Top achievements
Rank 1
Iron
Iron
Iron
Alexander
Top achievements
Rank 1
Veteran
Iron
Serkan
Top achievements
Rank 1
Iron
Shawn
Top achievements
Rank 1
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Rob
Top achievements
Rank 3
Iron
Iron
Iron
Atul
Top achievements
Rank 1
Iron
Iron
Iron
Alexander
Top achievements
Rank 1
Veteran
Iron
Serkan
Top achievements
Rank 1
Iron
Shawn
Top achievements
Rank 1
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?