Telerik Forums
UI for WPF Forum
5 answers
563 views
Hi,

with the Q2 2013 update the SelectionChanged event of RadListBox does not fire anymore if an item is selected via code and the RadListBox is currently not visible. Is this new behaviour intended? I've switched back to the previous version.

Regards,
Michael
Georgi
Telerik team
 answered on 03 Jul 2013
1 answer
98 views
Hello.

In our solution we have to display multiple maps in different views of the application. We use different instances of the BingMapProvider for each of the map created. If we enable Tile Caching on at least two of the providers soon we run into the problem of accessing to the same cache file from two threads simultaneously, resulting in exception.

Is there any workaround for this issue?

Thanks.
Andrey
Telerik team
 answered on 03 Jul 2013
2 answers
94 views
Hello

I am trying something that I think the Outlookbar isn't created for, but I've no way else to do it (that I know of so please correct me if I'm wrong). Here is the story:
The view that i am creating has a gridview with grouping. The user can click on an item and edit its value. This can be a string, int, enum and so on. So i created a edittempateselctor that selected the right template. Everything worked, but then the costumer wanted something like the outlookbar to display the values. So I created that, but my problem is that my edittemplate isn't working anymore. The selected template is null. 
This is the working grid code:
<UserControl.Resources>
  <custom:EditTemplateSelector x:Key="EditTemplateSelector" />
</UserControl.Resources>
 
<telerik:RadGridView Grid.Row="2"
 ItemsSource="{Binding ListCollectionView, Mode=TwoWay}"
 SelectionMode="Single"
 AutoGenerateColumns="False"
 CanUserDeleteRows="False"
 CanUserFreezeColumns="False"
 CanUserReorderColumns="False"
 CanUserInsertRows="False"
 RowHeight="30"
 ColumnWidth="200"
 BorderThickness="0"
 ShowColumnHeaders="False"
 ShowGroupPanel="False"
 RowIndicatorVisibility="Collapsed"
  EditTriggers="CellClick">
 <telerik:RadGridView.Columns>
  <aucxis:GridViewDataColumn DataMemberBinding="{Binding SubID}" IsReadOnly="True"/>
  <aucxis:GridViewDataColumn DataMemberBinding="{Binding DataValue}"
   CellEditTemplateSelector="{DynamicResource EditTemplateSelector}"
   Width="Auto"/>
 </telerik:RadGridView.Columns>
</telerik:RadGridView>


this is the edittemplateselector.cs:
public class EditTemplateSelector : DataTemplateSelector
    {
        private IMessageBoxHandler _messageBoxHandler;
 
        public DataTemplate BoolDataTemplate { get; set; }
        public DataTemplate FloatDataTemplate { get; set; }
        public DataTemplate IntDataTemplate { get; set; }
        public DataTemplate StringTemplate { get; set; }
        public DataTemplate TimeSpanTemplate { get; set; }
        public DataTemplate EnumDataTemplate { get; set; }
        public DataTemplate FlagsEnumDataTemplate { get; set; }
        public DataTemplate InOutDoDataTemplate { get; set; }
 
        public override DataTemplate SelectTemplate(object item, DependencyObject container)
        {
            if (_messageBoxHandler == null)
                _messageBoxHandler = DependencyInjection.Container.Resolve<IMessageBoxHandler>();
 
            var dataObject = (DataObject)item;
            if (dataObject == null)
            {
                const string nullValue = "This item has a nullvalue and can't be edited";
                if (_messageBoxHandler != null)
                    _messageBoxHandler.Show(nullValue, "Let op!", MessageBoxButton.OK, MessageBoxImage.Warning);
                else
                    MessageBox.Show(nullValue, "Let op!", MessageBoxButton.OK, MessageBoxImage.Warning);
                return base.SelectTemplate(null, container);
            }
            switch (dataObject.DataValue.GetType().ToString())
            {
                //standard Types
                case "System.Boolean":
                    return BoolDataTemplate;
                case "System.Single":
                    return FloatDataTemplate;
                case "System.Int32":
                    return IntDataTemplate;
                case "System.TimeSpan":
                    return TimeSpanTemplate;
                case "System.String":
                    return StringTemplate;
                //Enum types
                case "Aucxis.VAUC.Shared.Types.AlarmRequestTypes":
                case "Aucxis.VAUC.Shared.Types.Proxy.AutoHandProxy":
                case "Aucxis.VAUC.Shared.Types.Proxy.CO2InjectieStatesProxy":
                case "Aucxis.VAUC.Shared.Types.Proxy.GasmetingStatesProxy":
                case "Aucxis.VAUC.Shared.Types.Proxy.HighLowProxy":
                case "Aucxis.VAUC.Shared.Types.Proxy.InOutTypeProxy":
                case "Aucxis.VAUC.Shared.Types.Proxy.KoelStatesProxy":
                case "Aucxis.VAUC.Shared.Types.Proxy.N2GeneratorKeuzeProxy":
                case "Aucxis.VAUC.Shared.Types.Proxy.N2GeneratorMethodesProxy":
                case "Aucxis.VAUC.Shared.Types.Proxy.N2GeneratorStatesProxy":
                case "Aucxis.VAUC.Shared.Types.Proxy.N2InjectieStatesProxy":
                case "Aucxis.VAUC.Shared.Types.Proxy.O2InjectieStatesProxy":
                case "Aucxis.VAUC.Shared.Types.Proxy.OntdooiTypesProxy":
                case "Aucxis.VAUC.Shared.Types.Proxy.RuimteCO2InjectieStandProxy":
                case "Aucxis.VAUC.Shared.Types.Proxy.RuimteGasModusProxy":
                case "Aucxis.VAUC.Shared.Types.Proxy.RuimteKoelModusProxy":
                case "Aucxis.VAUC.Shared.Types.Proxy.RuimteKoelStandProxy":
                case "Aucxis.VAUC.Shared.Types.Proxy.RuimteN2InjectieStandProxy":
                case "Aucxis.VAUC.Shared.Types.Proxy.RuimteO2InjectieStandProxy":
                case "Aucxis.VAUC.Shared.Types.Proxy.RuimteStatussenProxy":
                case "Aucxis.VAUC.Shared.Types.Proxy.RuimteTypesProxy":
                case "Aucxis.VAUC.Shared.Types.Proxy.VentStatesProxy":
                case "Aucxis.VAUC.Shared.Types.Proxy.VentWinnerProxy":
                case "Aucxis.VAUC.Shared.Types.Proxy.VerdamperModussenProxy":
                case "Aucxis.VAUC.Shared.Types.Proxy.WachtrijCommandoProxy":
                case "Aucxis.VAUC.Shared.Types.Proxy.WachtrijItemTypesProxy":
                    return EnumDataTemplate;
                //flagEnums
                case "Aucxis.VAUC.Shared.Types.Proxy.AlarmTypesProxy":
                case "Aucxis.VAUC.Shared.Types.Proxy.LogTypesProxy":
                    return FlagsEnumDataTemplate;
                case "Aucxis.VAUC.Shared.Types.Proxy.InOutDOProxy":
                    return InOutDoDataTemplate;
                //Custom types (not yet implemented)*/
                default:
                    const string notYetImplemented = "This type is not yet implemented. Edit will result in fail";
                    if (_messageBoxHandler != null)
                        _messageBoxHandler.Show(notYetImplemented, "Let op!", MessageBoxButton.OK, MessageBoxImage.Warning);
                    else
                        MessageBox.Show(notYetImplemented, "Let op!", MessageBoxButton.OK, MessageBoxImage.Warning);
                    return base.SelectTemplate(item, container);
            }
        }
    }

The resourcedictionary with the templates:
                    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
                    xmlns:custom="clr-namespace:Aucxis.VAUC.GUI.Client.Common.Custom;assembly=Aucxis.VAUC.GUI.Client.Common"
                    xmlns:aucxis="http://schemas.aucxis.com/1/wpf"
                    xmlns:converters="clr-namespace:Aucxis.VAUC.GUI.Client.Common.Converters;assembly=Aucxis.VAUC.GUI.Client.Common"
                    xmlns:controls="clr-namespace:Aucxis.iRAD.Controls;assembly=Aucxis.iRAD.Controls"
                    xmlns:touchScreenKeyBoard="clr-namespace:Aucxis.iRAD.Controls.Touch.Keyboard;assembly=Aucxis.iRAD.Controls.Touch"
                    xmlns:touch="clr-namespace:Aucxis.iRAD.Controls.Touch;assembly=Aucxis.iRAD.Controls.Touch"
                    xmlns:views="clr-namespace:Aucxis.VAUC.GUI.Client.Common.Custom.EditTemplates.Views;assembly=Aucxis.VAUC.GUI.Client.Common"
                    xmlns:controls2="clr-namespace:Aucxis.VAUC.GUI.Client.Common.Custom.Controls;assembly=Aucxis.VAUC.GUI.Client.Common">
    <ResourceDictionary.MergedDictionaries>
        <ResourceDictionary Source="pack://application:,,,/Aucxis.Client.WPF;component/Themes/Generic.xaml" />
        <ResourceDictionary Source="pack://application:,,,/Aucxis.iRAD.Controls.Touch;component/Themes/Generic.xaml" />
        <ResourceDictionary Source="pack://application:,,,/Aucxis.iRAD.Controls;component/Themes/Generic.xaml" />
    </ResourceDictionary.MergedDictionaries>
    <aucxis:IntToDoubleConverter x:Key="IntToDoubleConverter" />
    <aucxis:InverseBooleanConverter x:Key="InverseBooleanConverter" />
    <converters:SingleToDoubleConverter x:Key="SingleToDoubleConverter" />
    <custom:EditTemplateSelector x:Key="EditTemplateSelector">
        <custom:EditTemplateSelector.BoolDataTemplate>
            <DataTemplate>
                <views:BoolView SelectedBool="{Binding DataValue, Mode=TwoWay}"
                               IsEnabled="{Binding ReadOnly, Converter={StaticResource InverseBooleanConverter}}"
                               custom:FocusAttacher.Focus="{Binding ReadOnly, Converter={StaticResource InverseBooleanConverter}}"/>
            </DataTemplate>
        </custom:EditTemplateSelector.BoolDataTemplate>
        <custom:EditTemplateSelector.IntDataTemplate>
            <DataTemplate>
                <controls:NumericUpDown x:Name="NumericUpDown" Value="{Binding DataValue, Mode=TwoWay, Converter={StaticResource IntToDoubleConverter}}"
                                        IsEnabled="{Binding ReadOnly, Converter={StaticResource InverseBooleanConverter}}"
                                        touchScreenKeyBoard:TouchScreenNumericKeyboard.TouchScreenNumericKeyboard="True"
                                        NumberDecimalDigits="0"
                                        custom:FocusAttacher.Focus="{Binding ReadOnly, Converter={StaticResource InverseBooleanConverter}}"/>
            </DataTemplate>
        </custom:EditTemplateSelector.IntDataTemplate>
        <custom:EditTemplateSelector.EnumDataTemplate>
            <DataTemplate>
                <views:EnumView Value="{Binding DataValue, UpdateSourceTrigger=PropertyChanged}"/>
            </DataTemplate>
        </custom:EditTemplateSelector.EnumDataTemplate>
        <custom:EditTemplateSelector.FlagsEnumDataTemplate>
            <DataTemplate>
                <views:FlagsEnumView Value="{Binding DataValue, UpdateSourceTrigger=PropertyChanged}"/>
            </DataTemplate>
        </custom:EditTemplateSelector.FlagsEnumDataTemplate>
        <custom:EditTemplateSelector.FloatDataTemplate>
            <DataTemplate>
                <controls:NumericUpDown x:Name="NumericUpDown" Value="{Binding DataValue, Mode=TwoWay, Converter={StaticResource SingleToDoubleConverter}}"
                                        IsEnabled="{Binding ReadOnly, Converter={StaticResource InverseBooleanConverter}}"
                                        touchScreenKeyBoard:TouchScreenNumericKeyboard.TouchScreenNumericKeyboard="True"
                                        NumberDecimalDigits="2"
                                        custom:FocusAttacher.Focus="{Binding ReadOnly, Converter={StaticResource InverseBooleanConverter}}"/>
            </DataTemplate>
        </custom:EditTemplateSelector.FloatDataTemplate>
        <custom:EditTemplateSelector.InOutDoDataTemplate>
            <DataTemplate>
                <views:InOutDOView DataContext="{Binding DataValue, UpdateSourceTrigger=PropertyChanged}"/>
            </DataTemplate>
        </custom:EditTemplateSelector.InOutDoDataTemplate>
        <custom:EditTemplateSelector.StringTemplate>
            <DataTemplate>
                <touch:TextBox x:Name="txtBox" Text="{Binding DataValue, Mode=TwoWay}"
                               touchScreenKeyBoard:TouchScreenKeyboard.TouchScreenKeyboard="True"
                               IsEnabled="{Binding ReadOnly, Converter={StaticResource InverseBooleanConverter}}"
                               SelectAllOnFocus="True"
                               custom:FocusAttacher.Focus="{Binding ReadOnly, Converter={StaticResource InverseBooleanConverter}}"/>
            </DataTemplate>
        </custom:EditTemplateSelector.StringTemplate>
        <custom:EditTemplateSelector.TimeSpanTemplate>
            <DataTemplate>
                <controls2:TimeSpanPickerTouch x:Name="TimeSpan"
                                            Value="{Binding DataValue, Mode=TwoWay}"
                                            DaysVisible="False"
                                            HorizontalAlignment="Left"
                                            VerticalAlignment="Top"
                                            IsEnabled="{Binding ReadOnly, Converter={StaticResource InverseBooleanConverter}}"
                                            custom:FocusAttacher.Focus="{Binding ReadOnly, Converter={StaticResource InverseBooleanConverter}}"/>
            </DataTemplate>
        </custom:EditTemplateSelector.TimeSpanTemplate>
    </custom:EditTemplateSelector>
</ResourceDictionary>


Not working code:
<controls:RadOutlookBar Grid.Row="2"
 ItemsSource="{Binding Groups}"
 IsMinimizable="False">
 <controls:RadOutlookBar.TitleTemplate>
  <DataTemplate>
   <Label Content="{Binding Header}"/>
  </DataTemplate>
 </controls:RadOutlookBar.TitleTemplate>
 <controls:RadOutlookBar.ItemTemplate>
  <DataTemplate>
    <Label Content="{Binding Header}"/>
  </DataTemplate>
 </controls:RadOutlookBar.ItemTemplate>
 <controls:RadOutlookBar.ContentTemplate>
  <DataTemplate>
   <telerik:RadGridView Grid.Row="2"
    ItemsSource="{Binding DataObjects, Mode=TwoWay}"
    SelectionMode="Single"
    AutoGenerateColumns="False"
    CanUserDeleteRows="False"
    CanUserFreezeColumns="False"
    CanUserReorderColumns="False"
    CanUserInsertRows="False"
    RowHeight="30"
    ColumnWidth="200"
    BorderThickness="0"
    ShowColumnHeaders="False"
    ShowGroupPanel="False"
    RowIndicatorVisibility="Collapsed"
    EditTriggers="CellClick">
    <telerik:RadGridView.Columns>
      <aucxis:GridViewDataColumn DataMemberBinding="{Binding SubID}" IsReadOnly="True"/>
      <aucxis:GridViewDataColumn DataMemberBinding="{Binding DataValue}"
       CellEditTemplateSelector="{StaticResource EditTemplateSelector}"
       Width="Auto"/>
    </telerik:RadGridView.Columns>
   </telerik:RadGridView>
  </DataTemplate>
 </controls:RadOutlookBar.ContentTemplate>
</controls:RadOutlookBar>

So when I use this last implementation the datatemplates in the Edittemplateselector returns null.
They are In the same project in the same view, I just don't get it :)
Waut
Top achievements
Rank 1
 answered on 03 Jul 2013
1 answer
147 views
Hi there,

to display some wind directions it would be nice if it is possible, to set the degrees in the PolarChart clockwise.
But they always appear counter clockwise.
Is it possible to that?

Best regards
Manfred
Petar Kirov
Telerik team
 answered on 03 Jul 2013
3 answers
78 views

We are seeing a problem occasionally where, when switching the data displayed in the grid, some of the prior rows continue to display (see attached). These rows seem to just hang there since their location is not necessarily immediately following a valid row. Which is one way we know these are not actual rows that are part of our dataset. 

One way to make this happen is to go into insert mode on a cell and then click elsewhere (in our case it is in a tree control) to make the grid reload with new data that has fewer rows than it originally had. The hard part of this is that I have not been able to reproduce this in a sample application. Our actual application's use of the grid is quite rich with features (virtualization, attached properties, non-auto generated columns, asynch dataloading) so it is not easy to bring all this over to a sample. I do have my sample using the above except for the attached properties.

Has anyone seen anything like this? Any clues as to how to prevent? It doesn't just happen if you are in insert mode but that is a sure-fire way to make it happen. I've tried having the code call CancelEdit on the grid before it switches the data but that did not help.

I've attached 2 screen shots. One shows the phantom rows without having been in insert mode prior to capturing this screen. The other shows the case when the user was in insert mode. You can see the phantom row showing the insert indicator on the left. I've drawn a red box around these phantom rows in these screen shots.

Thank you, Valerie
Dimitrina
Telerik team
 answered on 03 Jul 2013
3 answers
103 views
Hi All
I have a grid with custom columns which are resizable. Whenever I resize a column or add a new column the headers and the rows are misaligned as in the attached image. But when I scroll everything is reset back and everything looks good.Did anyone face this issue. Any help is much appreciated.

     
Maya
Telerik team
 answered on 03 Jul 2013
14 answers
527 views
Hi,

in my RadGridView I have multiple columns and for all columns the IsFilterable property is set to true. Actually, for all columns who have a DataMemberBinding, the filtering icon are missing.

Thank's
Rossen Hristov
Telerik team
 answered on 03 Jul 2013
1 answer
195 views
I am using two RadListBoxes as well as a ItemCollection.  The are bound to observable collections of business objects.    When I drag items between them, I don't want the item to be removed from the collection, but rather just a copy placed where it was dragged to.  How would I keep the items in the list?   It seems no matter what I do, the item is removed from the list that it was drug from.
heavywoody
Top achievements
Rank 1
 answered on 03 Jul 2013
2 answers
155 views
I need to set a Cell in a Column to ReadOnly based on another value. How can I do this on a row by row basis?
Thanks in  advance,
Steve
public class RowData
{
    public String Description { get; set; }
    public bool CanEdit { get; set; }
}
Steve
Top achievements
Rank 1
 answered on 02 Jul 2013
2 answers
54 views
Hi all,
Should be Zoom-in/out slot's height,not width.



Wenjie
Top achievements
Rank 1
 answered on 02 Jul 2013
Narrow your results
Selected tags
Tags
+? more
Top users last month
Anislav
Top achievements
Rank 6
Silver
Bronze
Bronze
Jianxian
Top achievements
Rank 1
Iron
Marco
Top achievements
Rank 3
Iron
Iron
Iron
Jim
Top achievements
Rank 2
Iron
Iron
Nurik
Top achievements
Rank 2
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Anislav
Top achievements
Rank 6
Silver
Bronze
Bronze
Jianxian
Top achievements
Rank 1
Iron
Marco
Top achievements
Rank 3
Iron
Iron
Iron
Jim
Top achievements
Rank 2
Iron
Iron
Nurik
Top achievements
Rank 2
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?