Telerik Forums
UI for WPF Forum
3 answers
37 views
I have two issues after updating from one set of components to another.

1) I previously had the following lines of code which, regardless of grouping/sorting, gave me a collection of objects currently viewable in the grid:

 foreach (GBundlingTradeOutput item in gridTradePackages.Items)
{
projects.Add(item);
}


When the code runs now I receive an error of the following:

Additional information: Unable to cast object of type 'Telerik.Windows.Data.AggregateFunctionsGroup' to type 'PostContract.Common.Classes.GBundlingTradeOutput'.

Why the change and how do i return to the functionality originally intended?

2) I have two datetime properties on objects bound to a grid. When i click on the cell I get the calendar picker and I can select a date which enters the value correctly in the cell. If I enter a value manually such as 01/02/2012 the value doesn't get bound to the property. Is this related to culture? I have a line of code:

this.Language = XmlLanguage.GetLanguage(CultureInfo.CurrentCulture.IetfLanguageTag);

The grid columns are as follows in the xaml:

                <telerik:GridViewDataColumn Width="200"
                                                DataMemberBinding="{Binding Path=AppointmentDate,
                                                                            UpdateSourceTrigger=PropertyChanged}"
                                                Header="Latest Appointment Date" DataFormatString="{} {0:d}"
                                                TextWrapping="Wrap" >
                    </telerik:GridViewDataColumn>
                    <telerik:GridViewDataColumn Width="140"
                                                DataMemberBinding="{Binding Path=StartDate,
                                                                            UpdateSourceTrigger=PropertyChanged}"
                                                Header="Start on Site Date" DataFormatString="{} {0:d}"
                                                TextWrapping="Wrap" >

Many thanks.

Rob

Vera
Telerik team
 answered on 22 Oct 2013
2 answers
255 views
Hi I'm having a strange issue with the RadComboBox popup menu not appearing. The project is designing a number of WPF applications to be used for a utility company's control center. They're using a Barco application to screen scrape the images from the image buffer and push them to the video wall controller. We had a similar problem where the application was not being detected by the Barco application and could not be pushed to the video wall. We found that if we set the <Window> element 'AllowsTransparency' property to false in the MainWindow.xaml  that the Barco would properly display the application.

The newest problem to occur is that the RadComboBox popup box isn't detected by the Barco while everything else on the application is. We're using the RadComboBox within a custom user control, so there is no 'AllowTransparency' property available. 

Is there some setting available on the RadComboBox that might be causing this issue? This problem is very unique and luckily we stumbled upon the 'AllowsTransparency' property originally. 

Thanks
Alan
Top achievements
Rank 1
 answered on 21 Oct 2013
6 answers
364 views
We have an application where we want to programatically scroll and select an item in the list. We are using ScrollIndexIntoViewAsync passing in an Action delegate. Sometimes the code doesn't get into the Action method. We know this because we have put in logging both in the method that calls ScrollIndexIntoViewAsync and into the delegate. It gets into the first but not the latter. So the grid scrolls but no item gets selected.

I have tried to reproduce this in a sample app but am not able to. Our application is quite complex, using a Virtual collection and dynamic columns. But I wouldn't think that these should affect whether the callback method is called. Is there something that could explain why the Action delegate does not always get called?

Thank you,
Valerie
Igor
Top achievements
Rank 1
 answered on 21 Oct 2013
1 answer
128 views

Hi I am looking for an sample application which uses WPF GridView and DataForm using MVVM to edit a single table.   I have seen an example of a data from within the table row but this is not really what and is not really practical for larger forms.    

Just a simple example that shows add/update/Delete etc.  I'm using entity framework if that matters.
Yoan
Telerik team
 answered on 21 Oct 2013
1 answer
166 views
I have the following two classes:
public class Gender
{
    public int Id { getset; }
    public string Name { getset; }
}
public class Person
{
    public string Name { getset; }
    public int? GenderId { getset; }
    public bool IsActive { getset; }
}

And I have the following RadGridView, bound to an ObservableCollection<Person>, wanting to use a ComboBox to choose their gender:

<telerik1:RadGridView x:Name="Grid"                              
                        ItemsSource="{Binding Persons}"
                        IsSynchronizedWithCurrentItem="True"
                        AutoGenerateColumns="False" 
                        ShowGroupPanel="False" 
                        ShowInsertRow="True"
                        CanUserInsertRows="true">
    <telerik1:RadGridView.Columns>
        <telerik1:GridViewDataColumn Header="Name" DataMemberBinding="{Binding Name}" Width="*" />
        <telerik1:GridViewComboBoxColumn
                Name="Gender"
                Header="Gender"  
                DataMemberBinding="{Binding GenderId}"
                DisplayMemberPath="Name"
                SelectedValueMemberPath="Id"
                ItemsSourceBinding="{Binding Genders}"
                EditTriggers="CellClick"
                IsReadOnly="False"
                Width="80"  />
        <telerik1:GridViewCheckBoxColumn
            DataMemberBinding="{Binding IsActive}"
            Header="Active"
            IsReadOnly="False" />
    </telerik1:RadGridView.Columns>
</telerik1:RadGridView>

I followed one of Telerik's examples I found somewhere to define the Combo column, and it has values
public partial class MainWindow : Window
{
    public MainWindow()
    {
        InitializeComponent();
        DataContext = this;
 
        Genders = new ObservableCollection<Gender>
            {
                new Gender {Id = 0, Name = "Female"},
                new Gender {Id = 1, Name = "Male"},
                new Gender {Id = 2, Name = "Withheld"}
            };
 
        Persons = new ObservableCollection<Person>
            {
                new Person {Name = "Andy", GenderId = 1, IsActive = false},
                new Person {Name = "Mary", GenderId = 0, IsActive = true},
                new Person {Name = "Peta", GenderId = 2, IsActive = true},
                new Person {Name = "Gerald", GenderId = 0, IsActive = true}
            };
    }
 
    public ObservableCollection<Gender> Genders { getset; }
    public ObservableCollection<Person> Persons { getset; }
}

So, I'm convinced I'm setting properties wrong on the GridViewComboBoxColumn or setting the wrong properties. 
What is wrong with the above scenario?



Maya
Telerik team
 answered on 21 Oct 2013
5 answers
266 views
Hello,

I am trying to add cut/copy/paste functionality to my RadDiagram, which is databound (MVVM) with a custom GraphSource.  The problem I have is that in the DeserializeNode method, it appears that a node on my GraphSource has already been created.  I was able to correctly deserialize my underlying model, but if I let add the item to my model, INPC/INCC events fire such that another item is also added to the GraphSource, so the result is two items in the graphsource, one of which my underlying model has no idea about.

I looked at implementing my own IDataTransferService so that I could override the Paste and not create a node on the graph, but this looks rather cumbersome.  

Is there an easier way to handle the paste such that I can update my model, and the node will be added to the view when the GraphSource is updated?

Thanks,
Steve
Pavel R. Pavlov
Telerik team
 answered on 21 Oct 2013
1 answer
66 views
Hi guys,

Can you help me, I'mn trying to style a radpane. I've followed the website (http://www.telerik.com/help/wpf/raddocking-styling-the-radpane.html).
When blend makes a copy of an object the designer says:


This way it is not possible to change the style

David Groenewegen
Masha
Telerik team
 answered on 21 Oct 2013
2 answers
463 views
Hello, Im using this code:
<telerik:RadListBox Name="testlv" SelectionChanged="testlv_SelectionChanged" telerik:StyleManager.Theme="Windows8Touch">
                <telerik:RadListBox.Resources>
                    <Style TargetType="ScrollBar">
                        <Setter Property="telerik:StyleManager.Theme" Value="Windows8Touch" />
                        <Setter Property="MinWidth" Value="40" />
                        <Setter Property="MinHeight" Value="40" />
                    </Style>
                </telerik:RadListBox.Resources>
                <telerik:RadListBox.ItemTemplate>
                    <DataTemplate>
                        <Border BorderBrush="Turquoise" BorderThickness="0,0,0,1" Width="{Binding Path=ActualWidth, ElementName=grdzero}">
                            <WrapPanel Orientation="Vertical" >
                                <TextBlock Foreground="Black" Text="{Binding nazwa}" FontSize="16"></TextBlock>
                                <WrapPanel Orientation="Horizontal">
                                    <TextBlock Foreground="Black" Text="Cena: "  FontSize="16"></TextBlock>
                                    <TextBlock Foreground="Black" Text="{Binding cena}"  FontSize="16"></TextBlock>
                                </WrapPanel>
                                <WrapPanel Orientation="Horizontal">
                                    <TextBlock Foreground="Black" Text="Kod: "  FontSize="16"></TextBlock>
                                    <TextBlock Foreground="Black" Text="{Binding kod}"  FontSize="16"></TextBlock>
                                </WrapPanel>
                            </WrapPanel>
                        </Border>
                    </DataTemplate>
                </telerik:RadListBox.ItemTemplate>
            </telerik:RadListBox>

And I'd like to change width and height of scrollbar to value equal 40. How can I do it? (At this momment scrollbars are too small and cant be really touch by finger and scroll down).

Thanks in advance!
Paweł
Top achievements
Rank 1
 answered on 21 Oct 2013
1 answer
201 views
Hi.

I have the following code in ViewModel:
   private ITileItemModel _currentItem;
        public ITileItemModel CurrentItem
        {
            get
            {
                return _currentItem;
            }
            set
            {
                if (_currentItem == value) return;
                if (func()) return;
                _currentItem = value;
                RaisePropertyChanged(() => CurrentItem);
            }
        }
For RaisePropertyChanged I have redefinition, so it will work fine.

The *,xaml is as following:
<telerik:RadBreadcrumb x:Name="NavigationBreadcrumb"
                               HorizontalAlignment="Stretch" VerticalAlignment="Top"
                               TextModePath="TilePath"
                               IsTextModeEnabled="False"
                               HeaderMemberPath="Header"
                               HierarchicalItemsSource="Children"
                               HierarchicalMemberPath="Header"
                               IsHistoryEnabled="False"
                               Header="{Binding Root}"   
                               ItemsSource="{Binding Root.Children}"
                               CurrentItem="{Binding CurrentItem, Mode=TwoWay}"
                               >
             </telerik:RadBreadcrumb>

If  func() returns true I am not changing CurrentItem, but the breadcrumb shows the item I have selected in it. And I have situation with different values in breadcrumb and CurerntItem.

Could you help me to resolve this issue?

Best regards,
Ilya.
Zarko
Telerik team
 answered on 21 Oct 2013
6 answers
528 views
Hello All,
I am trying to add a button in RadWinodw Title bar using its HeaderTemplate. Although button is visible on Title but its command is not properly binding and getting following error in Output window.
BindingExpression path error: 'SaveCommand' property not found on 'object' ''String' (HashCode=1384875945)'. BindingExpression:Path=SaveCommand; DataItem='String' (HashCode=1384875945); target element is 'Button' (Name=''); target property is 'Command' (type 'ICommand')

Here is my XAML portion.
<telerik:RadWindow.HeaderTemplate>
        <DataTemplate>
            <StackPanel Orientation="Horizontal">
                <Button x:Name="btn" Content="button" Command="{Binding Path=SaveCommand}" />               
            </StackPanel>
        </DataTemplate>
    </telerik:RadWindow.HeaderTemplate>

Here is my SaveCommand property in my ViewModel object.
private DelegateCommand _saveCommand;
        public ICommand SaveCommand
        {
            get
            {
                if(_saveCommand == null)
                    _saveCommand = new DelegateCommand(param => SaveIndicator(), param => CanSaveIndicator());
                return _saveCommand;
            }
        }
        public void SaveIndicator()
        {
        }
        protected bool CanSaveIndicator()
        {
            if (eAppState == AppState.Fresh)
                return false;
            return true;
        }
And here is how I am creating view and assigning its DataContext.
InterpolatedIndicators.AddEditIndicators view = new InterpolatedIndicators.AddEditIndicators();
            view.DataContext = new InterpolatedIndicators.AddEditIndicatorsViewModel();
            view.Owner = this;
            view.ShowDialog();

Kindly note that when I am placing this button in Window Content section, then Command binding is working fine.
I have also tried to set its RelativeSource using following code
<Button x:Name="btn" Content="button" Command="{Binding Path=DataContext.SaveCommand, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type Window}}}" />
But still it does not work.

Any help please.
Kalin
Telerik team
 answered on 21 Oct 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?