Telerik Forums
UI for WPF Forum
4 answers
330 views
Hi,

any easy way to replace the selected text with new style ?
Sopan
Top achievements
Rank 1
 answered on 03 Sep 2013
5 answers
362 views
hi,
Can we have grid lines that is shown on the graph as dotted lines instead of dashed lines?
<telerik:RadCartesianChart.Grid>
                    <telerik:CartesianChartGrid>
                        <telerik:CartesianChartGrid.Style>
                            <Style TargetType="telerik:CartesianChartGrid">
                                <Setter Property="MajorXLineDashArray" Value="10,5"/>
                                <Setter Property="MajorYLineDashArray" Value="10,5"/>
                                <Style.Triggers>
                                    <DataTrigger Binding="{Binding Path=DisplayGridLines}" Value="1">
                                        <Setter Property="MajorLinesVisibility" Value="X"/>
                                    </DataTrigger>
                                    <DataTrigger Binding="{Binding Path=DisplayGridLines}" Value="2">
                                        <Setter Property="MajorLinesVisibility" Value="Y"/>
                                    </DataTrigger>
                                    <DataTrigger Binding="{Binding Path=DisplayGridLines}" Value="3">
                                        <Setter Property="MajorLinesVisibility" Value="XY"/>
                                    </DataTrigger>
                                </Style.Triggers>
                            </Style>
                        </telerik:CartesianChartGrid.Style>

                        <telerik:CartesianChartGrid.MajorXLineStyle>
                            <Style TargetType="Line">
                                <Setter Property="Stroke" Value="Gray"/>
                            </Style>
                        </telerik:CartesianChartGrid.MajorXLineStyle>

                        <telerik:CartesianChartGrid.MajorYLineStyle>
                            <Style TargetType="Line">
                                <Setter Property="Stroke" Value="Gray"/>
                            </Style>
                        </telerik:CartesianChartGrid.MajorYLineStyle>
                    </telerik:CartesianChartGrid>
                </telerik:RadCartesianChart.Grid>

I have 10 points being shown on the graph. so the grid lines appear for all the 10 points. Can we have it just five and increase it if needed?
Please reply as soon as possible.

Petar Marchev
Telerik team
 answered on 02 Sep 2013
1 answer
92 views

When a property return type is ArraySegment<T> and properties are auto-generated, an exception is thrown and the control is not displayed.

My example specifically:

public class TestClass
{
    private readonly ArraySegment<string> _strings;
    public IReadOnlyList<string> Strings
    {
        get { return this._strings; }
    }
}
Maya
Telerik team
 answered on 02 Sep 2013
0 answers
79 views
Hi is there any possibility to pin RadPane from code behind? for example I have button inside radpane and after pressing the button I want to pin my RadPane

I am sorry for post I have my answer it is isPinned = false; (I had true value so It doesnt worked :D) please delete this topic :) thank you :)
Jiri
Top achievements
Rank 1
 asked on 02 Sep 2013
3 answers
183 views
In our project we want to load settings. Because of the origin of this settings structure these are very generic, exposed via wcf etc. So when we load them in our viewmodel they have the type Object. Also they consist of the real type information so we can convert them to the corresponding type. So far so good. 

When we load them in a gridview we would like to have different controls, for the different types. A Boolean should be a togglebutton, a int a numeric updown control and a string a regular textbox. For this approach we use Template selectors, but we also need to convert the types of the objects as described above. Therefore we use converters so the controls accepting the correct values and types. Until this point everything works great. We the problem arises when you scroll down in the grid. I guess you did some optimization. Therefore the templates and converters are evaluated when scrolling down. But in a different order then on initial loading. When the grid load for the first time, first the template is selected and then the converter. But when scrolling down, this order changes. To me that's a bit strange, because how can the converter be determined is there is no template. You will find sample code below. Only in our application there are binding errors showing up in the output window, in this example not. But the problem is still the same. Can we work around this issue, or need you guys to update this?

MainWindow:
<Grid>
        <Grid.Resources>
            <local:BooleanConverter x:Key="BooleanConverter" />
            <local:InvBooleanConverter x:Key="InvBooleanConverter" />
            <local:StringToIntConverter x:Key="StringToIntConverter" />
            <local:StringToDblConverter x:Key="StringToDblConverter" />
            <local:SettingValueTemplateSelector x:Key="SettingValueTemplateSelector" >
                <local:SettingValueTemplateSelector.BooleanTemplate>
                    <DataTemplate>
                        <StackPanel Orientation="Horizontal">
                            <telerik:RadRadioButton IsChecked="{Binding Path=Value}">
                                <TextBlock Text="Enabled"/>
                            </telerik:RadRadioButton>
                            <telerik:RadRadioButton IsChecked="{Binding Path=Value}">
                                <TextBlock Text="Disabled"/>
                            </telerik:RadRadioButton>
                        </StackPanel>
                    </DataTemplate>
                </local:SettingValueTemplateSelector.BooleanTemplate>
                <local:SettingValueTemplateSelector.IntTemplate>
                    <DataTemplate>
                        <telerik:RadNumericUpDown Value="{Binding Path=Value, Converter={StaticResource StringToIntConverter}}" NumberDecimalDigits="0"/>
                    </DataTemplate>
                </local:SettingValueTemplateSelector.IntTemplate>
                <local:SettingValueTemplateSelector.DoubleTemplate>
                    <DataTemplate>
                        <telerik:RadNumericUpDown Value="{Binding Path=Value,Converter={StaticResource StringToDblConverter}}" />
                    </DataTemplate>
                </local:SettingValueTemplateSelector.DoubleTemplate>
                <local:SettingValueTemplateSelector.StringTemplate>
                    <DataTemplate>
                        <TextBlock Text="{Binding Path=Value, Mode=TwoWay}" />
                    </DataTemplate>
                </local:SettingValueTemplateSelector.StringTemplate>
            </local:SettingValueTemplateSelector>
 
        </Grid.Resources>
        <telerik:RadGridView x:Name="RadGridView" GroupRenderMode="Flat"
                             RowIndicatorVisibility="Collapsed" CanUserFreezeColumns="False"
                             ItemsSource="{Binding ElementName=Window1, Path=List}"
                             IsReadOnly="false"
                             ScrollMode="Deferred"
                             AutoExpandGroups="True"
                             AutoGenerateColumns="false" Margin="0,2,0,-2">
            <telerik:RadGridView.Columns>
                <telerik:GridViewDataColumn
                    Header="Value"
                    IsGroupable="True"                   
                    DataMemberBinding="{Binding Value}" 
                    CellTemplateSelector="{StaticResource SettingValueTemplateSelector}"
                    Background="LightGray">
                </telerik:GridViewDataColumn>
                <telerik:GridViewDataColumn
                    Header="ValueType"
                    IsGroupable="True"                   
                    DataMemberBinding="{Binding ValueType}"                   
                    Background="LightGray">
                </telerik:GridViewDataColumn>
            </telerik:RadGridView.Columns>
        </telerik:RadGridView>
    </Grid>
Template selector:
public class SettingValueTemplateSelector : DataTemplateSelector
    {
        public override DataTemplate SelectTemplate(object item, DependencyObject container)
        {
            if (item is DataObjecten)
            {
                DataObjecten model = item as DataObjecten;
 
                if (model.ValueType == typeof(int))
                    return this.IntTemplate;
                else if (model.ValueType == typeof(String))
                    return this.StringTemplate;
                else if (model.ValueType == typeof(double))
                    return this.DoubleTemplate;
                else if (model.ValueType == typeof(bool))
                    return this.BooleanTemplate;
                else
                    return null;
            }
            return null;
        }
}

One of the converters (basic):
public class StringToIntConverter : IValueConverter
{
    public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
    {
        int retValue=0;
        if (int.TryParse(value.ToString(), out retValue))
        {
            return retValue;
        }
        else
            return 0;
    }
 
    public object ConvertBack(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
    {
          throw new NotSupportedException("Do not use this converter for objects other than boolean");
    }
}

Model:
public class DataObject
  {
      public object Value { get; set; }
      public Type ValueType { get; set; }
  }
 
          List.Add(new DataObject() { Value = "8", ValueType = typeof(int) });
          List.Add(new DataObject() { Value = "8", ValueType = typeof(double) });
          List.Add(new DataObject() { Value = "8gf", ValueType = typeof(string) });
          List.Add(new DataObject() { Value = 454365, ValueType = typeof(int) });
          List.Add(new DataObject() { Value = false, ValueType = typeof(bool) });

Nedyalko Nikolov
Telerik team
 answered on 02 Sep 2013
1 answer
175 views
Hi,

I'm having troubles with the onMouseEnter and onMouseLeave for the RadTreeViewItems.

Each time the mouse is over an item I need to show an image ("Gear")  beside this RadTreeviewItem. I'm showing this image with the onMouseEnter event and i'm hiding it with the onMouseLeave event. The problem is when i select a RadTreeViewItem that is inside another RadTreeViewItem. It shows its "Gear" and also its father "Gear".

The event is fired by the item that got the mouseOver and by all its fathers. the event should be fired only by the item with the mouse over.

can you please advise me?

thanks



Pavel R. Pavlov
Telerik team
 answered on 02 Sep 2013
2 answers
203 views
I'm working with a RadMaskedCurrencyInput control for the first time. It's bound to a SmallMoney column in a SQL Server 2008 R2 Express database, and it's hosted in a WPF DataGrid.

First question, I've removed the underlines, by changing the Placeholder property to " ". That works fine. NOw, how do I remove the thousands separator? Right now it looks a little funny, when there's something like $86.00 in the database. It looks like this: "$ , 86.00" (without the double quotes).

Second (this is more of a question concerning the interaction between the RadMaskedCurrencyInput control and the WPF DataGrid control), how many data templates do I have to specify within the DataGridTemplateColumn? This data grid needs to be able to display data, allow the user to edit the data, delete it and insert new data; basically normal CRUD operations. In order to help I'll show you what the XAML looks like right now:

<DataGridTemplateColumn x:Name="amountEarnedColumn" Header="Amount Earned" Width="SizeToHeader">
    <DataGridTemplateColumn.CellTemplate>
        <DataTemplate>
            <telerik:RadMaskedCurrencyInput Value="{Binding AmountEarned}" Mask="c5.2" Placeholder=" " />
        </DataTemplate>
    </DataGridTemplateColumn.CellTemplate>
    <DataGridTemplateColumn.CellEditingTemplate>
        <DataTemplate>
            <telerik:RadMaskedCurrencyInput Value="{Binding AmountEarned}" />
        </DataTemplate>
    </DataGridTemplateColumn.CellEditingTemplate>
</DataGridTemplateColumn>

Third, the AmountEarned column that is bound to, is not nullable. But $0.00 is a valid value, so how do I specify a default value of $0.00 when the user creates a new row?
Pavel R. Pavlov
Telerik team
 answered on 02 Sep 2013
1 answer
245 views
I know how to get the current RadPane that is visible in a group, bur how do I make one the selected one?
Georgi
Telerik team
 answered on 02 Sep 2013
1 answer
341 views
Hi I have a problem with DateTimePicker,
I put 3 DateTimePicker on tab control one for each tabitem.
Now i bind a SelectedTime to the Same propriety for all controls.
In the first tab the DateTimePicker work fine, on second tab the DateTimePicker when lost focus not update the Correct Value.

Please can you send me a response?
Thanks.
Paolo T.
Ventzi
Telerik team
 answered on 02 Sep 2013
1 answer
122 views
Hi there !

I've downloaded the latest WPF telerik components (Q2 2013).

I'm trying to implement drag &drop between one RadGridView and one RadTreeListView with autoscroll while dragging to the drop target (RadTreeListView) but have no success.

I only find exemples with RadTreeView using RadDragAndDropManager wich seems to be obsolete....

So my questions are :
Is this possible ? natively ? could you provide a sample project ?

thanks.

Regards
Nick
Telerik team
 answered on 02 Sep 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?