Telerik Forums
UI for WPF Forum
6 answers
260 views

I recently downloaded the WPF Trial package 2010 Q2 SP2 since we’ll probably be using that at work. I did with a separate branch of our code that is currently in development and is currently using a WPF Toolkit grid with row details which the customers don’t really like since they want a nice looking “tree grid”.

I very quickly replaced the grid with a RadGridView using a HierarchicalChildTemplate and got it up and running very nice in less than 30 minutes. We showed it to our customers to show them what might be possible and they got really impressed both by the looks, the child level functionality and especially the grouping/filtering/sorting that existed out of the box.

When showing/testing it we only used already existing data and didn’t change the data.

So I happily started yesterday with changing a couple of more grids and then started to run the application and immediately got stuck with rows not getting unselected after being edited by code.

After spending almost a day without understanding what I do wrong even with the smallest example without hierarchy I thought I should try to ask for an explanation here.

What I have in my small sample app is an Order entity that implements INotifyPropertyChanged for its properties.

A PresentationModel class also implementing INotifyPropertyChanged that pretty much consists of an ObservableCollection<Order>.

In the code behind of the xaml window I set the DataContext of the window to a new instance of the PresentationModel and create a list with four orders (with different data that makes both the Equals and GetHashCode return different values for each order).

Then I create a RadGridView in XAML and bind it like this:

<telerik:RadGridView x:Name="orderGrid" ItemsSource="{Binding Orders}"/>

I also added a button to the XAML file where I loop through the SelectedItems like this:

foreach (Order order in orderGrid.SelectedItems)

{

    order.Customer = "Kalle";

}

 

When run the application select a row and press the button the Customer column gets nicely updated to Kalle, but when I select another row the first one stays selected and I can’t find any way to get it out of the SelectedItems collection. If I Ctrl-click the row to unselect it and select another row it looks like just the other row is selected, but the SelectedItems still contains also the changed row no matter what I do. If I select yet another row and press the button also both of the rows gets set to Kalle and then both are stuck selected.

 

I guess I must be doing something completely stupid or missing something obvious because I don’t find anyone else on the forums that are experiencing this and binding to an ObservableCollection with custom entities and changing data by code can’t be an uncommon scenario.

Milan
Telerik team
 answered on 17 Jun 2010
3 answers
101 views
Has anyone else found the level of changes to public members in each new release very frustrating?

Check out the attached screenshot of the calendar after upgrading to the 2010.1 603 release. It's basically non functional because we had a custom style and template that is no longer valid.

This experience holds true for the Calendar, GridView and Charts. We find ourselves constantly recreating styles with each new release and investing far too much time just to get these elements to look the way we want them to.

Unfortunately, the official answer from Telerik is "recreate the template" and "we cannot stop the development just to prevent the custom themes from breaking".

I'm concerned about the level of changes and the effort that goes into fixing styles with each upgrade. Is anyone else? Changing public members is just unreasonable.

See this post specifically for the Calendar:

--Mike

Vlad
Telerik team
 answered on 17 Jun 2010
2 answers
183 views
I think I've got myself in a Catch 22. I need a Carousel with both reflection and a horizontal scrollbar.

- It seems that the RadCarouselPanel doesn't support reflection, so I would have to use a RadCarousel control instead.
- It seems the best way to get a horizontal scrollbar underneath the carousel control is to use a ScrollViewer control around a RadCarouselPanel, however, then I'd lose the reflection that is required by the design comps. 

I've created a CustomItemTemplate to match the design from the designers below:

    <Grid Name="SceneCarouselGrid"
        <Grid.Resources> 
            <DataTemplate DataType="{x:Type local:Scene}"
                <Grid Width="285" Height="315"
                    <StackPanel> 
                        <Grid Name="ItemGrid"
                            <Grid.RowDefinitions> 
                                <RowDefinition Height="30" /> 
                                <RowDefinition Height="60*" /> 
                            </Grid.RowDefinitions> 
                            <Label Grid.Row="0" Content="{Binding Path=Title}" HorizontalAlignment="Center" HorizontalContentAlignment="Center" VerticalAlignment="Center" VerticalContentAlignment="Center" Margin="0" Name="SceneLabel" FontFamily="HelveticaNeue" FontWeight="Bold" FontSize="15" Background="#00000000" Foreground="White" /> 
                            <Border Grid.Row="1" x:Name="CarouselItemMainBorder" Margin="0" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" MinHeight="285" MinWidth="285" BorderThickness="3"
                                <Border.BorderBrush> 
                                    <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0"
                                        <GradientStop Color="#FFE8A13C" Offset="0" /> 
                                        <GradientStop Color="Transparent" Offset="1" /> 
                                    </LinearGradientBrush> 
                                </Border.BorderBrush> 
                                <Border.Background> 
                                    <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0"
                                        <GradientStop Color="#FFC1DCFF" Offset="0"/> 
                                        <GradientStop Color="#FF7EB8F8" Offset="1"/> 
                                    </LinearGradientBrush> 
                                </Border.Background> 
                                <Image Source="{Binding Path=Image}" VerticalAlignment="Stretch" HorizontalAlignment="Stretch" Height="285" Width="285" /> 
                            </Border> 
                        </Grid> 
                    </StackPanel> 
                </Grid> 
            </DataTemplate> 
        </Grid.Resources> 

Can you advise me on the best way to approach this? 

Thanks,
Scott
Scott
Top achievements
Rank 1
 answered on 16 Jun 2010
6 answers
284 views
I have a GridViewImageColumn databound to a string column in a datatable which contains a fully qualified http URL. I was hoping this would download and display the image in the grid, but it leaves the cell blank.

Should this work? If not, what is the simplest way to programmatically bind an image, via a URL, to a column?

Thanks.
jwhitley
Top achievements
Rank 1
 answered on 16 Jun 2010
3 answers
99 views
Hi,

Does the telerik controls in WPF support "shy toolbar"?

Thanks.
Valentin.Stoychev
Telerik team
 answered on 16 Jun 2010
7 answers
126 views
Hi,

We have an application using dock groups and the radpane control.

Whenever we change the tab in the dockgroup all the datacontexts for the controls in the radpane are being changed to a datacontext of one of the other tabs, so all the data is corrupted.

None of our code is changing the datacontext but the RadTabcontrol appears to be doing this. Only the datacontext for the controls is getting changed but not the radpanes datacontext!!!!

Below is the call stack? Any ideas why this is happening?

  PresentationFramework.dll!System.Windows.FrameworkElement.DataContext.set(object value) + 0x24 bytes
  Telerik.Windows.Controls.Navigation.dll!Telerik.Windows.Controls.RadTabControl.UpdateSelectedElementDataContext() + 0xc5 bytes
  Telerik.Windows.Controls.Navigation.dll!Telerik.Windows.Controls.RadTabControl.UpdateSelectedContainer(bool shouldFocus, Telerik.Windows.Controls.RadTabItem selectedItemContainer) + 0x5a bytes
  Telerik.Windows.Controls.Navigation.dll!Telerik.Windows.Controls.RadTabControl.UpdateSelectedContent(int newIndex) + 0x13b bytes
  Telerik.Windows.Controls.Navigation.dll!Telerik.Windows.Controls.RadTabControl.OnSelectedIndexChanged(int oldIndex, int newIndex) + 0x25a bytes
  Telerik.Windows.Controls.Navigation.dll!Telerik.Windows.Controls.RadTabControl.OnSelectedIndexChanged(System.Windows.DependencyObject sender, System.Windows.DependencyPropertyChangedEventArgs e) + 0x98 bytes
  WindowsBase.dll!System.Windows.DependencyObject.OnPropertyChanged(System.Windows.DependencyPropertyChangedEventArgs e) + 0x4c bytes
  PresentationFramework.dll!System.Windows.FrameworkElement.OnPropertyChanged(System.Windows.DependencyPropertyChangedEventArgs e) + 0x50 bytes
  WindowsBase.dll!System.Windows.DependencyObject.NotifyPropertyChange(System.Windows.DependencyPropertyChangedEventArgs args) + 0x3c bytes
  WindowsBase.dll!System.Windows.DependencyObject.UpdateEffectiveValue(System.Windows.EntryIndex entryIndex, System.Windows.DependencyProperty dp, System.Windows.PropertyMetadata metadata, System.Windows.EffectiveValueEntry oldEntry, ref System.Windows.EffectiveValueEntry newEntry, bool coerceWithDeferredReference, bool coerceWithCurrentValue, System.Windows.OperationType operationType) + 0x723 bytes
  WindowsBase.dll!System.Windows.DependencyObject.SetValueCommon(System.Windows.DependencyProperty dp, object value, System.Windows.PropertyMetadata metadata, bool coerceWithDeferredReference, bool coerceWithCurrentValue, System.Windows.OperationType operationType, bool isInternal) + 0x2eb bytes
  WindowsBase.dll!System.Windows.DependencyObject.SetValue(System.Windows.DependencyProperty dp, object value) + 0x35 bytes
  Telerik.Windows.Controls.Navigation.dll!Telerik.Windows.Controls.RadTabControl.SelectedIndex.set(int value) + 0x4d bytes
  Telerik.Windows.Controls.Navigation.dll!Telerik.Windows.Controls.RadTabControl.NotifyChildIsSelectedChanged(Telerik.Windows.Controls.RadTabItem child) + 0x7c bytes
  Telerik.Windows.Controls.Navigation.dll!Telerik.Windows.Controls.RadTabItem.OnIsSelectedChanged(bool oldValue, bool newValue) + 0x46 bytes
  Telerik.Windows.Controls.Navigation.dll!Telerik.Windows.Controls.RadTabItem.OnIsSelectedChanged(System.Windows.DependencyObject sender, System.Windows.DependencyPropertyChangedEventArgs e) + 0x9b bytes



Tina Stancheva
Telerik team
 answered on 16 Jun 2010
2 answers
137 views
We use the dll's from 28.05.2010, version 2010.1.0528.35.

It seems like the e.NewData in the CellEditEnded always is null. 
Rieni De Rijke
Top achievements
Rank 1
 answered on 16 Jun 2010
1 answer
117 views
I'm trying to style my Y-Axis striplines (eventually to be bound), but I can't seem to do so correctly. Declaritvely, I can set a single chart's ChartArea.AxisY.StripLinesVisibility to Collapsed, but everything I have tried makes it seem as if these guys were impervious to styles. So basically: how to:
  * Declare the style correctly in XAML
  * Set the style correctly in C#, at the time of Chart creation (I must do it like this, as the charts are created at run time)

Currently, I have in my XAML:
<UserControl.Resources> 
    <Style TargetType="Rectangle" x:Key="StripLinesYStyle
      <Setter Property="Visibility" Value="Collapsed" /> 
    </Style> 
</UserControl.Resources> 

and where I'm creating the chart I have

var stripLineStyle = this.Resources["StripLinesYStyle"as Style; 
myChart.DefaultView.ChartArea.AxisY.AxisStyles.StripLineStyle = stripLineStyle; 



Sia
Telerik team
 answered on 16 Jun 2010
2 answers
297 views

Hello,

I have a window with a RadToolbar and a button in this toolbar :

        <telerik:RadToolBar Height="32" HorizontalAlignment="Left" VerticalAlignment="Top" Width="388">  
            <Button Height="23" HorizontalAlignment="Left" VerticalAlignment="Top" Width="75" Name="button1">  
                Test  
            </Button>  
        </telerik:RadToolBar>  
 

All works fine, my button looks like a toolbar button (no border, no background).

But if I put a style on my button (even if the style is empty) :

        <telerik:RadToolBar Height="32" HorizontalAlignment="Left" VerticalAlignment="Top" Width="388">  
            <Button Height="23" HorizontalAlignment="Left" VerticalAlignment="Top" Width="75" Name="button1">  
                Test  
                <Button.Style>  
                    <Style TargetType="Button">  
                    </Style>  
                </Button.Style>  
            </Button>  
        </telerik:RadToolBar>  
 

my button looks like a normal button (with border and background).

Is there a workaround for this issue ?

Thank you.

Patrick VADEL
Top achievements
Rank 1
 answered on 16 Jun 2010
1 answer
168 views
Hi,
I am binding a list of objects to an InformationLayer and trying to display:
- some text
- some shape, tied to current location and zoom level.
XAML looks like that:
            <map:InformationLayer ItemsSource="{Binding Sales}"
                <map:InformationLayer.ItemTemplate> 
                    <DataTemplate> 
                        <Canvas map:MapLayer.Location="{Binding Location}"
                            <TextBlock Text="Hi world"/> 
                            <map:MapRectangle  
                                Location="{Binding Location}" 
                                Width="1" 
                                Height="1" 
                                RadiusX="0.1" 
                                RadiusY="0.1" 
                                Fill="#7FFFFF00" 
                                Stroke="Red" 
                                StrokeThickness="2" /> 
                        </Canvas> 
                    </DataTemplate> 
                </map:InformationLayer.ItemTemplate> 
            </map:InformationLayer> 

I can see the TextBlock (at the right location) but not the MapRectangle (beside, I have to use a custom attached property to bind the location!).
It seems that MapRectangle (or any drawable) can only be added as direct childs to the InformationLayer class.
Am I correct?
And if so, I see little use in the map shape classes!

Regards
Frederic
Andrey
Telerik team
 answered on 16 Jun 2010
Narrow your results
Selected tags
Tags
+? more
Top users last month
Jay
Top achievements
Rank 3
Iron
Iron
Iron
Benjamin
Top achievements
Rank 3
Bronze
Iron
Veteran
Radek
Top achievements
Rank 2
Iron
Iron
Iron
Bohdan
Top achievements
Rank 2
Iron
Iron
Richard
Top achievements
Rank 4
Bronze
Bronze
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Jay
Top achievements
Rank 3
Iron
Iron
Iron
Benjamin
Top achievements
Rank 3
Bronze
Iron
Veteran
Radek
Top achievements
Rank 2
Iron
Iron
Iron
Bohdan
Top achievements
Rank 2
Iron
Iron
Richard
Top achievements
Rank 4
Bronze
Bronze
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?