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
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
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.");
}
}
<
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
>
<
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"
/>
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;
<
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
>
public class TngBaseTemplateControl : Control
{
/*
* Need to get the type of the control template using reflection, on "OnApplyTemplate"
*/
protected TngBaseTemplateControl()
{
}
}
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
}