Telerik Forums
UI for WPF Forum
1 answer
105 views
Hi,

I'm not sure if this is related to this post but...
http://www.telerik.com/community/forums/wpf/gridview/grid-not-showing-any-rows.aspx
There I got the tip to set GroupRenderMode to flat, which helps "somehow".

I found another issue (but I guess it's to much effort to build a proofing example).

Another grid (working fine till one of the latest updates) is broken now.

After loading (prior to updating) the grid I do some dispatched (priority input) work from a different thread and my application breaks with an error.
I get a null reference exception in GridViewDataControl.cs somewhere in a PropertyChanged event handler.

When I remove my background processing it works "somehow" - but the image GridViewImageColumn shows the file path instead of an image.
If I open the view a second time the image is displayed.

At design time the designer breaks with a null ref exception- the stack trace:
Telerik.Windows.Controls.GridView.GridViewDataControl.<>c__DisplayClass40.<Telerik.Windows.Data.IWeakEventListener<System.ComponentModel.PropertyChangedEventArgs>.ReceiveWeakEvent>b__3f()
   at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs)
   at MS.Internal.Threading.ExceptionFilterHelper.TryCatchWhen(Object source, Delegate method, Object args, Int32 numArgs, Delegate catchHandler)

Maybe this helps you to track the problem.

Just to complete this post...
Since you (telerik) gave the tip at the other post...

In the (open and broken designer) I enter GroupRenderMode="Flat" - and the grid displays immediately.
This solves the problem at designtime - but unfortunately it still breaks at runtime.

When I remove my handler it no longer breaks totally - but at the first view I see the image flicker up and then the filename.
After I switch views I see the images.
When I resize my window so that some rows are hidden and make it larger again - the images at the covered rows are no longer displayed.
Resize from the other side so that the images are not covered but the rows are resized - I see (some of) them again.

The problem really has to do something with NotifyPropertyChanged because I can make the things a lot better if the initial binding does not fire PropertyChanged.

Let me explain - the class holds a lot of images loaded on demand.
So there is a property "TheImage" with a getter like if(_DEFImage==null) { TryToLoadImages(); } return(_DEFImage);....

And TryToLoadImages set the image properties (also "TheImage") through their setter, which fires NotifyPropertyChanged (which is intended).

I I - in the constructor of my ViewModel iterate through the TheImage properties (force a load) the grid binds fine.
BUT - the other issue (make window smaller to cover...) still exists.

Regards
Manfred
Vera
Telerik team
 answered on 17 Jul 2013
2 answers
303 views
 Hi, I've followed Telerik's guide for styling the GridView's Header row and everything
seems to work fine, but there's one column I was unable to remove it appears as black line "see the attached picture".
Where is this in the template?
and how to remove it?


<ControlTemplate TargetType="{x:Type telerik:GridViewHeaderRow}">
					<telerik:SelectiveScrollingGrid>
						<telerik:SelectiveScrollingGrid.ColumnDefinitions>
							<ColumnDefinition Width="11"/>
							<ColumnDefinition Width="14"/>
							<ColumnDefinition Width="Auto"/>
							<ColumnDefinition Width="Auto"/>
							<ColumnDefinition Width="*"/>
						</telerik:SelectiveScrollingGrid.ColumnDefinitions>
						<telerik:SelectiveScrollingGrid.RowDefinitions>
							<RowDefinition Height="Auto"/>
							<RowDefinition/>
						</telerik:SelectiveScrollingGrid.RowDefinitions>
						<telerik:CommonHeaderPresenter x:Name="PART_CommonHeaderPresenter" Grid.Column="4" IsTabStop="False" Grid.Row="1" d:LayoutOverrides="GridBox">
							
						</telerik:CommonHeaderPresenter>
						<Border x:Name="CommonHeaderIndent" BorderBrush="#00848484" BorderThickness="0" Background="{StaticResource Common_Background}" Grid.ColumnSpan="2" telerik:SelectiveScrollingGrid.SelectiveScrollingOrientation="Vertical" Visibility="{Binding Visibility, ElementName=PART_CommonHeaderPresenter}" Grid.Row="1" d:LayoutOverrides="GridBox"/>
						<Grid x:Name="PART_OuterGrid" Grid.ColumnSpan="5" Grid.Row="1">
							<Grid.RowDefinitions>
								<RowDefinition Height="*"/>
								<RowDefinition Height="*"/>
							</Grid.RowDefinitions>
							<Border x:Name="PART_GridViewHeaderRowBorder" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="0" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" Padding="{TemplateBinding Padding}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}">
								<Border BorderBrush="#004B4B4B" BorderThickness="0" Background="{StaticResource Common_Background}"/>
							</Border>
						</Grid>
						<telerik:DataCellsPresenter x:Name="PART_DataCellsPresenter" Grid.Column="4" IsTabStop="False" Grid.Row="1">
							
						</telerik:DataCellsPresenter>
						<Border x:Name="PART_IndicatorPresenter" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="0" Grid.Row="1" telerik:SelectiveScrollingGrid.SelectiveScrollingOrientation="Vertical" Visibility="{TemplateBinding RowIndicatorVisibility}" Width="25" Grid.ColumnSpan="2">
							<Border BorderBrush="#004B4B4B" BorderThickness="0" Background="{StaticResource Common_Background}">
								
							</Border>
						</Border>
						<telerik:IndentPresenter x:Name="PART_IndentPresenter" Grid.Column="4" IsTabStop="False" IndentLevel="{TemplateBinding IndentLevel}" MinHeight="{TemplateBinding MinHeight}" Grid.Row="1" telerik:SelectiveScrollingGrid.SelectiveScrollingOrientation="Vertical" d:LayoutOverrides="GridBox">
							<telerik:IndentPresenter.ItemTemplate>
								<DataTemplate>
									<telerik:GridViewHeaderIndentCell IsTabStop="False">
										
									</telerik:GridViewHeaderIndentCell>
								</DataTemplate>
							</telerik:IndentPresenter.ItemTemplate>
							
						</telerik:IndentPresenter>
						<Border x:Name="PART_CommonHeaderHierarchyIndentPresenterAllLevels" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="0" Background="{StaticResource Common_Background}" Grid.Column="4" Grid.Row="1" Grid.RowSpan="1" telerik:SelectiveScrollingGrid.SelectiveScrollingOrientation="Vertical" Width="25" Margin="0,0,233.907,0">
							<Border.Visibility>
								<Binding Path="HasHierarchy" RelativeSource="{RelativeSource TemplatedParent}">
									<Binding.Converter>
										<telerik:BooleanToVisibilityConverter/>
									</Binding.Converter>
								</Binding>
							</Border.Visibility>
						</Border>
						<Border x:Name="PART_CommonHeaderHierarchyIndentPresenterFirstLevel" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="0" Background="{StaticResource Common_Background}" Grid.Column="4" Margin="0,-1,233.907,0" Grid.Row="0" Grid.RowSpan="1" telerik:SelectiveScrollingGrid.SelectiveScrollingOrientation="Vertical" Width="25" d:LayoutOverrides="GridBox">
							<Border.Visibility>
								<Binding Path="HasHierarchy" RelativeSource="{RelativeSource TemplatedParent}">
									<Binding.Converter>
										<telerik:BooleanToVisibilityConverter/>
									</Binding.Converter>
								</Binding>
							</Border.Visibility>
						</Border>
						<Border x:Name="PART_HierarchyIndentPresenter" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="0" Grid.Column="4" Grid.Row="1" telerik:SelectiveScrollingGrid.SelectiveScrollingOrientation="Vertical" Width="25" Margin="0,0,233.907,0" d:LayoutOverrides="GridBox">
							<Border.Visibility>
								<Binding Path="HasHierarchy" RelativeSource="{RelativeSource TemplatedParent}">
									<Binding.Converter>
										<telerik:BooleanToVisibilityConverter/>
									</Binding.Converter>
								</Binding>
							</Border.Visibility>
							<Border BorderBrush="#004B4B4B" BorderThickness="0" Background="{StaticResource Common_Background}" />
						</Border>
					</telerik:SelectiveScrollingGrid>
				</ControlTemplate>
Dimitrina
Telerik team
 answered on 17 Jul 2013
9 answers
536 views

Hi,

I have a WPF project with a RadTreeView with loadondemand enabled and i want to be able to add/edit/delete item by a RadControlMenu in a mvvm context.
The project sample can be found here https://docs.google.com/file/d/0B6ihaOKSuZdBaHpxUVpPZzgzQ00/edit?usp=sharing. (.NET 4.5 with Telererik Controls Q2 2013). The sample load the folder on C drive for loadondemand but NOTHING is implemented when add/rename action are called (only UI).

1- I have a different behavior between empty/not empty folder. When i set the Expanded property to true in my viewmodel the loadondemand is well fired but when just after i add the new folder in my observablecollection, for empty folder the new folder is not shown (it's like the node is not expanded) and for folder with childs the new folder is well shown. 
   // Expanded = true fire the loadondemand if needed and open the treenode
   if (!this.Expanded) this.Expanded = true;

   // Insert the new newfolder
   // If the folder is empty when added the new folder the node is not show
   // If the folder is not empty, the folder is expanded and the node is show
   FolderWrapper newFolder = new FolderWrapper(new Folder() { Name = "New folder" });
   this._subFolders.Add(newFolder);

2- Like i want a couple less between my viewmodel and view, i use a event to fire the new folder into my view. I use the ExpandToPendingSelection sample (wpf treeview documentation) to select and bring the item into the view. But I don't found the way to set the item in editmode (even if i use a edittemplate). The item is not selected and the focus is always on treeview.

   ExpandToPendingSelection(path.ToString().Split('.'));

   Dispatcher.BeginInvoke(
    (Action)delegate
   {
    var treeViewItem = treeView.SelectedContainer;

    treeViewItem.IsInEditMode = true;

    // Now we can focus, select, edit the item:
    treeViewItem.Focus();
   });

3- When I add a new folder in a not expanded folder near the windows bottom and if the childs node fill the window the item is not bring into view.

Thanks,
Luc

 

 

Tina Stancheva
Telerik team
 answered on 17 Jul 2013
1 answer
57 views
Hellow,
 I build a RadControls WPF Application  in vs2012,but the Mainwindow.xaml is not a Radwindow ,I add a Radwindow and  set up  StartupUri=Radwindow.xaml,it does't work when running,How can I achieve this?
thanks  in advance
Kalin
Telerik team
 answered on 17 Jul 2013
1 answer
87 views
hi,
i could not found something about in the Forum and not in the Help but i try to ask this before starting to build my own one.
Is there a build in Dialog that i can call for dynamic customization of the Ribbon Bar like in Office where the user could cutomize the View itself. Adding new Groups , moving  and  hide controls inside , storing it local .... ?

regards.


Tina Stancheva
Telerik team
 answered on 17 Jul 2013
2 answers
367 views
Hello all
I have difficulty with RadContextMenu and particulary DataContext property.
I have a RadWindow ("mainWindow") who contain a RadTreeView. RadTreeView expose Items by HierarchicalDataTemplate, that this items who contains RadContextMenu.
My problem : DataContext of RadContextMenu is always DataContext of Item and I want the DataContext of the RadWindow.
I show you my XAML :
<telerik:RadWindow x:Class="Vue.MainWindow" x:Name="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">
<Grid x:Name="mainGrid">
   <telerik:RadTreeView x:Name="radTreeView" Grid.Row="1" ItemsSource="{Binding TypeDatabases}"
      <telerik:RadTreeView.Resources>
                  <HierarchicalDataTemplate DataType="{x:Type Modele:EntiteDatabase}" ItemsSource="{Binding Tables}">
                            <StackPanel Orientation="Horizontal" Height="25">
                                <Image Source="{Binding SourceIcone}" Stretch="Fill" Height="16"/>
                                <TextBlock Text="{Binding Description}" TextAlignment="Left" VerticalAlignment="Center" />
                                <telerik:RadContextMenu.ContextMenu>
                                    <telerik:RadContextMenu InheritDataContext="False" DataContext="{Binding DataContext, ElementName=mainWindow}">
                                        <telerik:RadMenuItem Header="Connexion" Command="{Binding OpenDatabase}" />
                                        <telerik:RadMenuItem Header="Déconnexion" Command="{Binding CloseDatabase}" />
                                    </telerik:RadContextMenu>
                                </telerik:RadContextMenu.ContextMenu>
                            </StackPanel>
                        </HierarchicalDataTemplate>
      </telerik:RadTreeView.Resources>
   </telerik:RadTreeView>
</Grid>
</telerik:RadWindow>
In this solution, I have an error : "cannot find ElementName=mainWindow" and I don't understand
I tried others methods to retrieve the DataContext (Tag in my StackPanel, ....)
Thank to you for help

PS : I am sorry for my english
Olivier
Top achievements
Rank 1
 answered on 17 Jul 2013
1 answer
355 views
Hi,

I am using RadGridView to display some data and one of the columns is of type DateTime. Filtering mode is set to FilterRow. How can I filter the column by date range like I can in ASP.NET AJAX RadGrid? 

Changing filtering mode to popup is not an option for me, I need it to be filter row. 

I would also like to know how to hide the filter button and set one default filter function like contains? All of these things can be easily done on web RadGrid, but I am not able to do it with WPF RadGrid.

Thank you,

Patrik
Rossen Hristov
Telerik team
 answered on 17 Jul 2013
2 answers
175 views
Hi,

is there any Example how to use Drag & Drop from DataGrid to Datagrid + From one mvvm to an other mmvm?

Thanks
Regards
ww
Wenjie
Top achievements
Rank 1
 answered on 17 Jul 2013
5 answers
128 views
when my X Axis is of a time int it works perfectly. But when i put it as a string an error occurs("Input string was not in a correct format")

My XAML is like this
<telerik:RadChart Name="radChartCAMois">
                        <telerik:RadChart.SeriesMappings>
                            <telerik:SeriesMapping LegendLabel="Chiffre d'affaire en DT">
                                <telerik:SeriesMapping.SeriesDefinition>
                                    <telerik:Area3DSeriesDefinition/>
                                </telerik:SeriesMapping.SeriesDefinition>
                                <telerik:SeriesMapping.ItemMappings>
                                    <telerik:ItemMapping DataPointMember="XValue" FieldName="IntValue"></telerik:ItemMapping>
                                    <telerik:ItemMapping DataPointMember="YValue" FieldName="StringValue"></telerik:ItemMapping>
                                </telerik:SeriesMapping.ItemMappings>
                            </telerik:SeriesMapping>
                        </telerik:RadChart.SeriesMappings>
                    </telerik:RadChart>

and my code behing is like this
List<MyClass> a = new List<MyClass>{new MyClass{intValue = 1,stringValue = "s1"},new MyClass{intValue = 2,stringValue = "s2"}};
radChartCAMois.ItemsSource = a;

where MyClass is like this
class MyClass
    {
        public int intValue;
        public string stringValue;
    }

Filander
Top achievements
Rank 1
 answered on 16 Jul 2013
1 answer
151 views
If some model property is decorated with [DataType(DataType.Password)] the gridview with autogeneratecolumn = true should have passwordbox ?
Yoan
Telerik team
 answered on 16 Jul 2013
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?