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

I am wondering if it is possible to have different display formats for the DatePicker.
For example, to have a long date or short date displayed or a custom display.

Thanks,

Adam
Kaloyan
Telerik team
 answered on 02 Sep 2010
2 answers
221 views

Hi Teleriks,

I have a strange prolem with the panelbar orientation property.

I have wrapped the orientation property of the RadPanelbar to my own  like,

 

 

public Orientation Orientation

 

{

 

 

get { return (Orientation)PanelBar.GetValue(RadPanelBar.OrientationProperty); }

 

 

 

set { PanelBar.SetValue(RadPanelBar.OrientationProperty, value); }

 

 

 

}

 

 

public static readonly DependencyProperty OrientationProperty =

 

 

 

DependencyProperty.Register(

 

 

 

"Orientation", typeof(Orientation), typeof(TngPanelBar),

 

 

 

new FrameworkPropertyMetadata

 

{

PropertyChangedCallback = (obj, e) =>

{

(obj

 

as TngPanelBar).UpdateOrientation((Orientation)e.NewValue);

 

}

});

 

 

private void UpdateOrientation(Orientation sel)

 

{

PanelBar.Orientation = sel;

}


Case 1)

Iam able to access the property at the xaml , but the what ever value i set at the design mode( horizontal or vertical) by defalut it takes vertical.means the designer shows vertical and xaml (Orentation='Horizontal'). when i run the application it shows the 'horizantal' at runtime. when i stop debegging it shows the same problem like 'showing vertical at design time and horizontal at xaml). please refer the image panelbar_orientation

Please suggest me how to get rid of this .


Case 2)
in the next run,
When i change the value of orientation to 'vertical' from 'horizontal' at execute ,at runtime it showing the 'horizontal' allignment.
 Please refer to 'image panel_orientation_2 '

 IS this a  cache problem ?
Please suggest .


Thanks in advance,

Srinivas J

Thanks in advance,
Srinivas J

Kiril Stanoev
Telerik team
 answered on 02 Sep 2010
3 answers
98 views
When using an editable combobox, there is no beam in the box when typing.
Customers are a bit confused... Where am I?

<telerik:RadComboBox x:Name="MyComboBox" IsEditable="True"
                        ItemsSource="{Binding Kontakts}" 
                        SelectedItem="{Binding SelectedKontakt, Mode=TwoWay}"
                        DisplayMemberPath="Sted" IsReadOnly="True" Width="200"
                        HorizontalAlignment="Left" />    
Valeri Hristov
Telerik team
 answered on 02 Sep 2010
1 answer
87 views
I'm having some binding troubles and was wondering if you could help me out.
if ie:
sudo code
class Product
 prop parentid
 prop Name
 prop Color
 prop List<PricePerMonth>
 prop List<PricePerMonthHeader>
 prop List<Prouct> Children
  
class PricePerMonth
 prop Price

classPricePerMonthHeader
 prop Header

and the result would something like this:
Name | Color | Month 1 | Month 2 | Month 3... etc.
car x       blue        300          200               22    ....
     > some children
car z     red          10             22                 33
     > some children

Is there any good way to achieve this ?

Regards
Kristján.
Kristjan Einarsson
Top achievements
Rank 1
 answered on 01 Sep 2010
1 answer
111 views
Using the  XmlDataProvider I'm able to bind all the data to the correct elements. Works great in the MainWindow Xaml.  When I Put the TileView control in a page xaml using the same XmlDataProvider I'am able to bind all the elements except the image. I tried using a Imageconverter, but no luck. Is there a trick to get this to bind or I'm missing something?

Any thoughts?

Regards,
Rick

xmlns:local="clr-namespace:Digital_Kitchen_CdrPrint"
<local:ImageConverter x:Key="ImageConverter" />

<Image x:Name="listImg" Source="{Binding XPath=EmpImage, Converter={StaticResource ImageConverter}}"  Stretch="Uniform"/>

 

 

public class ImageConverter : IValueConverter

 

{

 

 

public object Convert(object value, Type targetType, object parameter,

 

CultureInfo culture)

{

String xml =

 

"<Tables>" + "<Table>" + ((XmlElement)value).InnerXml.ToString() + "</Table>" + "</Tables>";

 

XmlDocument XDoc =

 

new XmlDocument();

 

XDoc.LoadXml(xml);

 

 

// XmlNodeList oXmlNode = XDoc.GetElementsByTagName("Station");

 

 

 

//XmlNode node = XDoc.SelectSingleNode("RecipeName");

 

 

XmlNode oXnode = XDoc.SelectSingleNode(

 

"Tables/Table/EmpImage");

 

value = oXnode.LastChild.Value;

BitmapImage image =

 

new BitmapImage();

 

 

 

if (value != null)

 

{

 

 

try

 

{

image.BeginInit();

image.CacheOption = BitmapCacheOption.OnLoad;

image.CreateOptions = BitmapCreateOptions.IgnoreImageCache;

image.UriSource =

 

new Uri((string)value, UriKind.Absolute);

 

image.EndInit();

}

 

 

catch

 

{

image =

 

null;

 

}

}

 

 

return image;

 

}

 

 

public object ConvertBack(object value, Type targetType, object parameter,

 

CultureInfo culture)

{

 

 

throw new Exception("The method or operation is not implemented.");

 

}

}

Kiril Stanoev
Telerik team
 answered on 01 Sep 2010
3 answers
246 views
I was trying to follow along the demo RadControls for WPF -> Data -> GridView -> Appearance -> Custom Row Layout.
I am using a dataset as data source.  It works fine by default but I can't bind to columns after I apply RowStyle property.  I set up a 3 by 2 grid as custom layout and I can see the TextBlocks that are labels.  The TextBlocks that I bind columns do not display data.  Any ideas?

Here is my template
<ControlTemplate x:Key="MyCustomRowTemplate" TargetType="telerik:GridViewRow">
                <Border x:Name="rowsContainer" Background="#FF525252" Padding="8,8,8,0">
                    <Border Background="{StaticResource Office_BlackRowBackground}" x:Name="selectedRow"
                        BorderThickness="1" BorderBrush="#FF000000">
  
                        <Grid>
                            <Grid.RowDefinitions>
                                <RowDefinition />
                                <RowDefinition />
                                <RowDefinition />                                
                            </Grid.RowDefinitions>
                            <Grid.ColumnDefinitions>
                                <ColumnDefinition Width="Auto"/>
                                <ColumnDefinition Width="Auto" />
                            </Grid.ColumnDefinitions>
  
                            <TextBlock Text="Code:"
                                       Grid.Column="0" Grid.Row="0"
                                       VerticalAlignment="Top" HorizontalAlignment="Left" 
                                       Foreground="White" FontWeight="Bold" Margin="0,15,15,0" />
  
                            <TextBlock Text="{Binding CD}"
                                       Grid.Column="1" Grid.Row="0"
                                       VerticalAlignment="Top" HorizontalAlignment="Left"
                                       Foreground="White"  Margin="0,15,15,0" />
                              
                            <TextBlock Text="Description:"
                                       Grid.Column="0" Grid.Row="1"
                                       VerticalAlignment="Top" HorizontalAlignment="Left" 
                                       Foreground="White" FontWeight="Bold" Margin="0,15,15,0" />
  
                            <TextBlock Text="{Binding DESC}"  
                                       Grid.Column="1" Grid.Row="1"
                                       VerticalAlignment="Top" HorizontalAlignment="Left"
                                       Foreground="White"  Margin="0,15,15,0" />
                              
                            <TextBlock Text="Enabled:"
                                       Grid.Column="0" Grid.Row="2"
                                       VerticalAlignment="Top" HorizontalAlignment="Left" 
                                       Foreground="White" FontWeight="Bold" Margin="0,15,15,0" />
  
  
                            <TextBlock Text="{Binding ENABLED}"
                                       Grid.Column="1" Grid.Row="2"
                                       VerticalAlignment="Top" HorizontalAlignment="Left"
                                       Foreground="White"  Margin="0,15,15,0" />
  
                        </Grid>
                    </Border>
                </Border>
            </ControlTemplate>

and gridview
<telerik:RadGridView Grid.Row="2" Name="radGridView2" ItemsSource="{Binding}" 
                             Margin="5,5,5,5" HorizontalAlignment="Left" Visibility="Hidden" 
                             IsFilteringAllowed="False" RowSytle="{StaticResource rowStyle}" 
                             ShowGroupPanel="False" ShowColumnHeaders="False"  
                             RowIndicatorVisibility="Collapsed" CanUserReorderColumns="False"  />

Thanks
Kalin Milanov
Telerik team
 answered on 01 Sep 2010
1 answer
89 views

Hi I am using Telerik chart 2010.2.609.35 version.  I am using pie chart. In that the legend items colors are not match with the chart colors .

Here is my sample code to data bind to pie chart

            RadPieChart.DefaultSeriesDefinition = new PieSeriesDefinition();

            RadPieChart.DefaultSeriesDefinition.ItemLabelFormat = "#Y{C0}";

            SeriesMapping seriesMapping = new SeriesMapping();

            seriesMapping.ItemMappings.Add(new ItemMapping("Period", DataPointMember.LegendLabel));

            seriesMapping.ItemMappings.Add(new ItemMapping("Value", DataPointMember.YValue));

            RadPieChart.SeriesMappings.Add(seriesMapping);

            RadPieChart.ItemsSource = datatableARAgeing;

Nikolay
Telerik team
 answered on 01 Sep 2010
1 answer
124 views
Hi

I am trying to implement a custom RadToolBar control using control templating mechanism. I am having trouble with exposing Items property and not able to figure out how to expose it.

Code in Generic.Xaml

<Style TargetType="{x:Type local:TngToolBar}">
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type local:TngToolBar}">
                    <ControlsNavigation:RadToolBar Name="PART_BaseControl"
                        DataContext="{TemplateBinding Property=DataContext}"                           
                        ItemsSource="{Binding RelativeSource={RelativeSource FindAncestor,AncestorType={x:Type local:TngToolBar}},Mode=TwoWay, Path=ItemsSource}"
                          
                        ToolTip="{TemplateBinding Property=ToolTip}"
                        >
                    </ControlsNavigation:RadToolBar>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

Base Class Code:

public class TngBaseTemplateControl : Control
{
    /*
     * Need to get the type of the control template using reflection, on "OnApplyTemplate"
     */
    protected TngBaseTemplateControl()
    {
    }
}


Custom Toolbar Class:

public class TngToolBar : TngBaseTemplateControl 
{
    private Object _itemsSource;
    public override void OnApplyTemplate()
    {
        base.OnApplyTemplate();
        RadToolBar menu = this.Template.FindName("PART_BaseControl", this) as RadToolBar;
    }
    static TngToolBar()
    {
        DefaultStyleKeyProperty.OverrideMetadata(typeof(TngToolBar), new FrameworkPropertyMetadata(typeof(TngToolBar)));
    }
    #region Property: DataContext
    private Object _dataContext;
    public Object DataContext
    {
        get { return GetValue(DataContextProperty); }
        set { SetValue(DataContextProperty, value); }
    }
    public static readonly DependencyProperty DataContextProperty =
        DependencyProperty.Register(
            "DataContext", typeof(Object), typeof(TngToolBar),
             new FrameworkPropertyMetadata
             {
                 PropertyChangedCallback = (obj, e) =>
                 {
                     (obj as TngToolBar).UpdateDataContext((Object)e.NewValue);
                 }
             });
    private void UpdateDataContext(Object sel)
    {
        _dataContext = sel;
    }
    #endregion
    #region Property: ItemsSource
    public Object ItemsSource
    {
        get { return GetValue(ItemsSourceProperty); }
        set { SetValue(ItemsSourceProperty, value); }
    }
    public static readonly DependencyProperty ItemsSourceProperty =
        DependencyProperty.Register(
            "ItemsSource", typeof(Object), typeof(TngToolBar),
            new FrameworkPropertyMetadata
            {
                PropertyChangedCallback = (obj, e) =>
                {
                    (obj as TngToolBar).UpdateItemsSource(e.NewValue);
                }
            });
    private void UpdateItemsSource(Object sel)
    {
        _itemsSource = sel;
    }
    #endregion
                    
}

Viktor Tsvetkov
Telerik team
 answered on 01 Sep 2010
1 answer
121 views
Is it possible to move the zooming/panning control from the bottom middle of the map to the bottom left or bottom right?

Thanks

Chris R.
Andrey
Telerik team
 answered on 01 Sep 2010
1 answer
100 views
Hi,

I need to receive each value changed event on a RadNumerciDown instance. I thought it would be the case with the ValueChanged but this event occurs only when the focus is lost. The key down event doesn't work too...
Thus, I don't know which event I can listen or which method I have to override to get all the internal value changes.
Does anyone know a way to do it?

Thanks in advance
Boyan
Telerik team
 answered on 01 Sep 2010
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?